Linux防火墙放行端口

CentOS 7采用新的firewalld,CentOS 6及以前版本采用iptables,不过firewalld底层仍然调用的是iptables

1、查看已经开放的端口

firewall-cmd --list-ports

 

2、放行端口

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

--zone 作用域

--permanent 永久生效

 

3、重启防火墙

systemctl reload firewalld

 

4、查询指定端口是否开启成功

firewall-cmd --query-port=5601/tcp

 

5、停止防火墙

systemctl stop firewalld

或:

systemctl stop firewalld.service

 

6、启动防火墙

systemctl start firewalld

或:

systemctl start firewalld.service

 

7、查看防火墙是否在运行

systemctl status firewalld

 

相关文章

linux常用进程通信方式包括管道(pipe)、有名管道(FIFO)、...
Linux性能观测工具按类别可分为系统级别和进程级别,系统级别...
本文详细介绍了curl命令基础和高级用法,包括跳过https的证书...
本文包含作者工作中常用到的一些命令,用于诊断网络、磁盘占满...
linux的平均负载表示运行态和就绪态及不可中断状态(正在io)的...
CPU上下文频繁切换会导致系统性能下降,切换分为进程切换、线...