[LARTC] Problem with htb and fwmark

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I am trying to prioritize udp traffic to satisfy our gamers.

The setup is

800 users

                 / 8 Mbit fiber (eth3)
LAN (eth0) - FW -
                 \ 6 Mbit FWA (eth2)

The 8 Mbit is the default gw and the FWA is currently only used by our proxy
server


I am using this script:

$IP rule add fwmark 1 table 100 pref 1000
$IP route add table 200 scope global nexthop via 213.173.228.1 dev eth2

tc filter del dev eth0 prio 3
tc qdisc del dev eth0 root handle 1:
tc qdisc add dev eth0 root handle 1: htb default 12
tc class add dev eth0 parent 1: classid 1:1 htb rate 10Mbit ceil 14Mbit
burst 2k

# Class for UDP, ICMP, ssh traffic
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 1MBit ceil 4Mbit
burst 2k prio 0

# Class for all traffic to our servers
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 3Mbit ceil 10Mbit
burst 2k prio 1

# All other traffic
tc class add dev eth0 parent 1:1 classid 1:12 htb rate 6Mbit ceil 8Mbit
burst 2k prio 3

tc qdisc add dev eth0 parent 1:10 handle 20: sfq perturb 10
tc qdisc add dev eth0 parent 1:11 handle 30: sfq perturb 10
tc qdisc add dev eth0 parent 1:12 handle 40: sfq perturb 10

tc filter add dev eth0 parent 1: protocol ip prio 3 handle 4 fw flowid 1:10
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 5 fw flowid 1:11

iptables -t mangle -A PREROUTING -i eth0 -p udp -j MARK --set-mark 4

iptables -t mangle -A PREROUTING -i eth0 -p tcp --dport 22 -j MARK
--set-mark 4
iptables -t mangle -A PREROUTING -s 10.10.10.3 -i eth0 -j MARK --set-mark 5
iptables -t mangle -A PREROUTING -s 10.10.10.4 -i eth0 -j MARK --set-mark 5
iptables -t mangle -A PREROUTING -s 10.10.10.5 -i eth0 -j MARK --set-mark 5
iptables -t mangle -A PREROUTING -s 10.10.10.12 -j MARK --set-mark 2

The problem is that the all the traffic is going to the default class no
matter what I do.

I can see that the counters in "iptables -t mangle -L -v -n" is counting up,
but the counters in "tc -s class ls dev eth0" is not.

I have also tried not to use fwmark but added the rules directly with "tc
filter...", but with same results...

Have I forgotten something, or what is the problem?


--
Morten Isaksen
misak@xxxxxx - http://www.aub.dk/~misak
 




[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux