By 2018-12-27
1、防火墙配置文件保存于:
iptables-save >/etc/iptables.rules
2、开机自启配置:
vi /etc/network/if-pre-up.d/iptables
#!/bin/bash
iptables-restore < /etc/iptables.rules
3、赋予执行权限:
chmod +x /etc/network/if-pre-up.d/iptables
iptables-save >/etc/iptables.rules
vi /etc/network/if-pre-up.d/iptables
#!/bin/bash
iptables-restore < /etc/iptables.rules
chmod +x /etc/network/if-pre-up.d/iptables
本文标题:iptables规则开机生效
本文链接:https://www.haomeiwen.com/subject/jwsllqtx.html
网友评论