Jump to content

How To Open a Port on CentOS 5


Recommended Posts

  • Administrators

I needed to open a certain outgoing port on my CentOS 5 server. Now that I know how I figured I would share with you.


It's really pretty simple. First you will need to login to your server via SSH. I use Putty. After that su - to root.


Open Outgoing Port:

iptables -A RH-Firewall-1-OUTPUT -p tcp -m state --state NEW -m tcp --dport 65 -j ACCEPT


Open Incoming Port:

iptables -A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 65 -j ACCEPT


Once done you need to save your iptables by running this command:

service iptables save


Now restart the service:

/etc/init.d/iptables restart


That's it your done!

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...