Use local precedence to influence routing

Source: Internet
Author: User

Configuring different local priorities affects the routing of BGP, and when a router running BGP has multiple routes to the same destination address, the route with the highest local priority is preferred. By default, the value of the BGP local priority is 100. Local priority attributes are exchanged only between IBGP peers and are not advertised to other as.
Usually used for how the packet leaves this as, the larger the higher the priority.

On the topology map: R4 and R2 R3 establish IBGP neighbors, R1 with R2 and R3 to establish direct-attached EBGP neighbors.
R1 three loopback interfaces are advertised in BGP, R4 and R5 each advertise a loopback to BGP. AS200 internally uses RIP as the IGP protocol. R4 is used to establish a BGP neighbor with a loopback port of Loop0,ip address 4.4.4.4. To prevent routing advertisements from failing, the routes advertised on R4 are 44.44.44.0/24.

The purpose of this experiment is to influence the routing of BGP by changing the local priority, which is used to affect outbound traffic of the route, and the greater the priority. This property is propagated within the AS and is not passed to the EBGP neighbor.

Experiment one: R3 the routes advertised for R1, changing the local priority to 200, observing R3 and R4BGP tables, changes in local priorities, and changes in R4 routing. The experiment was completed on the R3.
In R4 view, go to R1 notice route, there are two paths optional, one for R2, one for R3, because R2 router-id smaller, so R4 preferred R2 outbound to 1.1.1.0/24 10.1.1.0/24 100.1.1.0/24.

R3:route-policy prefrence permit node 10  apply local-preference 3333 bgp 200 router-id 3.3.3.3 peer 123.1.1.1 route-policy prefrence import

Results observed:

    1. Observe the local priority of the route passed by R3 for R1
    2. observe the local priority of the route passed by R4 for R3, and whether it will affect R4 routing
    3. Watch R5 pass R4 for 1.1.1.0/24 10.1.1.0/24 100.1.1.0/24 These routes, their local priority is how many

    4. Observe the local priority of R3 for routes passed to R1

        [R3-bgp]display BGP  Routing-table BGP Local Router ID is 3.3.3.3 Status codes: *-Valid, >-Best, d-damped, h-history, I- Internal, s-suppressed, S-stale origin:i-IGP, E-EGP,? -Incompletetotal number of routes:5 Network nexthop MED locprf prefval path/ogn*> 1.1.        1.0/24 123.1.1.1 0 3333 0 100i*>i 5.5.5.0/24 4.4.4.4 0 100 0 300i*> 10.1.1.0/24 123.1.1.1 0 3333 0 100i*>i 44.44.44.0/24 4 .4.4.4 0 0 i*> 100.1.1.0/24 123.1.1.1 0 3333 0 100i< /code> 

The route-policy is applied on the

R3 in the import direction of the neighbor 123.1.1.1, changing the local priority of the route to 3333. Observe the BGP table for R3, which has changed the local priority of the three routes.

  1. To see if the local priority of the route passed by R4 for R3 will affect R4 routing

      <r4>display BGP routing-table BGP local router ID is           4.4.4.4 Status Codes: *-Valid, >-Best, D-damped, H-history, I-internal, s-suppressed, S-stale Origin:i-IGP, E-EGP,? -Incompletetotal number of routes:8 Network nexthop MED locprf prefval path/ogn*>i 1.1.        1.0/24 3.3.3.3 0 3333 0 100i* i 2.2.2.2 0 100 0 100i*> 5.5.5.0/24 45.1.1.5 0 0 300i*>i 10.1.1.0/24 3.3. 3.3 0 3333 0 100i* i 2.2.2.2 0 0 100i*>   ; 44.44.44.0/24 0.0.0.0 0 0 i*>i 100.1.1.0/24 3.3.3.3 0 333 3 0 100i* i 2.2.2.2 0 0 100i  

Observing the BGP table on the R4 and discovering the three routes advertised by R4 to R1, the optimal path is to select R3 as the next hop. Because the routes published by R3 have a higher local priority.

    1. Observe the R5 of the 1.1.1.0/24 10.1.1.0/24 100.1.1.0/24 for R4, and what is the local priority of the route.

      <R5>display bgp routing-table BGP Local router ID is 45.1.1.5 Status codes: * - valid, > - best, d - damped,           h - history,  i - internal, s - suppressed, S - Stale           Origin : i - IGP, e - EGP, ? - incompleteTotal Number of Routes: 5  Network            NextHop        MED        LocPrf    PrefVal Path/Ogn*>   1.1.1.0/24         45.1.1.4                              0      200 100i*>   5.5.5.0/24         0.0.0.0         0                     0      i*>   10.1.1.0/24        45.1.1.4                              0      200 100i*>   44.44.44.0/24      45.1.1.4        0                     0      200i*>   100.1.1.0/24       45.1.1.4                              0      200 100i

R5 See on the 1.1.1.0/24 10.1.1.0/24 100.1.1.0/24 These routes, its local priority is empty. Only routes that are passed in IBGP carry the local priority attribute.

Experiment two, in the R3 on the IBGP neighbor R4 to make direction route-policy, change 1.1.1.0/24 10.1.1.0/24 100.1.1.0/24 These routes of routing.

    1. First, remove the Route-policy-related configuration for peer 123.1.1.1 on the R3.
    2. Configure the Route-policy for the export direction of the R4
      Peer 4.4.4.4 Route-policy prefrence Export
    3. Refresh the route on R4 using the refresh BGP all import/export.
    4. conclusion, after R3 for the direction of R4, R4 for R3, the local priority is changed and the policy takes effect.

Experiment three, on the R4, for the IBGP neighbor R2 issued routes, into the direction of the routing policy, change the local priority of its published routes.
Conclusion: effective.

Summarize:

    1. On routers can use Route-policy for inbound direction of EBGP and IBGP neighbors to affect local and downstream routers receiving routes on-premises priority
    2. On the router you can use Route-policy for the outbound direction of the IBGP to affect the local priority of the routes received by this as downstream router.
    3. Local precedence is passed only between IBGP neighbors, and properties are not passed to EBGP neighbors. (1th is, the router for EBGP neighbors in their own into the route-policy, affecting themselves and downstream routers)
    4. The default value is 100, and the value is between 0 and 4.2 billion.

Use local precedence to influence routing

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.