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 ~]# 

posted @ 2021-10-19 13:46  super_胡  阅读(260)  评论(0编辑  收藏  举报