iptables保存设置及重启自动恢复

  iptables设定的规则,掉电重启会清空。若需要保存,最好是使用iptables-save/restore配合重定向,示例如下:

iptables-save > /etc/network/iptables-config   
iptables-restore < /etc/network/iptables-config

  配置文件位置可根据需要更改,可将iptables-restore加入到开机自动执行的配置文件中。

posted @ 2021-09-01 20:15  买菜不买挂  阅读(1789)  评论(0编辑  收藏  举报