I have been attempting to setup a few basic iptables rules on my server (which is running ubuntu 11.04 server x64). The problem I am running into is after setting up the rules and testing them to make sure they work, if/when i reboot the server those rules are then reset.
Here are the steps I have taken.
To keep things simple, to start I closed port 22 on the adapter 'eth0'
# /sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 22 -j DROP # iptables-save
After doing this I queried the list of rules:
# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination DROP tcp -- anywhere anywhere tcp dpt:ssh Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
After testing SSH access over my local network I could not connect so I know it works. After restarting the same 'iptables -L' command returns an empty list and I can still connect via ssh over my local network. Im not sure what I am doing wrong here. Your insight is much appreciated
EDIT:had the syntax wrong for one of the commands
Edited by The Pugilist, 29 June 2011 - 10:38 AM.