Networking Guide
Chapter 5, Configuring Internet Protocol (IP) routing

Assigning preferences in gated

Assigning preferences in gated

A default preference is assigned to each source from which gated receives routes. Preference values range from 0 to 255 with the lowest number indicating the most preferred route.

Table 5-2, ``Default preferences set by gated'', summarizes the default preference values for routes learned in various ways. The table lists the statements (some of these are clauses within statements) that set the preference and shows the types of routes to which each statement applies. The default preference for each type of route is listed. Comparison of default preferences in the table shows preference precedence between protocols. The narrower the scope of the statement, the higher precedence its preference value is given, but the smaller the set of routes it affects. 

Table 5-2 Default preferences set by gated

 -------------------------------------------------------------------
 Preference of                        Defined by statement   Default
 -------------------------------------------------------------------
 directly connected networks          interface              0
 OSPF routes                          ospf                   10
 internally generated default         gendefault             20
 redirects                            redirect               30
 static routes from config            static                 60
 RIP routes                           rip                    100
 point-to-point interface                                    110
 routes to interfaces that are down   interfaces             120
 OSPF AS external routes              ospf                   150
 BGP routes                           bgp                    170
 EGP                                  egp                    200
Following are some sample preference specifications.
   interfaces {
           interface 138.66.12.2 preference 10 ;
   } ;
   rip yes {
       preference 90 ;
   } ;
   import proto rip gateway 138.66.12.1 preference 75 ;
In these statements, the preference applicable to routes learned via RIP from gateway 138.66.12.1 is 75. The last preference applicable to routes learned via RIP from gateway 138.66.12.1 is defined in the accept statement. The preference applicable to other RIP routes is found in the rip statement. The preference set on the interface statement applies only to the route to that interface.