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
















One Comment to “How to open and close port in iptables ?”
[...] 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 [...]