In CentOS 7 or RHEL 7 or Fedora, firewalls are managed by firewalld
Add
firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent is permanent and expires after reboot without this parameter)
firewall-cmd --zone=public --add-port=1000-2000/tcp --permanent
Reload
firewall-cmd --reload
View
firewall-cmd --zone=public --query-port=80/tcp
Delete
firewall-cmd --zone=public --remove-port=80/tcp --permanent
Turn on Firewall
systemctl start firewalld.service
Turn off firewall
systemctl stop firewalld.service
View running status
firewall-cmd --state //running
Similar Posts:
- [Solved] Centos7 Error: Failed to start iptables.service: Unit not found
- Firewall is not running an error is reported when the remote server opens the port
- [Solved] CentOS 7.9 Install MySQL Error: 2003- cannot connect to mysql server on ‘10.10.1.202’(10060 “Unknown error”)
- Vsftp: 425 FTP connection failed [How to Solve]
- [Solved] CentOS 7.2 Startup Error: Failed to start IPv4 firewall with iptables
- Rabbitmq error of connecting the native idea to Linux: java.net.connectexception: connection timed out: Connect [Solved]
- [Solved] Centos7 linux ailed to stop iptables.service: Unit iptables.service not loaded.
- Solve the problem of SSH Connection closed by foreign host
- Zabbix-server Error: No route to host [How to Solve]
- [Solved] 2003 – cant connect o mysql server on xxx (10060 unknown error)