This section provides examples of defining routing policies. For more examples, see Examples: Routing Policy Configuration.
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 peer 192.168.1.1 and BGP transit routes are accepted from BGP peers.
- [edit]
- policy-options {
-
- policy-statement bgp-to-isis {
-
- term term1 {
-
- from {
- neighbor 192.168.1.1;
- }
-
- then {
- accept;
- }
- }
- }
- }
Define a routing policy which matches routes from specific next hops that are being advertised to specific neighbors and which 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 {
- neighbor 192.168.1.1;
- }
-
- then {
- preference 10;
- }
- }
-
- term term2 {
-
- from {
- next-hop 10.0.0.3;
- }
-
- to {
- neighbor 192.168.1.1;
- }
-
- then {
- preference 15;
- }
- }
- }
- }
Configure import and export of access routes and access-internal routes in a routing policy. These routes are used by the DHCP application on a video services router to represent either the end users or the networks behind the attached video services router. (For more information about configuring DHCP relay on the router, see Configuring the Extended DHCP Relay Agent.)
An access route represents a network behind an attached video services router, and is set to a preference of 13. An access-internal route is a /32 route that represents a directly attached end user, and is set to a preference of 12.
- [edit]
- policy-options {
-
- policy-statement foo {
-
- term term1 {
-
- from protocol {
- access;
- access-internal;
- }
- then accept;
- }
- }
- }