I have another little problem with my ipfw queue rules. I have 3 ethernet cards: 1 EXTERNAL and 2 INTERNAL(NAT). My goal is to shape download speed of my two INTERNAL lans.
The problem is: my queue rules works only when I use 'external ip' not 'internal class'.
Here are my configs.
/etc/ipnat.rules
/etc/ipfw.rules
When I download things from 192.168.1.0/24 using this config queue is free.
But when I change ipfw rules to (using EXTERNAL IP):
then it works
Problem is: that way I can't 'cut' 192.168.2.0/24 subnet. Why does queue work with external IP but not the internal class. Is this problem with NAT?
The problem is: my queue rules works only when I use 'external ip' not 'internal class'.
Here are my configs.
/etc/ipnat.rules
Code:
map em0 192.168.1.0/24 -> xx.xx.62.20 portmap tcp/udp auto
map em0 192.168.1.0/24 -> xx.xx.62.20 icmp
map em0 192.168.2.0/24 -> xx.xx.62.20 portmap tcp/udp auto
map em0 192.168.2.0/24 -> xx.xx.62.20 icmp
/etc/ipfw.rules
Code:
${fwcmd} pipe 1 config bw 24Mbit/s
${fwcmd} pipe 2 config bw 15Mbit/s
${fwcmd} pipe 3 config bw 24Mbit/s
${fwcmd} pipe 4 config bw 15Mbit/s
${fwcmd} add 10 pipe 3 all from ${lan1} to any in via em1
${fwcmd} add 20 pipe 1 all from any to ${lan1} out via em1
${fwcmd} add 30 pipe 4 all from ${lan2} to any in via rl0
${fwcmd} add 40 pipe 2 all from any to ${lan2} out via rl0
# DOWNLOAD SPEED
${fwcmd} add 21 queue 21 all from any to 192.168.1.0/24
${fwcmd} queue config 21 weight 5 pipe 1 buckets 255 mask dst-ip 0xffffffff
${fwcmd} add 41 queue 41 all from any to 192.168.1.0/24
${fwcmd} queue config 41 weight 5 pipe 2 buckets 255 mask dst-ip 0xffffffff
...
When I download things from 192.168.1.0/24 using this config queue is free.
Code:
q00021 50 sl. 1 flows (255 buckets) sched 9 weight 5 lmax 0 pri 0 droptail
mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
But when I change ipfw rules to (using EXTERNAL IP):
Code:
${fwcmd} add 21 queue 21 all from any to xx.xx.62.20/32
${fwcmd} queue config 21 weight 5 pipe 1 buckets 255 mask dst-ip 0xffffffff
${fwcmd} add 41 queue 41 all from any to xx.xx.62.20/32
${fwcmd} queue config 41 weight 5 pipe 2 buckets 255 mask dst-ip 0xffffffff
Code:
q00065 50 sl. 1 flows (255 buckets) sched 9 weight 5 lmax 0 pri 0 droptail
mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
81 ip 0.0.0.0/0 xx.xx.62.20/0 14 1176 0 0 0
Problem is: that way I can't 'cut' 192.168.2.0/24 subnet. Why does queue work with external IP but not the internal class. Is this problem with NAT?