centos7开机加载iptables

centos7开机加载iptables

   张吉吉     2019年9月29日 00:23     1552    

centos 7中没有iptables这个服务,也就是service iptables start 没有办法使用。

iptables也没有办法直接导入到规则中。

所以我现在使用iptables-save > my.iptables将规则保存到my.iptables这个文件中。

iptables-restore my.iptables来将规则在导入到iptables的表中。

但是之前一直没有办法在开机的时候将规则导入进去

在/etc/rc.local中添加

iptables-restore ~/my.iptables

但是首先提示说,找不到这个文件,my.iptables

放到/etc/rc.d/my.iptables也是不能找到这个文件。

于是我将my.iptables这个文件更改为newiptable。

后来提示,没有权限,但是文件确实都是777

1.png

 

于是我又将文件放到了/etc/rc.d/newiptable

于是就可以了。


文章评论

0

其他文章