centos7查看端口是否开放

 时间:2026-02-14 05:06:36

1、centos7中的防火墙改成了firewall,使用iptables无作用,开放端口的方法如下:

firewall-cmd --zone=public --add-port=80/tcp --permanent

返回success为成功

centos7查看端口是否开放

2、命令含义: 

--zone #作用域 

--add-port=80/tcp #添加端口,格式为:端口/通讯协议 

--permanent #永久生效

centos7查看端口是否开放

3、重启防火墙:

systemctl restart firewalld.service 

centos7查看端口是否开放

4、关闭防火墙:

systemctl stop firewalld.service 

centos7查看端口是否开放

5、查看监听(Listen)的端口

netstat -lntp

centos7查看端口是否开放

6、查看监听(Listen)的端口

netstat -lntp

检查端口被哪个进程占用

netstat -lnp|grep 8080

centos7查看端口是否开放

  • Windows 2003 中没有“本地用户和组
  • Windows Server 2012 R2如何启用组策略对象链接
  • 用U盘安装Centos系统
  • Win Server 2012添加用户并设置远程登录
  • 解决linux系统CentOS下调整home和根分区大小
  • 热门搜索
    咀嚼是什么意思 运动会闭幕式流程 able是什么意思 七夕送什么礼物好 火鹤花的养殖方法 53年属什么 什么时候喝牛奶最好 文竹的养殖方法和注意事项 云淡风轻是什么意思 用户名是什么意思