Monday, March 23, 2015

BGP Attribute Tunning (Local-Preference) {BGP Part 5 CCNP)

                                    Local Preference


Ø  In this scenario i can say the routes coming from R1 have a higher local preference because that my primary path. So all the router in organization will naturally preferred the routes through R1.

Ø  If we see the BGP Path Selection list right after weight we have local-preference. Preferred the path which have highest local preference


   In our scenario we go in R1 and tune (change) the local-preference
Ø  Differences between Weight and Local-preference the weight something I said locally on a router and stay on router and The local-preference something you set in router and it advertise to it all the other router in same Autonomous System (AS)

Ø  Local: - means that when you advertise the networks. That goes to everything in your AS and stops there. This is not an attribute that will leave from your Autonomous System (AS) to other Autonomous System (AS). You can influence what path you’re Autonomous System (AS) will take but you cannot tell another Autonomous System (AS) what path they will take

   Two ways to configure the Local-preference
v 1st is simple way
Ø  Our goals is we want R1 will be a primary path for all routes and R4  to be Secondary path for all routes.in that case

    R1 Configuration:-
Ø  R1(config)#Router bgp 65001
{Set the local-preference that R1 will be primary path for every router}
Ø  R1(config-router)#Bgp default local-preference 500      {because higher is better by default is 100}
Ø  R1#clear ip bgp * soft               {Resetting the BGP Process to take affect}
Now we set local-preference in R1
What it does every single routes that R1 advertises within AS would be marked with local-preference 500
Now go R2 or R3
Ø  show ip bgp
Ø  use “traceroute command
  
    2nd Method
Objectives:-
Ø  Router4 that we want to be primary router for these networks 100.100.100.16/30
Ø  And Router1 we want to be Primary router for these networks 200.200.200.0/30

We accomplish those goals through Route-map
We only modify the one router configuration we don’t need to modify the configuration of both Routers

Configuration in R4:-
First Task is to make a ACL that matches the routes that we talking about
Ø  R4(config)#access-list 10 permit 100.100.100.16 0.0.0.3      { Match the Router4}
Ø  R4(config)#access-list 20 permit 200.200.200.0 0.0.0.3         {Match the Router1}
{Create a ACL that match both of Routers}

       Step2:- to create a Route-map that ties these things together
Ø  R4(config)#route-map LOCAL_PREF permit 10          { LOCAL_PREF:- Route-map Name}
Ø  R4(config-router-map)#match ip address 10               {Permit only ACL 10}
Ø  R4(config-router-map)#set local-preference 800       {higher is better and default is 100}

Ø  R4(config)#route-map LOCAL_PREF permit 20
Ø  R4(config-router-map)#  match ip address 20            {Permit only ACL 20}
Ø  R4(config-router-map)# set local-preference 80         {Router 4 will not primary router for these routes because we set to lower than default}

Ø  R4(config)#route-map LOCAL_PREF permit 30            {To Permit everything}
If we don’t have empty permit statements on the end the route-map acts like an ACL. And all other route are implicit denied because they filtered

Router 4 will not primary router for these routes so we set to lower than default

Ø  we didn’t the modify R1 because as 100.100.100.16/30, 200.200.200.0/30 received by R4 as soon it hits the route-map R4 filter through and R4 advertise these networks it will marked them and having the local-preference if local-preference is higher all other routers (Same in AS) use router 4 to get to other network and if local-preference is lower than default (100) than other router (Same in AS) do not use R4 instead of R1
    
        Step3:- Apply the Route-map into R4 BGP Process
Ø  R4(config)#router bgp 65001
Ø  R4(config-router)#neighbor 100.100.100.13 route-map LOCAL_PREF in            {Apply in incoming routes}
Ø  R4#clear ip bgp * soft                     {Resetting the BGP Process}

in:- As the routes being send the routes to R4 they come inbound to that neighbor relationship and it will faltered through route-map and set all the correct local-preferences


Now test using “traceroute command

0 comments:

Post a Comment