Skip to contentSkip to conversation

Route policy preference value

LARTC Ming-Ching Tiew 3 participants 6 messages Aug 2, 2004 – Aug 3, 2004

lore
Share & tools
lore
#0 lore raw

Assuming if I have rules matching the same packet, the one chosen is the lower preference value or the high ?

For example

# ip rule list

....
100 from 192.168.1.0/24 lookup main
200 from all fwmark 5 lookup first
.....

Packet is matching both rules, the one with priority/preference 100 or 200 is selected ?

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#1 lore raw
Quoted 5 lines · Ming-Ching Tiew

Assuming if I have rules matching the same packet, the one chosen is the lower preference value or the high ?

Quoted 9 lines

For example

# ip rule list

....
100 from 192.168.1.0/24 lookup main
200 from all fwmark 5 lookup first
.....

for what I have understood is the lower, beware as pointed out to me from Martin Brown that failing a matching *route* from rule 100 it will look for the route in next matching *rule*. In my case I didn't defined default route, but packets passed since arrived to get the one defined in main table.

sandro
*:-)

Signature · 6 lines
Sandro Dentella  *:-)
e-mail: [email protected] 
http://www.tksql.org                    TkSQL Home page - My GPL work
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#2 lore raw
In reply to Ming-Ching Tiew

Ming-Ching,

: Assuming if I have rules matching the same packet, the one chosen : is the lower preference value or the high ?
:
: For example
:
: # ip rule list
:
: ....
: 100 from 192.168.1.0/24 lookup main
: 200 from all fwmark 5 lookup first
: .....
:
: Packet is matching both rules, the one with priority/preference : 100 or 200 is selected ?

The first matched rule in the routing policy database (RPDB) is the one chosen. Rules are traversed from 0 to 32767. If a route match is found for a given packet in a specified table, that route is used. If no match is found in a given table, the (sequential) traversal of the RPDB continues.

See also this description:

http://linux-ip.net/html/routing-selection.html#routing-selection-adv

Good luck,

-Martin

--
Martin A. Brown --- SecurePipe, Inc. --- [email protected]
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#4 lore raw
In reply to Ming-Ching Tiew

Ming-Ching,

: > http://linux-ip.net/html/routing-selection.html#routing-selection-adv
:
: Ghee a simple illustration will explain it much better than : such a train of words.

Well...in that case...how do you feel about my pseudo-code locomotive?

You may well be right--I sometimes have a tendency to be verbose. I'll see what I can do to imagine an accurate and intuitive diagram.

Thanks for the feedback,

-Martin

Signature · 5 lines
Martin A. Brown --- SecurePipe, Inc. --- [email protected]

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#5 lore raw
In reply to Ming-Ching Tiew
Quoted 6 lines

You may well be right--I sometimes have a tendency to be verbose. I'll see what I can do to imagine an accurate and intuitive diagram.

Thanks for the feedback,

It's OK, i think I have figured out the answer. The system will pick smaller no, meaning smaller no, higher preference.

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/