Opening ports using iptables

Screenshot Firestarter: Das Logfile von iptabl...

Image via Wikipedia

To open a port by using iptables you can use the iptables command, assume for example that you want to open port 25, you have to issue on the shell the following command

iptables -I INPUT -p tcp –dport 25 -j ACCEPT

where -I instruct to not add the rulle after the deny all rule avoiding to not be checked by iptables. At the end you have to save your changes with

service iptables save

and restart the service with

service iptables restart

However you can also edit directly the configuration file that in CentOS is in /etc/sysconfig/iptables

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

%d bloggers like this: