Examples: Defining Routing Policies
This section provides examples of defining routing policies. For more examples, see Examples: Routing Policy Configuration.
Defining a Routing Policy from BGP to IS-IS
Accept BGP routes advertised by the peer
192.168.1.1. If a route matches, it is accepted, and no further evaluation is performed on that route. If a route does not match, the accept or reject action specified by the default policy is taken. (For more information about the default routing policies, see Default Routing Policies and Actions.) If you apply this routing policy to imported BGP routes, only the routes learned from the peer192.168.1.1and BGP transit routes are accepted from BGP peers.[edit]policy-options {policy-statement bgp-to-isis {term term1 {from {neighbor192.168.1.1;}then {accept;}}}}Using Routing Policy to Set a Preference
Define a routing policy that matches routes from specific next hops that are being advertised to specific neighbors and that sets a preference. If a route does not match the first term, it is evaluated by the second term. If it still does not match, the next routing policy, if configured, is evaluated; then the accept or reject action specified by the default policy is taken. (For more information about the default routing policies, see Default Routing Policies and Actions.)
[edit]policy-options {policy-statement set-preference {term term1 {from {next-hop [10.0.0.1 10.0.0.2];}to {neighbor192.168.1.1;}then {preference 10;}}term term2 {from {next-hop 10.0.0.3;}to {neighbor192.168.1.1;}then {preference 15;}}}}