CentOS firewall operation instances (start, stop, open, and close ports)
Note: basic firewall operation commands:
Query the Firewall Status:
[Root @ localhost ~] # Service iptables status <press enter>
Stop Firewall:
[Root @ localhost ~] # Service iptables stop <press enter>
Start Firewall:
[Root @ localhost ~] # Service iptables start <press enter>
Restart Firewall:
[Root @ localhost ~] # Service iptables restart <press enter>
Permanently disable the Firewall:
[Root @ localhost ~] # Chkconfig iptables off <press enter>
Enable after permanent shutdown:
[Root @ localhost ~] # Chkconfig iptables on <press enter>
1. view the Firewall Status
[Root @ localhost ~] # Service iptables status <press enter>
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 <press enter>
5. view the firewall status again
[Root @ localhost ~] # Service iptables status <press enter>
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.