<< March 2008 | Home | May 2008 >>

Using iptables

sudo iptables -L
sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT
sudo iptables -A INPUT -s ###.###.###.### -p tcp --dport www -j ACCEPT
sudo iptables -P INPUT DROP
sudo iptables -L -v
sudo sh -c "iptables-save > /etc/iptables.rules"
sudo nano /etc/network/interfaces
    Append the following to appropriate interface(s):
         pre-up iptables-restore < /etc/iptables.rules
         post-down iptables-restore < /etc/iptables.rules

Reference:
    http://iptables-tutorial.frozentux.net/iptables-tutorial.html
    http://www.frozentux.net/iptables-tutorial/iptables-tutorial.html [EDIT: 20110514]
    https://help.ubuntu.com/community/IptablesHowTo

Tags :
Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Export this post as PDF document  Export this post to PDF document