Home > apache httpd, fedora, how do I?, iptables, linux, useful, vnc > Add/view/delete an entry to iptables to enable Apache/VNCServer/FTP, etc.

Add/view/delete an entry to iptables to enable Apache/VNCServer/FTP, etc.

The default CentOS 5.6 firewall configuration does not allow Apache httpd traffic on port 80.  In order to open the port for utilization, a change must be made to the firewall configuration.

iptables -I INPUT -p tcp -m tcp ––dport 80 -j ACCEPT

To open a hole for VNCServer (running on display 20):

iptables -I INPUT -p tcp -m tcp ––dport 5920 -j ACCEPT

To open a hole for VNCServer (running on display 20) web base interface:

iptables -I INPUT -p tcp -m tcp ––dport 5820 -j ACCEPT

To display the openings you’ve created in your firewall:

iptables -L INPUT -n ––line-numbers

To remove a line entry from your iptables file (for example, entry #3):

iptables -D INPUT 3

Notes:

There are two dashes in front of parameters such as “––line-numbers” and “––dport.”

The iptables service must be saved, and restarted before changes take effect.

service iptables save

service iptables restart

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

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

%d bloggers like this: