cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1981
Views
0
Helpful
6
Replies

AS and Local Preference

netbeginner
Level 2
Level 2

Dear Experts,

 

We have a setup configured with Two different links connectiong on two different routers.

Below is the BGP configuration.

 

Router-1 Configuration :

 

 router bgp 200
 no synchronization
 bgp log-neighbor-changes
 network 10.20.20.0 mask 255.255.255.0
 network 10.20.30.0 mask 255.255.245.0
 redistribute connected
 redistribute static
 neighbor 10.100.100.2 timers 7 21
 neighbor 10.100.100.2 allowas-in 10
 neighbor 10.100.100.2 soft-reconfiguration inbound
 neighbor 10.100.100.2 route-map PL in
 neighbor 10.100.100.2 route-map PSA out


route-map PSA permit 20
 set as-path prepend 200 200 200
!
route-map PL permit 10
 set local-preference 50
!

 

 

Router-2 Configuration :


router bgp 200
 no synchronization
 bgp log-neighbor-changes
 network 10.20.20.0 mask 255.255.255.0
 network 10.20.30.0 mask 255.255.245.0
 redistribute connected
 redistribute static
neighbor 192.168.100.2 timers 7 21
neighbor 192.168.100.2 allowas-in 10
neighbor 192.168.100.2 soft-reconfiguration inbound


route-map PSA permit 20
 set as-path prepend 200 200 200
!
route-map PL permit 10
 set local-preference 50

 

Bit confusion , If i am correct.....there is no meaning of route-map on Router-2 as it is not recalled and working). 

 

For router-1 configuration. as i understand....all incoming & outgoing traffic is through this router only , Don't mind ...please help to understand command wise purpose.

 

Regards

**** 

 

 

6 Replies 6

Hi,

Router-2's route maps are not applied on the neighbor so the local preference is the default one (100). This means that any update that comes from 192.168.100.2 will have a local preference of 100.
Router-1 has a route map applied that sets the local preference to 50 for the updates received from 10.100.100.2.
So let's say you receive 172.16.30.0 on both Routers, the local preference will be 50 on Router-1 and 100 on Router-2. The preferred router to get to this network will be Router-2.

Local preference is an indication to the AS about which path has preference to exit the AS in order to reach a certain network. A path with a higher local preference is preferred more. The default value for local preference is 100.

HTH

chrihussey
VIP Alumni
VIP Alumni

You are correct with your understanding of the route maps in router 2. However, all traffic is going in and out of router 2.

Router 1 has the route maps applied. The inbound one that sets the local preference to 50 which is less than the default value of 100. So router 2 will be the preferred for the outbound. The outbound route-map prepends the AS to the Internet so it will be more AS hops to get to router 1 and router 2 will be preferred for the inbound.

Hope this helps

 

Hi,

We should analyze first why this configuration is being used or implemented for, but a simple sight it can be interpretated like:

 

neighbor 10.100.100.2 route-map PL in  <--- Everything received through this neighbor (R2) set the AS-Path prepend 200 200 200. It is commonly seen over eBGP to manipulate or create symmetric traffic not on iBGP. 


 neighbor 10.100.100.2 route-map PSA out   <--- All the traffic outgoing to this neighbor will be set with a local preference 50, in this way the neighbor will prefer this path or other one. 

 

If the neighbor is R2, it will receive routes from R1 with LP 50. 

 

I assume it is for practice because the first line actually could be ommitted because they are 2 routers only. 

 

Hope it is useful

:-)




>> Marcar como útil o contestado, si la respuesta resolvió la duda, esto ayuda a futuras consultas de otros miembros de la comunidad. <<

Hello Konstantinoschiotakis & shrihussey ,

 

Could you please explore your reply against each command.

 

Seems some understanding gaps here.

 

Just highlighting.....Both Router 1 and ROuter-2 are at our premises. and connecting with Router-A and Router-B respectuvely at remote end.

 

Rgds

***

 

Not exactly sure what you are asking. Can you be more specific?

 

Thank you

trfinkenstadt
Level 1
Level 1
If you are asking why do the two route-maps exist on router-2 even though they are not applied, it could be that your predecessor kept his acl's, route-maps, etc consistent on both routers so that it would be one less thing to deal with in the event of changes needed.

not sure if that made much sense.
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card