修改配置文件: /etc/sysconfig/network-scripts/ifcfg-ens33 文件 ONBOOT=no 改为yes
然后重启 service network restart
查看已经开放的端口:
firewall-cmd --list-ports
1
开启端口firewall-cmd --zone=public --add-port=80/tcp --permanent
重启防火墙firewall-cmd --reload #重启firewall
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)