Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This is default routing table database in any linux system;

[kumar]$ ip rule list
0:  from all lookup local 
32766:  from all lookup main 
32767:  from all lookup default

I understand about 'main' routing tables , any route added without mentioning table gets added to 'main' routing table. But whats the point in having 'default' routing table? Even if I add a 'default' route, it gets added to 'main' routing table, in which case I see no point in having 'default' table. Any idea why is this useful?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

ip rule outputs the routing policy. See below link:

http://www.policyrouting.org/iproute2.doc.html#ss9.6

if you want routing table, use ip route

hvn@hvnatvcc: ~ $ ip route
default via 192.168.25.1 dev eth0  proto static 
169.254.0.0/16 dev eth0  scope link  metric 1000 
192.168.25.0/24 dev eth0  proto kernel  scope link  src 192.168.25.66  metric 1 
192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1 

http://www.policyrouting.org/iproute2.doc.html#ss9.5

About default table:

  1. Priority 0: Selector = match anything

Action = lookup routing table local (ID 255).

The table local is the special routing table containing high priority control routes for local and broadcast addresses.

Rule 0 is special, it cannot be deleted or overridden.

  1. Priority 32766: Selector = match anything

Action = lookup routing table main (ID 254)

The table main is the normal routing table containing all non-policy routes. This rule may be deleted or overridden with other rules.

  1. Priority 32767: Selector = match anything

Action = lookup routing table default (ID 253).

The table default is empty and reserved for post-processing if previous default rules did not select the packet. This rule also may be deleted.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.