Method one: 1. Open port command:/sbin/iptables -i INPUT -p TCP -- dport 8080 - j ` ACCEPT 2. Save:/etc/rc. D/init. D/iptables save 3. Restart services:/etc/init. D/iptables restart 4. Check to see if the port is open:/sbin/iptables - L - n
Method 2: 1. Edit/etc/sysconfig/iptables documents: vi/etc/sysconfig/iptables Add content and save: - A RH - Firewall - 1 - INPUT - m state - the state NEW -m TCP -p TCP -- dport 8080 - j ACCEPT 2. Restart services:/etc/init. D/iptables restart 3. Check to see if the port open:/sbin/iptables - L - n
Query port if there is a process to protect with the following command grep corresponding port, such as 80 for port Example: netstat nalp | grep, 80