Skip to contentSkip to conversation

Firewall did not block SSH - what is wrong

DISCUSSION [email protected] 2 participants 2 messages Feb 22, 2005 – Feb 23, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

thanks for your help. Actually, I wanted to block all incoming traffic that is not related to connections originating from my machine. Should a default policy of dropping all packets plus allowing only related packages be sufficient ?

e.g.

$IPTABLES -P INPUT DROP
$IPTABLES -A INPUT -i $EXTIF -s $UNIVERSE -d $EXTIP -m state --state \
ESTABLISHED,RELATED -j ACCEPT

Is there any way to test iptables-based firewalls without access to a second machine ?
I installed the rule you told me and commented out the one allowing connections to the firewall - but how can I test that it works for me (except testing if my email/mozilla works)?

Thanks, Hilmar

Quoted 10 lines

try something as:

#Substitute values for yours.
#your iptables binary
IPT=iptables
#your external iface
EFACE=ppp0

$IPT -A INPUT -i $EFACE -p tcp --dport ssh --syn -j DROP Say us if that is your need and if that works fine for you.

Signature · 2 lines
DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen!
AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl
#1 lore raw

Zitat von [email protected]:

Quoted 7 lines

Hi,

thanks for your help. Actually, I wanted to block all incoming traffic that is not related to connections originating from my machine. Should a default policy of dropping all packets plus allowing only related packages be sufficient ?

Quoted 5 lines

e.g.

$IPTABLES -P INPUT DROP
$IPTABLES -A INPUT -i $EXTIF -s $UNIVERSE -d $EXTIP -m state --state \
ESTABLISHED,RELATED -j ACCEPT

I would loose the "-d $EXTIP" because you want ESTABLISHED and RELATED also on your internal IFs. Traffic coming in your external IF for your internal net or your internal IF should be checked in the FORWARD chain.

Quoted 5 lines

Is there any way to test iptables-based firewalls without access to a second machine ?
I installed the rule you told me and commented out the one allowing connections to the firewall - but how can I test that it works for me (except testing if my email/mozilla works)?

There are many online scanners available at the net. For example
http://scan.sygatetech.com/. Choose one and see what's happening.

Regards

Andreas