linux开放防火墙端口

查看防火墙开放的端口 firewall-cmd --list-ports
FirewallD is not running
查看防火墙状态 systemctl status firewalld
开启防火墙 systemctl start firewalld
关闭防火墙防火墙 systemctl stop firewalld
开放800端口 firewall-cmd --zone=public --add-port=800/tcp --permanent
重启防火墙 firewall-cmd --reload
查看防火墙开放的端口 firewall-cmd --list-ports



[root@hualoon-aliyun-linux ~]# firewall-cmd --list-ports
FirewallD is not running
[root@hualoon-aliyun-linux ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)
[root@hualoon-aliyun-linux ~]# systemctl start firewalld
[root@hualoon-aliyun-linux ~]# firewall-cmd --list-ports

[root@hualoon-aliyun-linux ~]# firewall-cmd --zone=public --add-port=800/tcp --permanent
success
[root@hualoon-aliyun-linux ~]# firewall-cmd --reload
success
[root@hualoon-aliyun-linux ~]# firewall-cmd --list-ports
800/tcp
[root@hualoon-aliyun-linux ~]# 

上一篇:CentOS7下Firewall防火墙配置用法详解


下一篇:linux安装tomcat且配置环境变量