CentOS firewall open port 80

CentOS firewall open port 80

I have searched a lot on the Internet and have not solved the problem. Here is the correct method:

#/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT

#/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT

Then save:

#/etc/rc.d/init.d/iptables save

If the above steps are still not working, it may be that the iptables file is using include calls.

Generally on the path /etc/sysconfig/iptables

Open this file and modify it manually.

Note that you need to restart the service: execute service iptabels save and service iptables restart

How to view ports:

[root@vcentos ~]# /etc/init.d/iptables status

Table: filter

Chain INPUT (policy ACCEPT)

num target prot opt source destination

1 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:80

2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80

3 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Chain FORWARD (policy ACCEPT)

num target prot opt source destination

1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327066996&siteId=291194637