centos7查看端口是否开放

 时间:2026-04-23 00:32:19

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和根分区大小
  • 热门搜索
    年糕怎么炒好吃 电脑睡眠怎么唤醒 大便干燥出血怎么办 孩子不爱学习怎么办 军旗怎么下 公函怎么写 律师证怎么考 辞职申请书怎么写 怎么装无线路由器 halloween怎么读