service iptables stop 关闭防火墙
service iptables start 重新开启防火墙
如果你的linux是CentOS7的话启用上面的命令会报出 Unit iptables.service failed to load: No such file or directory.异常
centos从7开始默认用的是firewalld,这个是基于iptables的,虽然有iptables的核心,但是iptables的服务是没安装的。所以你只要停止firewalld服务即可:
systemctl stop firewalld.service && systemctl disable firewalld.service
systemctl start firewalld.service && systemctl enable firewalld.service