Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Open a PORT NUMBER in IPTABLES  (Read 2097 times)

0 Members and 1 Guest are viewing this topic.

Haripriya H

  • Guest
Open a PORT NUMBER in IPTABLES
« on: May 09, 2014, 04:03:37 pm »
IPTABLES stores its configuration in the file : /etc/sysconfig/iptables. You can open a port number by editing this file but, you strictly need a root credentials to do this.

The steps are as follows:

1. Open the file /etc/sysconfig/iptables :

    #vi /etc/sysconfig/iptables

2. Append the following rule to it:

    -A INPUT -m state state NEW -m tcp -p tcp dport [port_number] -j ACCEPT

Make sure that you change the [port_number] to the actual number (say 8088 or 8090).

3. Restart iptables:

    #/etc/init.d/iptables restart

4. Verify that the port is opened:

    #netstat -tulpn | less

That's all  ;D