当前位置:   article > 正文

Centos 7 通过Firewall防火墙策略放行80端口外网访问_centos防火墙开放端口

centos防火墙开放端口

Centos 7 通过Firewall防火墙 策略 放行80端口外网访问

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...

722 18:03:39 localhost.localdomain systemd[1]: Starting firewalld - ...
722 18:03:39 localhost.localdomain systemd[1]: Started firewalld - d...
722 18:03:39 localhost.localdomain firewalld[714]: WARNING: AllowZon...
Hint: Some lines were ellipsized, use -l to show in full.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

2、用策略放行80端口通信

[root@localhost sbin]# firewall-cmd --zone=public --add-port=80/tcp --permanent
success
  • 1
  • 2

3、重启firewall防火墙

[root@localhost sbin]# firewall-cmd --reload
success
  • 1
  • 2

4、查看端口是否被添加

[root@localhost sbin]# firewall-cmd --list-ports
80/tcp
  • 1
  • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/148045?site
推荐阅读
相关标签
  

闽ICP备14008679号