You are here: Home Linux Basics iptables
Search
Advanced Search…
E-Mail

Webmail: webmail.wyden.com

E-Mail Preferences: postfix.wyden.com/users

E-Mail Administration: postfix.wyden.com

Statistics
Total: 463
Total Pages: 284
Total Folders: 87
Total Files: 18
Total Links: 26
Last modification: 03.02.2012 16:00
 

iptables

by Wyden Silvan last modified 26.11.2009 16:04

#list rules
iptables -L

#accept all estimated traffic
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

#accept input from ssh and port 80
iptables -A INPUT -p tcp --dport ssh -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT

#deny all other traffic
iptables -A INPUT -j DROP

#save firewall rules to a file
iptables-save >/etc/iptables.rules


#load files after each reboot with crontab
vi /etc/crontab
@reboot root iptables-restore /etc/iptables.rules