https://my.oschina.net/chuangpoyao/blog/72655
man iptables
man ip6tables
http://www.frozentux.net/documents/iptables-tutorial/
抓 iptables 東東
http://www.netfilter.org/projects/iptables/downloads.html
安裝
http://my.oschina.net/chuangpoyao/blog/57347
第一個防衛條件在個人電腦上
iptables -A INPUT -i eth0 -p tcp --syn -j DROP
所有 tcp 要求進來 eth0 丟掉
-----------------------------------------------------------------------
debian 開機自動化(對不起,不知其他版可用否):
存檔
iptables-save > /etc/iptables_rules.conf
建自動化檔,下指令(這好像是 20120813 現在正規 iptables 官方建意,但這不能滿足我開機啟動 pppoe,pppoe 好像跟 /etc/network/if-up.d 無關)
echo \#\!\/bin\/sh > /etc/network/if-up.d/iptables
echo "iptables-restore < /etc/iptables_rules.conf" >> /etc/network/if-up.d/iptables
echo "ip6tables-restore < /etc/ip6tables_rules.conf" >> /etc/network/if-up.d/iptables
chmod +x /etc/network/if-up.d/iptables
--------------------------------------
或(現在 20120813 改用這,因 pppoe)
echo \#\!\/bin\/sh > /etc/init.d/firewall
echo "iptables-restore < /etc/iptables_rules.conf" >> /etc/init.d/firewall
echo "ip6tables-restore < /etc/ip6tables_rules.conf" >> /etc/init.d/firewall
chmod 755 /etc/init.d/firewall
update-rc.d firewall start 20 2 3 4 5 . stop 20 0 1 6 .