Latest News: Linux shell script to change you ssh port

How to allow 80 3306 22 in your CENTOS 6.0 iptables

Tutorial willing 822View(s) 0Comment

iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

Save it:
service iptables save
service iptables restart

Check the rule in the iptables:

iptables -L

——————————————————-

addition:

#close the iptables

/etc/init.d/iptables stop

service iptables stop # stop iptables service
#Check the rule in the iptables

iptables -L
#allow:8080

/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT

#restart the iptables to take affect:(or you may reboot)

/etc/init.d/iptables restart

#save the change

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

Please give credit to the original author when you use it elsewhere: VPS List Agent » How to allow 80 3306 22 in your CENTOS 6.0 iptables

Login to post a comment!