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

查看linux防火墙状态的命令,Linux 查看防火墙状态及开启关闭命令Centos6 x 版本 iptables 查看防火墙状态 root centos6 serviceiptab Firewallisno 说明防火墙没有开启 开启防火墙 root centos6 serviceiptab 关闭防火墙 root centos6 serviceiptab

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

6bf8ac50e35d387e8a0e6e6e0c5382e0.png

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

具体参考连接:https://www.jianshu.com/p/4b0afe75990e

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/218102.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月18日 上午8:02
下一篇 2026年3月18日 上午8:02


相关推荐

发表回复

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

关注全栈程序员社区公众号