Skip to contentSkip to conversation

tc filter and ip match

LARTC Glaucius Djalma Pereira Junior 3 participants 3 messages Jun 8, 2005

lore
Share & tools
lore
#0 lore raw

hi all

people, I'm using tc and htb to create classes and do some QoS , but i would like to know if i can do it:

after to create the classes I need to create the rules using tc filter :

tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst 10.0.0.0/8 flowid 1:10

ok, this rule works with all packets going to 10.0.0.0/8, but how can i write a rule using "!" or "not" , like :

tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst NOT 10.0.0.0/8 flowid 1:10

ps.: I would not like to use iptables and mangle table.

did you understand ?

best regards

Signature · 6 lines
Glaucius Djalma Pereira Junior
[email protected]
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
#1 lore raw

I am not sure if you can have a NOT in filter. But you can have 2 classes one of which is default with restriction and make the filter pass through the other one.

Quoted 25 lines · Glaucius Djalma Pereira Junior

hi all

people, I'm using tc and htb to create classes and do some QoS , but i would like to know if i can do it:

after to create the classes I need to create the rules using tc filter :

tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst 10.0.0.0/8 flowid 1:10

ok, this rule works with all packets going to 10.0.0.0/8, but how can i write a rule using "!" or "not" , like :

tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst NOT 10.0.0.0/8 flowid 1:10

ps.: I would not like to use iptables and mangle table.

did you understand ?

best regards

Quoted 8 lines

--
Glaucius Djalma Pereira Junior
[email protected]
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#2 lore raw
In reply to Glaucius Djalma Pereira Junior
Quoted 13 lines · Glaucius Djalma Pereira Junior

hi all

people, I'm using tc and htb to create classes and do some QoS , but i would like to know if i can do it:

after to create the classes I need to create the rules using tc filter :

tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst 10.0.0.0/8 flowid 1:10

ok, this rule works with all packets going to 10.0.0.0/8, but how can i write a rule using "!" or "not" , like :

Quoted 6 lines

tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst NOT 10.0.0.0/8 flowid 1:10

ps.: I would not like to use iptables and mangle table.

did you understand ?

If you want 10.0.0.0/8 to be unshaped by htb and the rest go to 1:10, don't set a default class and filter like -

tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst 10.0.0.0/8 flowid 1:99

tc filter add dev eth0 protocol ip parent 1:0 prio 2 u32 match u32 0 0 flowid 1:10

where 1:99 doesn't exist as an htb class.

Andy.
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc