Friday, July 8, 2011

IPTABLES configuration for VSFTPD server

1) Add following lines in /etc/modprobe.conf

alias ip_conntrack ip_conntract_ftp ip_nat_ftp

or run
# modprobe ip_conntrack_ftp 
#modprobe ip_nat_ftp 

2) Allow incoming traffic on the default Ftp port (21) 
# iptables -A INPUT -p tcp --dport 21 -j ACCEPT

save this configuration
# iptables-save >  /etc/sysconfig/iptables
#service iptables save

or manually edit /etc/sysconfig/iptables and add the below mentioned line
-A INPUT -p tcp -m tcp --dport  21 -j ACCEPT 

Restart iptables
#service iptables start

Now the NFS ports will be enabled in iptables.