Skip to contentSkip to conversation

iptables with multiport problem

DISCUSSION bruce 3 participants 3 messages Oct 5, 2004

lore
Share & tools
lore

bruce

author
#0 lore raw

Hi all,

I am working with linux firewall implementation

I am using iptables version v1.2.11 and linux kernal 2.4.27. If multiport option comes with iptables(iptable rules are below), the services are not working. But individual services are working properly. The following filtering rules are not giving any syntatical errors. I checked logs no info..

#/sbin/iptables -A FORWARD -i eth0 -o eth1 -p tcp -s 192.168.2.0/24 -m multiport --dport 24,80 -m multiport --sport 0:65535 -d 192.168.1.2 -j ACCEPT

#/sbin/iptables -A FORWARD -i eth1 -o eth0 -p tcp -s 192.168.1.2 -m multiport --sport 24,80 -d 192.168.2.0/24 -m multiport --dport 0:65535 -j ACCEPT

Please give any solution or hints for the below problem. Thanks
Bruce

#1 lore raw
Quoted 15 lines · bruce

Hi all,

I am working with linux firewall implementation

I am using iptables version v1.2.11 and linux kernal 2.4.27. If multiport option comes with iptables(iptable rules are below), the services are not working. But individual services are working properly. The following filtering rules are not giving any syntatical errors. I checked logs no info..

#/sbin/iptables -A FORWARD -i eth0 -o eth1 -p tcp -s 192.168.2.0/24 -m multiport --dport 24,80 -m multiport --sport 0:65535 -d 192.168.1.2 -j ACCEPT

Quoted 7 lines

#/sbin/iptables -A FORWARD -i eth1 -o eth0 -p tcp -s 192.168.1.2 -m multiport --sport 24,80 -d 192.168.2.0/24 -m multiport --dport 0:65535 -j ACCEPT

Please give any solution or hints for the below problem. Thanks
Bruce

I kind of remember multiport support coming via a patch. Also your 0:65535 is not multiport.

Ted

#2 lore raw
In reply to bruce
Quoted 11 lines · bruce

Hi all,

I am working with linux firewall implementation

I am using iptables version v1.2.11 and linux kernal 2.4.27. If multiport option comes with iptables(iptable rules are below), the services are not working. But individual services are working properly. The following filtering rules are not giving any syntatical errors. I checked logs no info..

Quoted 3 lines

#/sbin/iptables -A FORWARD -i eth0 -o eth1 -p tcp -s 192.168.2.0/24 -m multiport --dport 24,80 -m multiport --sport 0:65535 -d 192.168.1.2 -j ACCEPT

try:

  iptables -A FORWARD -i eth0 -o eth1 -p tcp -s 192.168.2.0/24 \
    -m multiport --dports 24,80 -d 192.168.1.2  -j ACCEPT
                        ^
                        |- multiport uses "--dports" with an 's'

and what on earth is TCP port 24? should that be a 25, perhaps?

and "-m multiport" does not support byte ranges (21:23), use mport for that, or a regular port match.

-j

Signature · 1 line
Jason Opperisano <[email protected]>