The firewall in centos is a very powerful function, but it has been upgraded in the firewall in centos. Let's take a look at the usage of the firewall in centos in detail.
Basic firewall operationsCommand
Query the Firewall Status: [root @ localhost ~] # Service iptables status <回车>
Stop firewall: [root @ localhost ~] # Service iptables stop <回车>
Start firewall: [root @ localhost ~] # Service iptables start <回车>
Restart firewall: [root @ localhost ~] # Service iptables restart <回车>
Permanently disable the firewall: [root @ localhost ~] # Chkconfig iptables off <回车>
Enable after permanent shutdown: [root @ localhost ~] # Chkconfig iptables on <回车>
1. view the Firewall Status
2. Edit the/etc/sysconfig/iptables file. Port 8080 and port 9990 must be enabled in our instance.
Open/etc/sysconfig/iptables in the editor
3. Add port 8080 and port 9990 as needed
4. Save the/etc/sysconfig/iptables file and run the command on the terminal.
[Root @ localhost ~] # Service iptables restart <回车>
5. view the firewall status again
[Root @ localhost ~] # Service iptables status <回车>
6. At this time, ports 8080 and 9990 of the server can provide external services.
7. The open mode of other ports is similar to the open mode.