赞
踩
1、查看firewall防火墙运行状态
[root@localhost sbin]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since 六 2023-07-22 18:03:39 CST; 38min ago
Docs: man:firewalld(1)
Main PID: 714 (firewalld)
CGroup: /system.slice/firewalld.service
└─714 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nop...
7月 22 18:03:39 localhost.localdomain systemd[1]: Starting firewalld - ...
7月 22 18:03:39 localhost.localdomain systemd[1]: Started firewalld - d...
7月 22 18:03:39 localhost.localdomain firewalld[714]: WARNING: AllowZon...
Hint: Some lines were ellipsized, use -l to show in full.
2、用策略放行80端口通信
[root@localhost sbin]# firewall-cmd --zone=public --add-port=80/tcp --permanent
success
3、重启firewall防火墙
[root@localhost sbin]# firewall-cmd --reload
success
4、查看端口是否被添加
[root@localhost sbin]# firewall-cmd --list-ports
80/tcp
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。