注意下面命令适用于Centos相关系统
开放系统防火墙的HTTP和HTTPS访问(可以不用加 sudo)
sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --add-service=https --permanent
sudo firewall-cmd --permanent --zone=public --add-port=8899/tcp
sudo firewall-cmd --permanent --zone=public --add-port=8088/tcp
sudo firewall-cmd --reload
防火墙其他的命令
firewall-cmd --list-ports
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --zone=public --add-port=20000-29999/tcp --permanent
firewall-cmd --zone=public --remove-port=8080/tcp --permanent
firewall-cmd --zone= public --query-port=80/tcp
firewall-cmd --state
systemctl status firewalld
systemctl start firewalld
firewall-cmd --reload
systemctl restart firewalld
systemctl enable firewalld
systemctl is-enabled firewalld;
systemctl disable firewalld
systemctl stop firewalld
|