Link to home
Create AccountLog in
Avatar of ipconfig610
ipconfig610Flag for United States of America

asked on

iptables - need ftp and passive ftp to work

I am new to iptables.  How would i open up port 21 for ftp and setup a passive ftp port range from 30000-50000?
Avatar of arnold
arnold
Flag of United States of America image

iptables -t filter -I INPUT 6 -p tcp -m tcp --dport 21 -j ACCEPT
iptables -t filter -I INPUT 7 -p tcp -m tcp --dports 30000:50000 -j ACCEPT

iptables -t filter -L INPUT --line-numbers
Avatar of ipconfig610

ASKER

I received some errors with the above.

[root@]# iptables -t filter -I INPUT 6 -p tcp -m tcp --dport 21 -j ACCEPT
iptables: Index of insertion too big

[root@]# iptables -t filter -I INPUT 7 -p tcp -m tcp --dports 30000:50000 -j ACCEPT
iptables v1.3.5: Unknown arg `--dports'
Try `iptables -h' or 'iptables --help' for more information.
if you are using GUi then use

#system-config-securitylevel

#setup => firewall configuration

then you also can modify

/etc/sysconfig/iptables
Running Centos 5.8 without GUI, just CLI
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
....and now the light bulb goes off.  Thank you :-)