How to allow 80 3306 22 in your CENTOS 6.0 iptables
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
阅读剩余
版权声明:
作者:John
链接:https://vps.la/2016/06/07/how-to-allow-80-3306-22-in-your-centos-6-0-iptables/
文章版权归作者所有,未经允许请勿转载。
THE END