--sport
1. Is there a way to specify a range of source ports when setting a rule. My ftp server uses ports 5000-5020 for passive but I don't want to have to write a rule for each port. (For a network firewall). The ftp server is behind the firewall.
iptables -A FORWARD -p tcp --sport 5000 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
What you need is the mport-match:
iptables -A FORWARD -p tcp -m mport --sport 5000:5020 -m state ...
Sven
Quoted 13 lines · Patrick Ahler
1. Is there a way to specify a range of source ports when setting a rule. My ftp server uses ports 5000-5020 for passive but I don't want to have to write a rule for each port. (For a network firewall). The ftp server is behind the firewall.
iptables -A FORWARD -p tcp --sport 5000 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
Quoted 3 lines · Sven Schuster
What you need is the mport-match:
iptables -A FORWARD -p tcp -m mport --sport 5000:5020 -m state ...
mport is not needed for a simple range
Signature · 3 lines
/Martin Never argue with an idiot. They drag you down to their level, then beat you with experience.
Yes I actually recognized it _after_ posting :-)
My mistake...
Quoted 2 lines · Martin Josefsson
mport is not needed for a simple range
Quoted 1 line
1. Is there a way to specify a range of source ports when setting a rule. My
# iptables -p tcp --help
So use:
--sport 5000:5020
Regards,
Maciej