在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 ##查看防火墙状态
防火墙 firewalld 关闭成功
接下来就是启用iptables了,安装iptables相关组件
[root@localhost ~]# yum install -y iptables-services iptables-devel.x86_64 iptables.x86_64
[root@localhost ~]# systemctl enable iptables ##启用iptables
[root@localhost ~]# systemctl start iptables ##启动iptables
[root@localhost ~]# systemctl status iptables ##查看iptables状态
测试:
iptables启用成功。
本文介绍如何在CentOS7系统中将默认的firewalld防火墙替换为传统的iptables。通过一系列命令操作,包括停止和禁用firewalld服务、安装iptables相关组件并启动iptables服务。
386

被折叠的 条评论
为什么被折叠?



