iptables Chain Counter erhöht sich permanent

FreeBSD, Gentoo, openSUSE, CentOS, Ubuntu, Debian
hotzi
Posts: 197
Joined: 2004-04-14 09:04
Location: Bayern, Sulzemoos
 

iptables Chain Counter erhöht sich permanent

Post by hotzi »

Hallo allerseits,

ich habe nicht so viel Erfahrung mit iptables. Gestern habe ich mir komplett neue Regeln erstellt und habe nun "das Problem", dass die Paketzähler schnell hochlaufen, wo ich gerne verstehen würde, warum das so ist.

Die Maschine sieht so aus:

-Debian Etch
ath0 Link encap:Ethernet -> kein IP
br0 Link encap:Ethernet -> Bridge aus eth0 und ath0 -> IPv4
eth0 Link encap:Ethernet -> kein IP
eth1 Link encap:Ethernet -> kein IP -> führt zum DSL Modem, hier geht nur PPPOE drüber
lo Link encap:Local Loopback
ppp0 Link encap:Point-to-Point Protocol -> IPv4
wifi0 Link encap:UNSPEC -> kein IP

Meine Rules:

Code: Select all

iptables -L -vvv
Chain INPUT (policy ACCEPT 2148 packets, 382K bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       0    --  eth1   any     anywhere             anywhere
   34  3908 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp spt:domain dpts:1024:65535
    0     0 ACCEPT     0    --  ppp0   any     anywhere             anywhere            state RELATED
 1160  473K ACCEPT     0    --  ppp0   any     anywhere             anywhere            state ESTABLISHED
    1    40 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp flags:ACK/ACK
    0     0 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp dpt:ftp-data
    0     0 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp dpt:20
    0     0 ACCEPT     sctp --  ppp0   any     anywhere             anywhere            sctp dpt:20
    0     0 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp dpt:ftp
    0     0 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp dpt:fsp
    0     0 ACCEPT     sctp --  ppp0   any     anywhere             anywhere            sctp dpt:21
    0     0 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp dpt:ssh
    0     0 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp dpt:ssh
    0     0 ACCEPT     sctp --  ppp0   any     anywhere             anywhere            sctp dpt:22
    0     0 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp dpt:smtp
    0     0 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp dpt:25
    0     0 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp dpt:smtp
    0     0 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp dpt:25
    2   120 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp dpt:www
    0     0 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp dpt:www
    2   120 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp dpt:81
    0     0 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp dpt:81
    0     0 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp dpt:pop3
    0     0 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp dpt:pop3
    0     0 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp dpt:pop3s
    0     0 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp dpt:pop3s
    0     0 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp dpt:imaps
    0     0 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp dpt:imaps
    0     0 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp dpt:imap2
    0     0 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp dpt:imap2
    0     0 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp dpt:5900
    0     0 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp dpt:5900
    0     0 ACCEPT     tcp  --  ppp0   any     anywhere             anywhere            tcp dpt:5901
    0     0 ACCEPT     udp  --  ppp0   any     anywhere             anywhere            udp dpt:5901
   44  2568 REJECT     tcp  --  ppp0   any     anywhere             anywhere            reject-with tcp-reset
    4   192 REJECT     udp  --  ppp0   any     anywhere             anywhere            reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT 296 packets, 60432 bytes)
 pkts bytes target     prot opt in     out     source               destination
   20  1008 TCPMSS     tcp  --  any    any     anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
    0     0 DROP       0    --  any    eth1    anywhere             anywhere
    0     0 DROP       0    --  eth1   any     anywhere             anywhere
  215 17069 ACCEPT     0    --  any    ppp0    192.0.0.0/8          anywhere            ctstate RELATED,ESTABLISHED ctproto 6

Chain OUTPUT (policy ACCEPT 4732 packets, 1187K bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       0    --  any    eth1    anywhere             anywhere
Auf eth1 droppe ich Alles, für den Fall einer versehentlichen Fehlconfig meinerseits und beim Provider (siehe http://www.heise.de/newsticker/meldung/93054/).

Die anderen Rules:

-forwarden auf ppp0
-machen ein paar Dienste von außen auf (WWW, Mail usw)
-rejecten dann alles was übrig bleibt auf TCP und UDP.

Ich frage mich nun, warum gerade im Output Jain innerhalb von 17 Stunden 74 Gbyte Daten angefallen sind.

Hat jemand eine Idee, wo ich mal schauen könnte, vielleicht sind auch meine Rules irgendwo falsch?

Wäre nett wenn ihr mir da auf die Sprünge helfen könntet.

Vielen Dank und viele Grüße

Andre
gierig
Posts: 297
Joined: 2002-10-15 16:59
Location: WHV
 

Re: iptables Chain Counter erhöht sich permanent

Post by gierig »

Mal abgesehen von Sinn oder nicht sinn deiner Aktion.
Wo siehst du 74gb ?

Code: Select all

Chain OUTPUT (policy ACCEPT 4732 packets, 1187K bytes)
Output Chain sagt hier 1,2 Mb (gerundet).
hotzi
Posts: 197
Joined: 2004-04-14 09:04
Location: Bayern, Sulzemoos
 

Re: iptables Chain Counter erhöht sich permanent

Post by hotzi »

Ich hatte vorher ein -Z gemacht zum Rücksetzen.

Jetzt:

Code: Select all

Chain OUTPUT (policy ACCEPT 12M packets, 5508M bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       0    --  any    eth1    anywhere             anywhere
gierig
Posts: 297
Joined: 2002-10-15 16:59
Location: WHV
 

Re: iptables Chain Counter erhöht sich permanent

Post by gierig »

Ah ok,

Was läuft den so für zeug auf der Maschine ? Klingt wie heimischer Testrechner.
Das dürfte dann komplett lokaler traffic sein (nach Localhost hin und wieder weg).

Gerne genommen X System das sich über IP nicht über Socket leuft.

Oder einfach der Verkehr der über deine Bridge von ath0 <-> eth1 (wobei ich nicht weiß ob das zeugs dann auch durch die Outbound chain gehen)
hotzi
Posts: 197
Joined: 2004-04-14 09:04
Location: Bayern, Sulzemoos
 

Re: iptables Chain Counter erhöht sich permanent

Post by hotzi »

Ich hab nun mal den Windows PX ausgemacht, schon war nix mehr. X rennt da nicht und ja das ist meine Heim-Router-Kiste.

Das komische: Die Paketstatistiken der Interfaces selber zeigen viel viel weniger Traffic an.