(转)关闭CentOS7的firewalld启用iptables操作

在CentOS7中,防火墙iptables被firewalld取代。但为了使用习惯,还是喜欢把防火墙改回iptables。

[root@localhost ~]# systemctl stop firewalld ##停止防火墙 firewalld
[root@localhost ~]# systemctl disable firewalld ##禁用防火墙 firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@localhost ~]# systemctl status firewalld ##查看防火墙状态

20170705090710352.png

防火墙 firewalld 关闭成功

接下来就是启用iptables了,安装iptables相关组件

[root@localhost ~]# yum install -y iptables-services iptables-devel.x86_64 iptables.x86_64

[root@localhost ~]# systemctl enable iptables ##启用iptables

20170705091645694.png

[root@localhost ~]# systemctl start iptables ##启动iptables
[root@localhost ~]# systemctl status iptables ##查看iptables状态

20170705092000489.png

测试:

20170705092111527.png

iptables启用成功。

转自:https://blog.csdn.net/lqy461929569/article/details/74370396

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容