CentOS7将默认firewall防火墙改为iptables
1、使用XShell连上CentOS7虚拟机。

2、前提是iptables服务已经安装好,关闭firewall防火墙,命令如下:
systemctl stop firewalld

3、查看防火墙是否关闭成功
systemctl status firewalld
有Active: inactive (dead)字样,关闭成功

4、编辑iptables防火墙,设置放开和关闭的端口等
vi /etc/sysconfig/iptables
例如开放mysql端口3306
最后保存退出:wq

5、重启iptables服务使配置生效
systemctl restart iptables

6、查看iptables运行状态
systemctl status iptables

7、设置iptables开机自启动
systemctl enable iptables

8、禁止firewall服务开机自启动
systemctl disable firewalld

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:158
阅读量:101
阅读量:177
阅读量:30
阅读量:70