ID #1082

How do I open a firewall port?

Your GeekISP VPS comes with a firewall enabled by default.  For most users, you'll want to open up a port to allow traffic into your server, to serve whatever content you bought the VPS for!  In general we recommend leaving your firewall locked down as much as possible, but there are obvious situations where you need to open a port - such as when you want to run a webserver on your VPS.  We use the stock CentOS firewall, iptables.

To open the HTTP port, you should use the 'iptables' commands.  You can look for examples in the /etc/sysconfig/iptables file.  You can even edit that file directly if you are comfortable with the format therein.

If not, you can use 'iptables --list' to see the current policy.  To open the HTTP port (port 80), run the following commands:

# iptables -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
# service iptables save 

Inbound connections will now be accepted on the HTTP port.

For more information on iptables, refer to the HOWTO: http://wiki.centos.org/HowTos/Network/IPTables

Tags: -

Related entries:

Last update: 2010-03-01 14:44
Author: Dave Steinberg
Revision: 1.0

Digg it! Print this record Send to a friend Show this as PDF file
Propose a translation for Propose a translation for
Please rate this entry:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry