jump to navigation

เอา iptables มาพ่วงกับ interface พฤศจิกายน 26, 2008

Posted by linix in Linux, ubuntu.
1 comment so far

*THIS DID NOT WORK FOR US WHEN WE UPGRADED TO 8.04, Caused an error on startup and took forever to boot. We ended up using firestarter instead of iptables on 8.04*

Write your IPTABLES rules

Save the current rules to a file
sudo sh -c “iptables-save > /etc/iptables.rules”
Add the restore command to the interface device that you are trying to lockdown eg eth0 (add this at the end of the eth0 section)
pre-up iptables-restore < /etc/iptables.rules
Add the post down command to the end of the network lines
post-down iptables-restore < /etc/iptables.rules

Reboot and type sudo iptables -list to see if the rules have taken

Credit: http://techteam.wordpress.com/2008/01/07/save-iptables-so-that-it-initiates-on-start-uprebootifup-etc/

Advertisements