How to open and close port in iptables ? | MyLiteratureTechLife.COM

How to open and close port in iptables ?

May 15th, 2010 1 Comment






















Few of very simple steps

1) Login using root

2) Enter following command to open port in iptables

iptables -A INPUT -p tcp --dport 25 -j ACCEPT

3) Enter following command to close port in iptables

iptables -A INPUT -p tcp --dport 25 -j DROP

4) Save iptables

service iptables save OR /etc/init.d/iptables save

5) Restart iptables

service iptables restart OR /etc/init.d/iptables restart

Related posts:

  1. Enableing passive mode in FTP server with CSF firewall
  2. How to enable Passive ftp in Pure FTPD
  3. Configuring range of ips in Linux,Centos,fedora core, red hat
  4. why sites suddenly stopped working in dedicated/virtual private servers
  5. How to move MySQL to second drive
  6. Installing RED5 server in CentOS 5.x
  7. ip_conntrack table is full and dropping packets
 

If You Like This Post, Share it With Your Friends & Peers

Digg
stumbleupon
Delicious
facebook
twitter
reddit
rss feed bookmar
 

One Comment to “How to open and close port in iptables ?”

  1. [...] If you are running iptables, then dont forget to open that port in iptables before you change it in sshd_config Tags: Centos, How to, linux, openssh, redhat, secure, ssh [...]

Leave your comment here:

*

Alexa Rank