Skip to contentSkip to conversation

HTB with both fwmark and IP

LARTC Alexandru Coseru 1 participant 1 message Nov 5, 2003

lore
Share & tools
lore
#0 lore raw

Hello..

How can I specify a class for htb based on a fwmark and user ip ?

For instance:

I have some routes marked with fwmark and their are very-high speed connections... But only to some IP's.. For the rest , I must limit the user to 64Kbits

Now , how can I limit the high speed connections ?
I must create a rule and take in account both fwmark and IP ?
To be more specific , I want to limit the user 10.0.0.1 to 1Mbit for the routes marked with fwmark 1 (thoose are taken from zebra)

The rules I have now are:

tc filter add dev eth0 protocol ip parent 1:0 prio 2 u32 match ip dst 10.0.0.1/32 flowid 1:20 tc filter add dev eth0 parent 1:0 prio 99 protocol ip handle 2 fw flowid 1:99

I've tried this:

class: 1:20 - 64 kbit
class 1:99 - 100Mbit
class 1:30 - 1 Mbit

tc filter add dev eth0 protocol ip parent 1:0 prio 2 u32 match ip dst 10.0.0.1/32 protocol ip handle 2 fw flowid 1:30

but it failed..

Anybody can help me ?

Thanks
Alex