From: "Leandro Andrade Travaglia" Date: Thu, 25 Mar 2004 16:04:55 +0000 Subject: [LARTC] MRTG and IPP2P - Iptables Message-Id: <000901c41282$eab78280$4505a8c0@leandro> MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0006_01C41269.C4BDB6D0" List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_0006_01C41269.C4BDB6D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, I'm trying to use MRTG to monitor and make graphs of my P2P traffic. I'm using IPP2P 0.5c - Iptables 1.2.9 The IPP2P was configured like this: example three: 01# iptables -t mangle -A PREROUTING -p tcp -j CONNMARK --restore-mark 02# iptables -t mangle -A PREROUTING -p tcp -m mark ! --mark 0 -j ACCEPT 03# iptables -t mangle -A PREROUTING -p tcp -m ipp2p --edk -j MARK = --set-mark 1 04# iptables -t mangle -A PREROUTING -p tcp -m ipp2p --dc -j MARK = --set-mark 2 05# iptables -t mangle -A PREROUTING -p tcp -m ipp2p --gnu -j MARK = --set-mark 3 06# iptables -t mangle -A PREROUTING -p tcp -m ipp2p --kazaa -j MARK = --set-mark 4 07# iptables -t mangle -A PREROUTING -p tcp -m ipp2p --apple -j MARK = --set-mark 5 08# iptables -t mangle -A PREROUTING -p tcp -j CONNMARK --save-mark 09# iptables -t mangle -A POSTROUTING -m mark --mark 1 -j ACCEPT 10# iptables -t mangle -A POSTROUTING -m mark --mark 2 -j ACCEPT 11# iptables -t mangle -A POSTROUTING -m mark --mark 3 -j ACCEPT 12# iptables -t mangle -A POSTROUTING -m mark --mark 4 -j ACCEPT 13# iptables -t mangle -A POSTROUTING -m mark --mark 5 -j ACCEPT I have only added the --soul and --bit networks, with mark 6 and = 7.......=20 And the command iptables -t mangle -L -n -v -x is working fine.... = SHowing all my P2P traffic of each different network : iptables -t mangle -L -n -v -x Chain PREROUTING (policy ACCEPT 31197 packets, 5559838 bytes) pkts bytes target prot opt in out source = destination 33059 9516328 CONNMARK tcp -- * * 0.0.0.0/0 = 0.0.0.0/0 CONNMARK restore 12001 5091047 ACCEPT tcp -- * * 0.0.0.0/0 = 0.0.0.0/0 MARK match !0x0 153 32656 MARK tcp -- * * 0.0.0.0/0 = 0.0.0.0/0 ipp2p v0.5c --edk MARK set 0x1 0 0 MARK tcp -- * * 0.0.0.0/0 = 0.0.0.0/0 ipp2p v0.5c --dc MARK set 0x2 0 0 MARK tcp -- * * 0.0.0.0/0 = 0.0.0.0/0 ipp2p v0.5c --gnu MARK set 0x3 57 24854 MARK tcp -- * * 0.0.0.0/0 = 0.0.0.0/0 ipp2p v0.5c --kazaa MARK set 0x4 0 0 MARK tcp -- * * 0.0.0.0/0 = 0.0.0.0/0 ipp2p v0.5c --apple MARK set 0x5 2 154 MARK tcp -- * * 0.0.0.0/0 = 0.0.0.0/0 ipp2p v0.5c --soul MARK set 0x6 0 0 MARK tcp -- * * 0.0.0.0/0 = 0.0.0.0/0 ipp2p v0.5c --bit MARK set 0x7 20324 4360417 CONNMARK tcp -- * * 0.0.0.0/0 = 0.0.0.0/0 CONNMARK save Chain INPUT (policy ACCEPT 16997 packets, 3182031 bytes) pkts bytes target prot opt in out source = destination Chain FORWARD (policy ACCEPT 26178 packets, 7467918 bytes) pkts bytes target prot opt in out source = destination Chain OUTPUT (policy ACCEPT 17072 packets, 3252442 bytes) pkts bytes target prot opt in out source = destination Chain POSTROUTING (policy ACCEPT 31071 packets, 5596377 bytes) pkts bytes target prot opt in out source = destination 11106 4799465 ACCEPT all -- * * 0.0.0.0/0 = 0.0.0.0/0 MARK match 0x1 0 0 ACCEPT all -- * * 0.0.0.0/0 = 0.0.0.0/0 MARK match 0x2 0 0 ACCEPT all -- * * 0.0.0.0/0 = 0.0.0.0/0 MARK match 0x3 657 269207 ACCEPT all -- * * 0.0.0.0/0 = 0.0.0.0/0 MARK match 0x4 0 0 ACCEPT all -- * * 0.0.0.0/0 = 0.0.0.0/0 MARK match 0x5 436 60031 ACCEPT all -- * * 0.0.0.0/0 = 0.0.0.0/0 MARK match 0x6 0 0 ACCEPT all -- * * 0.0.0.0/0 = 0.0.0.0/0 MARK match 0x7 MRTG is already working fine, monitoring my eth0 and eth1 traffic. Also = my CPU / Memory usage...... Can someone help me ? Best regards, LEANDRO TRAVAGLIA --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.639 / Virus Database: 408 - Release Date: 22/3/2004 ------=_NextPart_000_0006_01C41269.C4BDB6D0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi all,
 
