Press "Enter" to skip to content

CentOS 7关闭firewalld启用iptables 开放端口

关闭firewalld

[root@centos ~]# systemctl stop firewalld
[root@centos ~]# systemctl disable firewalld
[root@centos ~]# systemctl status firewalld

2.开启iptables

首先安装iptables:

[root@centos ~]#yum install -y iptables-services
[root@centos ~]# systemctl enable iptables
ln -s '/usr/lib/systemd/system/iptables.service' '/etc/systemd/system/basic.target.wants/iptables.service'

[root@centos ~]# systemctl start iptables
[root@centos ~]# systemctl status iptables
此时iptables的命令都可以使用了:

[root@centos ~]# iptables -L
Chain INPUT (policy ACCEPT)

target prot opt source destination

Chain FORWARD (policy ACCEPT)

target prot opt source destination

Chain OUTPUT (policy ACCEPT)

target prot opt source destination

One Comment

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注