External paths are preferred over internal paths..
Let's see an example..
Basic BGP configuration..
R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.12.2 remote-as 2
R1(config-router)#network 10.10.10.0 mask 255.255.255.0
R1(config-router)#network 20.20.20.0 mask 255.255.255.0
R2(config)#router bgp 2
R2(config-router)#bgp router-id 2.2.2.2
R2(config-router)#neighbor 192.168.12.1 remote-as 1
R2(config-router)#neighbor 3.3.3.3 remote-as 2
R2(config-router)#neighbor 3.3.3.3 update-source Loopback0
R3(config)#router bgp 2
R3(config-router)#bgp router-id 3.3.3.3
R3(config-router)#neighbor 2.2.2.2 remote-as 2
R3(config-router)#neighbor 2.2.2.2 update-source Loopback0
R3(config-router)#network 10.10.10.0 mask 255.255.255.0
R3(config-router)#network 20.20.20.0 mask 255.255.255.0
Basic routing (static) on R2 & R3 to reach their loopbacks..
R2(config)#ip route 3.3.3.0 255.255.255.0 192.168.23.3
R3(config)#ip route 2.2.2.0 255.255.255.0 192.168.23.2
Let's see the R2's BGP table..
According to the default behavior, It has now chosen the internal path as the best route.
Note that this is not because of the Local Preference which overrules the Path Type attribute, Even though it is not showing in the show ip bgp output, Local Preference is 100 for both the routes.
To understand this hidden Local Preference of eBGP routes, please go here.
Let's change the local preference to 0 to all the routes coming from R3, which then will be equal for both the eBGP and iBGP neighbors to R2..
R3(config)#router bgp 2
R3(config-router)#bgp default local-preference 0
Now you will see that the external path is preferred over the internal path because all other attributes are equal..
No comments:
Post a Comment