Anpassung an iptables

Dawn

Registered User
Ich habe momentan folgende iptables-konfiguration:

Code:
Chain INPUT (policy DROP)
target     prot opt source               destination
fail2ban-ssh-ddos  tcp  --  anywhere             anywhere            tcp dpt:ssh
fail2ban-ssh  tcp  --  anywhere             anywhere            tcp dpt:ssh
fail2ban-apache-noscript  tcp  --  anywhere             anywhere            tcp dpt:www
ACCEPT     0    --  anywhere             anywhere            state RELATED,ESTABLISHED
REJECT     tcp  --  anywhere             anywhere            tcp flags:!FIN,SYN,RST,ACK/SYN reject-with tcp-reset
DROP       0    --  anywhere             anywhere            state INVALID
ACCEPT     0    --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:8443
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:8880
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:www
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:https
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ftp
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:submission
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:smtp
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssmtp
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:pop3
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:pop3s
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:imap2
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:imaps
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:poppassd
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:mysql
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:postgresql
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:9008
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:9080
ACCEPT     udp  --  anywhere             anywhere            udp dpt:netbios-ns
ACCEPT     udp  --  anywhere             anywhere            udp dpt:netbios-dgm
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:netbios-ssn
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:microsoft-ds
ACCEPT     udp  --  anywhere             anywhere            udp dpt:openvpn
ACCEPT     udp  --  anywhere             anywhere            udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:domain
ACCEPT     icmp --  anywhere             anywhere            icmp type 8 code 0
ACCEPT     0    --  anywhere             anywhere

Chain FORWARD (policy DROP)
target     prot opt source               destination
ACCEPT     0    --  anywhere             anywhere            state RELATED,ESTABLISHED
REJECT     tcp  --  anywhere             anywhere            tcp flags:!FIN,SYN,RST,ACK/SYN reject-with tcp-reset
DROP       0    --  anywhere             anywhere            state INVALID
ACCEPT     0    --  anywhere             anywhere
DROP       0    --  anywhere             anywhere

Chain OUTPUT (policy DROP)
target     prot opt source               destination
ACCEPT     0    --  anywhere             anywhere            state RELATED,ESTABLISHED
REJECT     tcp  --  anywhere             anywhere            tcp flags:!FIN,SYN,RST,ACK/SYN reject-with tcp-reset
DROP       0    --  anywhere             anywhere            state INVALID
ACCEPT     0    --  anywhere             anywhere
ACCEPT     0    --  anywhere             anywhere

Chain fail2ban-apache-noscript (1 references)
target     prot opt source               destination
RETURN     0    --  anywhere             anywhere

Chain fail2ban-ssh (1 references)
target     prot opt source               destination
RETURN     0    --  anywhere             anywhere

Chain fail2ban-ssh-ddos (1 references)
target     prot opt source               destination
RETURN     0    --  anywhere             anywhere

Damit ich Traffic-Monitoring mit Munin nutzen kann muss ich folgende Einträge vornehmen:
Code:
iptables -A INPUT -d 87.118.123.123
iptables -A OUTPUT -s 87.118.123.123

Leider greifen sie nicht, und ich bin mir nicht sicher welche bestehende Rule ich anpassen bzw. entfernen muss, damit diese Rules auch wirklich greifen. Eigene versuche (nicht blind drauf los, schon durchdacht) sind gründlich schief gegangen und ich habe mich 2x selber ausgesperrt. Ich wäre darum froh wenn mir jemand bei diesem Problem weiterhelfen könnte.

Gruss,
Dawn
 
Last edited by a moderator:
Hm, du könntest natürlich mal -I anstatt -A versuchen um die Regeln ganz am Anfang einzustellen um zu schauen ob es wirklich eine der existierenden Regeln ist die das Problem verursacht. Ich tippe allerdings eher auf den Umstand dass bei deinen Regeln keine dabei ist die Traffic für das Loopback Interface erlaubt.
 
Das kein Traffic für das Loopback-Device explizit erlaubt wird hat einen einfachen Grund: Es handelt sich dabei nur um mehr oder weniger Dummy-Rules welche von Munin zum messen des Traffics auf den jeweiligen IP's benötigt werden.

Dein Vorschlag mit dem -I hat aber prima funktioniert. Besten Dank für deine Hilfe :) So langsam blicke ich immer mehr durch mit iptables...
 
Ah, ok, war auch nur eine Vermutung da einige Dienste ohne Loopback nicht funktioneren, habe Munin persönlich noch nie benutzt.
-A oder -I kann einen sehr grossen Unterschied ausmachen, da immer die erste Regel in der Chain die gültige ist...was am Anfang verboten wurde kann nicht weiter unten wieder erlaubt werden und umgekehrt. ;)
 
Back
Top