Skip to contentSkip to conversation

ip route - TOS argument does not allways work

LARTC Kurt Wagner [email protected] 1 participant 1 message Feb 15, 2001

lore
Share & tools
lore

Kurt Wagner [email protected]

author
#0 lore raw

<PRE>hi all,

I need different routes for packets with different TOS values, and tried to do this with ip. I noticed that ip does not recognice all possible values for the TOS byte, even when I enter them in /etc/iproute/rt_dsfield.

to demonstrate this, I added prohibit rules for different marked packets and tried if the packets are dropped when I try to &quot;ping -Q tosvalue &lt;somehost&gt;&quot;:

#: ip route add prohibit default tos 0xb8
#: ip route add prohibit default tos 0x11
#: ip route add prohibit default tos 0x10
#: ip route add prohibit default tos 0x02

#: ip route
&lt;some rules snipped&gt;
prohibit default tos high
prohibit default tos test
prohibit default tos lowdelay
prohibit default tos mincost
default via 192.168.10.1 dev eth0

#: cat /etc/iproute2/rt_dsfield

0x11    test
0xb8    high
0xbc    video
0xe0    burstplan
0x10    lowdelay
0x08    throughput
0x04    reliability
0x02    mincost 

so ip look at rt_dsfield and enters the names not the values, that's fine. but...

#: ping -Q 0xb8 192.168.10.1
PING 192.168.10.1 (192.168.10.1) from 192.168.10.2 : 56(84) bytes of data. 64 bytes from 192.168.10.1: icmp_seq=0 ttl%4 time=1.919 msec

#: ping -Q 0x11 192.168.10.1
connect: Network is unreachable

#: ping -Q 0x10 192.168.10.1
connect: Network is unreachable

#: ping -Q 0x02 192.168.10.1
PING 192.168.10.1 (192.168.10.1) from 192.168.10.2 : 56(84) bytes of data. 64 bytes from 141.201.123.33: icmp_seq=0 ttl%4 time=1.793 msec

so it works for tos=0x10 and 0x11, but not for tos=0xb8 and 0x02.

it is possible to construct more examples which work, or don't work, but I see no pattern or reason for this strange behavior.

any hints? ideas?

Kurt

</PRE>