Iptables - Fail2ban

babadan

New Member
Hallo,

bin langsam am verzweifeln!

Habe einen Vserver mit Squeeze und ISPCP.

Ich denke soweit alle Sicherheitsmassnamen ergriffen.

Bekomme aber im auth.log folgende Meldung.

Kann mir jemand sagen was ich machen muss um diesen Fehler zu beseitigen.

2011-04-11 20:22:24,621 fail2ban.actions: WARNING [pam-generic] Unban 65.51.67.195
2011-04-11 20:22:24,624 fail2ban.actions.action: ERROR iptables -n -L INPUT | grep -q fail2ban-pam-generic returned 100
2011-04-11 20:22:24,625 fail2ban.actions.action: ERROR Invariant check failed. Trying to restore a sane environment
2011-04-11 20:22:24,631 fail2ban.actions.action: ERROR iptables -D INPUT -p tcp -j fail2ban-pam-generic
iptables -F fail2ban-pam-generic
iptables -X fail2ban-pam-generic returned 300
2011-04-11 20:22:24,636 fail2ban.actions.action: ERROR iptables -N fail2ban-pam-generic
iptables -A fail2ban-pam-generic -j RETURN
iptables -I INPUT -p tcp -j fail2ban-pam-generic returned 300
2011-04-11 20:22:24,641 fail2ban.actions.action: ERROR iptables -n -L INPUT | grep -q fail2ban-pam-generic returned 100
2011-04-11 20:22:24,642 fail2ban.actions.action: CRITICAL Unable to restore environment
2011-04-11 20:22:27,684 fail2ban.actions: WARNING [ssh] Unban 65.51.67.195
2011-04-11 20:22:27,688 fail2ban.actions.action: ERROR iptables -n -L INPUT | grep -q fail2ban-ssh returned 100
2011-04-11 20:22:27,689 fail2ban.actions.action: ERROR Invariant check failed. Trying to restore a sane environment
2011-04-11 20:22:27,695 fail2ban.actions.action: ERROR iptables -D INPUT -p tcp -m multiport --dports ssh -j fail2ban-ssh
iptables -F fail2ban-ssh
iptables -X fail2ban-ssh returned 300
2011-04-11 20:22:27,700 fail2ban.actions.action: ERROR iptables -N fail2ban-ssh
iptables -A fail2ban-ssh -j RETURN
iptables -I INPUT -p tcp -m multiport --dports ssh -j fail2ban-ssh returned 300
2011-04-11 20:22:27,705 fail2ban.actions.action: ERROR iptables -n -L INPUT | grep -q fail2ban-ssh returned 100
2011-04-11 20:22:27,705 fail2ban.actions.action: CRITICAL Unable to restore environment


Im voraus vielen Dank
 
Die Fehlermeldungen bedeuten, das Fail2Ban die IPTables-Regeln nicht löschen/erstellen/wiederherstellen konnte.

Hast du mal ein stop und nach kurzem warten ein starten von Fail2Ban ausprobiert?
Was liestet "iptables -L -n"?

Was passiert, wenn du die Regeln manuell ausführst?
# iptables -D INPUT -p tcp -m multiport --dports ssh -j fail2ban-ssh
# iptables -F fail2ban-ssh
# iptables -N fail2ban-ssh
# iptables -A fail2ban-ssh -j RETURN
# iptables -n -L INPUT | grep -q fail2ban-ssh

Läuft Fail2Ban evtl. auf einem V-Server, wo du keinen Zugriff auf die Firewall hast?
 
Hallo, erst mal danke das du dich meiner angenommen hast.

Also ein Stop und ein Start nach ca. 2 Minuten hat nicht gebracht!

Auf ptables -L -n reagiert er mit:

iptables v1.4.8: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Was das auch bedeuten mag.

iptables -D INPUT -p tcp -m multiport --dports ssh -j fail2ban-ssh

Could not determine whether revision 1 is supported, assuming it is.
iptables v1.4.8: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

und bei den anderen:

iptables v1.4.8: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Ich hatte bis dato noch nicht viel mit Iptables zu tun, gelobe aber mich zu bessern und zu lernen. Habe mir dazu auch bereits einschlägige Lektüre bestellt.

Es wäre nur sehr nett wenn du mir sagen könntest was ich hier machem muss.

Siegrid
 
Nochmal hallo,

also folgende Meldung habe ich erhalten:

# modprobe ip_tables
FATAL: Could not load /lib/modules/2.6.36.1-vs2.3.0.36.38.build1-cti/modules.dep: No such file or directory

# lsmod ip_tables
Usage: lsmod

MfG Siegrid
 
Last edited by a moderator:
Hallo!
Sorry, das zweite sollte eigentlich ein lsmod |grep ip_tables werden. Nützt dir aber nichts, da dein vServer Anbieter das Modul nicht geladen hat.

mfG
Thorsten
 
Falls du deinen Server bei Netcup "stehen" hast, solltest du in deren Forum nach der Möglichkeit mit der hauseigenen Firewall + iptables schauen.

Andernfalls solltest du dich mit deinem vServer-Anbieter in Verbindung setzen.
 
Back
Top