解决方法
以下是一些示例规则.将它们保存到/etc/iptables.rules
# Generated by iptables-save v1.3.6 on Wed Oct 24 17:07:29 2007 *filter :INPUT ACCEPT [89458:132056082] :FORWARD DROP [0:0] :OUTPUT ACCEPT [263904:15667452] -A INPUT -i lo -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT -A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7 -A INPUT -j DROP COMMIT # Completed on Wed Oct 24 17:07:29 2007
在/ etc / network / interfaces的末尾添加此行
pre-up iptables-restore < /etc/iptables.rules