Linux教程

linux开放防火墙端口

本文主要是介绍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 ~]# 

这篇关于linux开放防火墙端口的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!