How to open ports in Red Hat using command line

go to

/etc/sysconfig

then

su root

vi iptables

add the following line putting the port number where it says to

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport port number -j ACCEPT

save and exit

restart the network service by typing

service iptables restart

All done

Advertisements

6 thoughts on “How to open ports in Red Hat using command line

      • i received the folowing msg:

        –telnet: connect to address : No route to host
        –telnet: Unable to connect to remote host: No route to host

        actually i’m trying to open 3690 port for svn
        when i’m doing svn co ip_to_server i have:

        –svn: Can’t connect to host ‘ip_to_server’: Connection timed out

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s