#/Sbin/iptables-I INPUT-p tcp -- dport 80-j ACCEPT
#/Sbin/iptables-I INPUT-p tcp -- dport 22-j ACCEPT
#/Sbin/iptables-I INPUT-p tcp -- dport 8080-j ACCEPT
Then save:
#/Etc/rc. d/init. d/iptables save
View opened ports:
#/Etc/init. d/iptables status
-------------------------------------------------------
Note:
# Disable the Firewall
/Etc/init. d/iptables stop
Service iptables stop # stop the service
# View Firewall Information
/Etc/init. d/iptables status
# Port: 8080
/Sbin/iptables-I INPUT-p tcp -- dport 8080-j ACCEPT
# Restart the firewall to make the changes take effect: (or directly restart the system)
/Etc/init. d/iptables restart
# Save the changes
/Etc/rc. d/init. d/iptables save
In addition, add a line directly in/etc/sysconfig/iptables:
-A RH-Firewall-1-INPUT-m state-state NEW-m tcp-p tcp-dport 8080-j ACCEPT
# Permanently disable the Firewall
Chkconfig-level 35 iptables off # This method is originated from the network and is not tested. Therefore, you are not allowed to use this method for security reasons.