How does CentOS 7 open ports quickly
- 2020-05-17 07:27:16
- OfStack
When CentOS was upgraded to 7, it was found that iptables could not be used to control the port of Linuxs. After google, it was found that Centos 7 used firewalld instead of the original iptables. The following documents how to open the Linux port using firewalld:
Open port
firewall-cmd --zone=public --add-port=80/tcp --permanent
Command meaning:
-- the zone # scope
-- add-port =80/tcp # add port, format: port/communication protocol
--permanent # is permanently in effect and will not be rebooted without this parameter
Restart the firewall
firewall-cmd --reload