Tuesday, October 22, 2013

How to add port to firewall in centos

You can just open /etc/sysconfig/iptables file and add the below line and change the port which port you want to allow from firewall.

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

Save the file and restart iptables service.

Open the terminal and run the following command /etc/init.d/iptables restart.

No comments:

Post a Comment