iptables设定的规则,掉电重启会清空。若需要保存,最好是使用iptables-save/restore配合重定向,示例如下:
iptables-save > /etc/network/iptables-config iptables-restore < /etc/network/iptables-config
配置文件位置可根据需要更改,可将iptables-restore加入到开机自动执行的配置文件中。