IMQ & NAT
Hi all, my IMQ device works OK (thanks to Andy Furniss), but now I've problems to attach the traffic in the qdisc's. This is my conf:
-----------------------------------------------------------------------
INET
|
|eth0 300Kbps
ROUTER (NAT)
|eth1
|
LAN
-----------------------------------------------------------------------
MAX=300
tc qdisc add dev imq0 root handle 1: htb default 13
tc class add dev imq0 parent 1: classid 1:1 htb rate ${MAX}kbit ceil ${MAX}kbit
tc class add dev imq0 parent 1:1 classid 1:10 htb rate 60kbit ceil ${MAX}kbit prio 0
tc class add dev imq0 parent 1:1 classid 1:11 htb rate 40kbit ceil ${MAX}kbit prio 1
tc class add dev imq0 parent 1:1 classid 1:12 htb rate 100kbit ceil ${MAX}kbit prio 2
tc class add dev imq0 parent 1:1 classid 1:13 htb rate 100kbit ceil ${MAX}kbit prio 3
tc qdisc add dev imq0 parent 1:10 handle 100: sfq
tc qdisc add dev imq0 parent 1:11 handle 110: sfq
tc qdisc add dev imq0 parent 1:12 handle 120: sfq
tc qdisc add dev imq0 parent 1:13 handle 130: sfq
tc filter add dev imq0 parent 1:0 protocol ip prio 1 handle 1 fw classid 1:10
tc filter add dev imq0 parent 1:0 protocol ip prio 2 handle 2 fw classid 1:11
tc filter add dev imq0 parent 1:0 protocol ip prio 3 handle 3 fw classid 1:12
tc filter add dev imq0 parent 1:0 protocol ip prio 4 handle 4 fw classid 1:13
ip link set imq0 up
iptables -t mangle -A PREROUTING -i eth0 -j IMQ --todev 0
#ICMP
iptables -t mangle -A PREROUTING -i eth0 -p icmp -j MARK --set-mark 1 iptables -t mangle -A PREROUTING -i eth0 -p icmp -j RETURN
#SSH
iptables -t mangle -A PREROUTING -i eth0 -p tcp --dport 22 -j MARK --set-mark 1
iptables -t mangle -A PREROUTING -i eth0 -p tcp --dport 22 -j RETURN
...
------------------------------------------------------------------------
I've patched the IMQ with the imq-nat patch, but all traffic goes to 1:13
#tc -s class show dev imq0
-------------------------------------------------------------------------
...
class htb 1:13 parent 1:1 leaf 130: prio 3 rate 100Kbit ceil 300Kbit burst 1727b cburst 1983b
Sent 8981846847 bytes 18055130 pkts (dropped 99, overlimits 0)
lended: 8947767 borrowed: 9107363 giants: 0
tokens: 136320 ctokens: 52265
class htb 1:12 parent 1:1 leaf 120: prio 2 rate 100Kbit ceil 300Kbit burst 1727b cburst 1983b
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 138240 ctokens: 52905
---------------------------------------------------------------------------
What happens?? I'm newbie in IMQ... Sorry for the long text ;) Thanks for the help!!
Joan
Hi Joan, can you please tell us what version of kernel and iptables are you using?
Are you using Patrick McHardy's / www.linuximq.net original IMQ implementation?
tks
Andre Correa
www.linuximq.net
Quoted 78 lines · Joan Fuster Monzó
Hi all, my IMQ device works OK (thanks to Andy Furniss), but now I've problems to attach the traffic in the qdisc's. This is my conf:
-----------------------------------------------------------------------
INET
|
|eth0 300Kbps
ROUTER (NAT)
|eth1
|
LAN
-----------------------------------------------------------------------MAX00
tc qdisc add dev imq0 root handle 1: htb default 13
tc class add dev imq0 parent 1: classid 1:1 htb rate ${MAX}kbit ceil ${MAX}kbit
tc class add dev imq0 parent 1:1 classid 1:10 htb rate 60kbit ceil ${MAX}kbit prio 0
tc class add dev imq0 parent 1:1 classid 1:11 htb rate 40kbit ceil ${MAX}kbit prio 1
tc class add dev imq0 parent 1:1 classid 1:12 htb rate 100kbit ceil ${MAX}kbit prio 2
tc class add dev imq0 parent 1:1 classid 1:13 htb rate 100kbit ceil ${MAX}kbit prio 3tc qdisc add dev imq0 parent 1:10 handle 100: sfq
tc qdisc add dev imq0 parent 1:11 handle 110: sfq
tc qdisc add dev imq0 parent 1:12 handle 120: sfq
tc qdisc add dev imq0 parent 1:13 handle 130: sfqtc filter add dev imq0 parent 1:0 protocol ip prio 1 handle 1 fw classid 1:10
tc filter add dev imq0 parent 1:0 protocol ip prio 2 handle 2 fw classid 1:11
tc filter add dev imq0 parent 1:0 protocol ip prio 3 handle 3 fw classid 1:12
tc filter add dev imq0 parent 1:0 protocol ip prio 4 handle 4 fw classid 1:13ip link set imq0 up
iptables -t mangle -A PREROUTING -i eth0 -j IMQ --todev 0
#ICMP
iptables -t mangle -A PREROUTING -i eth0 -p icmp -j MARK --set-mark 1 iptables -t mangle -A PREROUTING -i eth0 -p icmp -j RETURN#SSH
iptables -t mangle -A PREROUTING -i eth0 -p tcp --dport 22 -j MARK --set-mark 1
iptables -t mangle -A PREROUTING -i eth0 -p tcp --dport 22 -j RETURN...
------------------------------------------------------------------------I've patched the IMQ with the imq-nat patch, but all traffic goes to 1:13
#tc -s class show dev imq0
-------------------------------------------------------------------------
...class htb 1:13 parent 1:1 leaf 130: prio 3 rate 100Kbit ceil 300Kbit burst 1727b cburst 1983b
Sent 8981846847 bytes 18055130 pkts (dropped 99, overlimits 0)
lended: 8947767 borrowed: 9107363 giants: 0
tokens: 136320 ctokens: 52265class htb 1:12 parent 1:1 leaf 120: prio 2 rate 100Kbit ceil 300Kbit burst 1727b cburst 1983b
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 138240 ctokens: 52905
Quoted 6 lines
---------------------------------------------------------------------------
What happens?? I'm newbie in IMQ... Sorry for the long text ;) Thanks for the help!!
Joan
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 2 lines · Andre Correa
Hi Joan, can you please tell us what version of kernel and iptables are you using?
Kernel -> 2.6.3
Iptables -> 1.2.9
Quoted 2 lines
Are you using Patrick McHardy's / www.linuximq.net original IMQ implementation?
I can't apply imq-nat patch to the imq patch, both from www.linuximq.net (only the imq). I used this patches
http://www.digriz.org.uk/jdg-qos-script/releases/binaries-latest.tar.bz2
Finally, this is my new IMQ conf:
iptables -t mangle -A POSTROUTING -o eth1 -j IMQ --todev 0
iptables -t mangle -A POSTROUTING -p tcp -o eth1 --sport 80 -j MARK --set-mark 3
iptables -t mangle -A POSTROUTING -p tcp -o eth1 --sport 80 -j RETURN
...
Thanks Roy!
Joan