歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> centos7開放端口

centos7開放端口

日期:2017/3/3 13:40:43   编辑:Linux技術

Centos 7使用firewalld代替了原來的iptables,firewalld的字符界面管理工具是 firewall-cmd。

下面是常用的幾個操作:

1。查看版本:

[root@192

~]# firewall-cmd --version

0.3.9

本機的版本號是0.3.9

2。查看指定端口是否開放:

[root@192 ~]# firewall-cmd --query-port=8080/tcp

no

"no"表示此端口並未開放。如果是"yes",則表示已經開放。

3。開放指定端口(--permanent表示永久,如果沒有這個參數,系統重啟後端口還是未開放的)。

[root@192 ~]# firewall-cmd --zone=public --add-port=8080/tcp --permanent

success

Copyright © Linux教程網 All Rights Reserved