I'm trying to use MRTG to monitor and = make graphs=20 of my P2P traffic.
I'm using IPP2P 0.5c - Iptables=20 1.2.9
The IPP2P was configured like = this:
 
example three:
01# iptables -t mangle -A =
PREROUTING -p tcp -j CONNMARK --restore-mark
02# iptables -t mangle -A PREROUTING -p tcp -m mark ! --mark 0 -j ACCEPT
03# iptables -t mangle -A PREROUTING -p tcp -m ipp2p --edk -j MARK =
--set-mark 1
04# iptables -t mangle -A PREROUTING -p tcp -m ipp2p --dc -j MARK =
--set-mark 2
05# iptables -t mangle -A PREROUTING -p tcp -m ipp2p --gnu -j MARK =
--set-mark 3
06# iptables -t mangle -A PREROUTING -p tcp -m ipp2p --kazaa -j MARK =
--set-mark 4
07# iptables -t mangle -A PREROUTING -p tcp -m ipp2p --apple -j MARK =
--set-mark 5
08# iptables -t mangle -A PREROUTING -p tcp -j CONNMARK --save-mark

09# iptables -t mangle -A POSTROUTING -m mark --mark 1 -j ACCEPT
10# iptables -t mangle -A POSTROUTING -m mark --mark 2 -j ACCEPT
11# iptables -t mangle -A POSTROUTING -m mark --mark 3 -j ACCEPT
12# iptables -t mangle -A POSTROUTING -m mark --mark 4 -j ACCEPT
13# iptables -t mangle -A POSTROUTING -m mark --mark 5 -j ACCEPT
 
I have only added the --soul and --bit = networks,=20 with mark 6 and 7....... 
And the command iptables -t mangle -L = -n -v -x is=20 working fine.... SHowing all my P2P traffic of each different network=20 :
 
iptables -t mangle -L -n -v = -x
Chain=20 PREROUTING (policy ACCEPT 31197 packets, 5559838 = bytes)
   =20 pkts      bytes target     = prot opt=20 in     out    =20 source           &= nbsp;  =20 destination
   33059  9516328 CONNMARK   = tcp =20 --  *      = *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = CONNMARK=20 restore
   12001  5091047 = ACCEPT    =20 tcp  --  *     =20 *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = MARK match=20 !0x0
     153    32656=20 MARK       tcp  -- =20 *      *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = ipp2p=20 v0.5c --edk MARK set 0x1
      =20 0        0=20 MARK       tcp  -- =20 *      *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = ipp2p=20 v0.5c --dc MARK set 0x2
      =20 0        0=20 MARK       tcp  -- =20 *      *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = ipp2p=20 v0.5c --gnu MARK set 0x3
      = 57   =20 24854 MARK       tcp  -- =20 *      *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = ipp2p=20 v0.5c --kazaa MARK set 0x4
      =20 0        0=20 MARK       tcp  -- =20 *      *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = ipp2p=20 v0.5c --apple MARK set 0x5
      =20 2      154 = MARK      =20 tcp  --  *     =20 *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = ipp2p=20 v0.5c --soul MARK set 0x6
      =20 0        0=20 MARK       tcp  -- =20 *      *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = ipp2p=20 v0.5c --bit MARK set 0x7
   20324  4360417=20 CONNMARK   tcp  --  *     =20 *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = CONNMARK=20 save
 
Chain INPUT (policy ACCEPT = 16997 packets,=20 3182031 bytes)
    pkts      = bytes=20 target     prot opt in    =20 out    =20 source           &= nbsp;  =20 destination
 
Chain FORWARD (policy ACCEPT = 26178=20 packets, 7467918 bytes)
    = pkts     =20 bytes target     prot opt in     = out    =20 source           &= nbsp;  =20 destination
 
Chain OUTPUT (policy ACCEPT = 17072 packets,=20 3252442 bytes)
    pkts      = bytes=20 target     prot opt in    =20 out    =20 source           &= nbsp;  =20 destination
 
Chain POSTROUTING (policy = ACCEPT 31071=20 packets, 5596377 bytes)
    = pkts     =20 bytes target     prot opt in     = out    =20 source           &= nbsp;  =20 destination
   11106  4799465 = ACCEPT    =20 all  --  *     =20 *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = MARK match=20 0x1
      =20 0        0 = ACCEPT    =20 all  --  *     =20 *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = MARK match=20 0x2
      =20 0        0 = ACCEPT    =20 all  --  *     =20 *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = MARK match=20 0x3
     657   269207=20 ACCEPT     all  -- =20 *      *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = MARK match=20 0x4
      =20 0        0 = ACCEPT    =20 all  --  *     =20 *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = MARK match=20 0x5
     436    60031=20 ACCEPT     all  -- =20 *      *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = MARK match=20 0x6
      =20 0        0 = ACCEPT    =20 all  --  *     =20 *      =20 0.0.0.0/0          &nbs= p;=20 0.0.0.0/0           = MARK match=20 0x7
 
MRTG is already working fine, = monitoring my eth0=20 and eth1 traffic. Also my CPU / Memory = usage......
 
Can someone help me ?
 
Best regards,
       =20     LEANDRO TRAVAGLIA
 

---
Outgoing mail is certified = Virus=20 Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: = 6.0.639 /=20 Virus Database: 408 - Release Date: 22/3/2004
------=_NextPart_000_0006_01C41269.C4BDB6D0-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/