I have a router that I am customizing settings for. I want to only allow SSH from the internal network and drop everything else.
This is what I have so far. I tried it and I had to reset my router in order to connect to it again, so I think I am missing something:
iptables -F INPUT
iptables -t filter -A INPUT --match state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t filter -A INPUT --destination 127.0.0.1 -i lo -j ACCEPT
iptables -t filter -A INPUT -s 192.168.11.0/24 --protocol tcp --dport $SSH_PORT -j ACCEPT
iptables -t filter -P INPUT DROP
iptables -F FORWARD
iptables -t filter -A FORWARD -s 192.168.11.0/24 --protocol tcp -j ACCEPT
iptables -t filter -P FORWARD DROP
iptables -F OUTPUT
Is that a good starting point?
iptables-save? – pepoluan Mar 10 '11 at 12:27