1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 查看linux防火墙状态的命令 Linux 查看防火墙状态及开启关闭命令

查看linux防火墙状态的命令 Linux 查看防火墙状态及开启关闭命令

时间:2019-01-13 03:00:27

相关推荐

查看linux防火墙状态的命令 Linux 查看防火墙状态及开启关闭命令

Centos 6.x版本 iptables

查看防火墙状态:

[root@centos6 ~]# service iptables status

iptables: Firewall is not running. 说明防火墙没有开启。

开启防火墙:

[root@centos6 ~]# service iptables start

关闭防火墙:

[root@centos6 ~]# service iptables stop

Centos 7版本 firewall

背景:在CentOS上面安装了mysql、svn、tomcat等软件,发现访问不了,用telnet命令查看端口,发现都不通。

telnet IP 端口

操作系统环境:CentOS Linux release 7.0.1406(Core) 64位

CentOS7 默认使用firewalld防火墙.

开放特定端口:firewall-cmd --zone=public --add-port=8080/tcp --permanent

查看防火墙状态:firewall-cmd --state

重启防火墙:systemctl restart firewalld

查看端口列表:firewall-cmd --zone=public --list-ports

CentOS7 默认使用firewalld防火墙,如果想换回iptables防火墙,可关闭firewalld并安装iptables。

具体参考连接:/p/4b0afe75990e

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。