2
What is the significance of the prio option in ip rule add/del command? Does a higher priority for a rule give it preference over other rules in the table?
I saw this piece of code online, without any comments to it. I'm curious to know what it does:
ip rule del prio 32766 from "" dev "" fwmark 0 table main
ip rule del prio 32767 from "" dev "" fwmark 0 table default
ip rule add prio 4294967293UL from "" dev "" fwmark 0 table 1
ip rule add prio 4294967294UL from "" dev "" fwmark 0 table main
ip rule add prio 4294967295UL from "" dev "" fwmark 0 table default
5"The first rule which matches the packet is used." this is not completely correct. The rules are in fact checked in the order specified by priority, but a rule which has its conditions satisfied may in fact not provide a result, and more rules are checked. The prime example of this is when a rule specifies a "lookup" (or "table"), but there is no route in that routing table matching the destination. – Ambroz Bizjak – 2012-04-27T21:05:53.807