BGP Routing Local Preference
BGP Routing Local Preference
Basic configuration
R1:
interface Loopback0
ip address 1.0.0.1 255.0.0.0
!
interface Loopback1
ip address 2.0.0.1 255.0.0.0
!
interface FastEthernet0/0
ip address 12.0.0.1 255.255.255.0
no shutdown
!
interface FastEthernet0/1
ip address 13.0.0.1 255.255.255.0
no shutdown
R2:
interface FastEthernet0/0
ip address 12.0.0.2 255.255.255.0
no shutdown
!
interface FastEthernet0/1
ip address 24.0.0.2 255.255.255.0
no shutdown
R3:
interface FastEthernet0/0
ip address 13.0.0.3 255.255.255.0
no shutdown
!
interface FastEthernet0/1
ip address 35.0.0.3 255.255.255.0
no shutdown
R5:
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface FastEthernet0/0
ip address 35.0.0.5 255.255.255.0
no shutdown
!
interface FastEthernet0/1
ip address 10.100.1.5 255.255.255.248
no shutdown
R6:
interface Loopback0
ip address 6.6.6.6 255.255.255.255
!
interface FastEthernet0/0
ip address 10.100.1.6 255.255.255.248
no shutdown
R7:
interface Loopback0
ip address 7.7.7.7 255.255.255.255
!
interface FastEthernet0/0
ip address 10.100.1.3 255.255.255.248
no shutdown
Configure EIGRP AS 4567 on R4, R5, R6 and R7 and advertise the subnet 10.100.1.0/29 and the
loopback 0 subnets:
R4:
router eigrp 4567
network 4.4.4.4 0.0.0.0
network 10.100.1.0 0.0.0.7
R5:
router eigrp 4567
network 5.5.5.5 0.0.0.0
network 10.100.1.0 0.0.0.7
R6:
router eigrp 4567
network 6.6.6.6 0.0.0.0
R7:
router eigrp 4567
network 7.7.7.7 0.0.0.0
network 10.100.1.0 0.0.0.7
Configure iBGP in AS 4567, use loopback 0 interface for peering and use peer group
configuration.
R4:
router bgp 4567
network 10.100.1.0 mask 255.255.255.248
neighbor INTERNAL peer-group
neighbor INTERNAL remote-as 4567
neighbor INTERNAL update-source Loopback0
neighbor INTERNAL next-hop-self
neighbor 5.5.5.5 peer-group INTERNAL
neighbor 6.6.6.6 peer-group INTERNAL
neighbor 7.7.7.7 peer-group INTERNAL
neighbor 24.0.0.2 remote-as 2
R5:
router bgp 4567
network 10.100.1.0 mask 255.255.255.248
neighbor INTERNAL peer-group
neighbor INTERNAL remote-as 4567
neighbor INTERNAL update-source Loopback0
neighbor INTERNAL next-hop-self
neighbor 4.4.4.4 peer-group INTERNAL
neighbor 6.6.6.6 peer-group INTERNAL
neighbor 7.7.7.7 peer-group INTERNAL
neighbor 35.0.0.3 remote-as 3
R6:
router bgp 4567
neighbor INTERNAL peer-group
neighbor INTERNAL remote-as 4567
neighbor INTERNAL update-source Loopback0
neighbor 4.4.4.4 peer-group INTERNAL
neighbor 5.5.5.5 peer-group INTERNAL
neighbor 7.7.7.7 peer-group INTERNAL
R7:
router bgp 4567
neighbor INTERNAL peer-group
neighbor INTERNAL remote-as 4567
neighbor INTERNAL update-source Loopback0
neighbor 4.4.4.4 peer-group INTERNAL
neighbor 5.5.5.5 peer-group INTERNAL
neighbor 6.6.6.6 peer-group INTERNAL
R2:
router bgp 2
neighbor 12.0.0.1 remote-as 1
neighbor 24.0.0.4 remote-as 4567
R3:
router bgp 3
neighbor 13.0.0.1 remote-as 1
neighbor 35.0.0.5 remote-as 4567
Verify the peer-group and see the current members, the members on this group are: R5 5.5.5.5,
R6 6.6.6.6 and R7 7.7.7.7:
Peer groups is used for less processing power, let's verify the adjacencies:
Ensure AS 4567 will use the link between R3-R5 towards network 2.0.0.0/8. Use LOCAL_PREF
only.
Before configuring the Local-Pref, let’s use a traceroute on R6 and R7 toward 2.0.0.1. We can
see that the packet goes through R4--R2:
R6#traceroute 2.0.0.1
Type escape sequence to abort.
Tracing the route to 2.0.0.1
1 10.100.1.4 72 msec 24 msec 24 msec
2 24.0.0.2 60 msec 28 msec 80 msec
3 12.0.0.1 96 msec * 96 msec
R6#
R6#show ip bgp
BGP ROUTING PROTOCOL PRACTICE LABS
REDOUANE MEDDANE
13
BGP table version is 5, local router ID is 6.6.6.6
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
To ensure that the traffic goes through R5--R3 you will tell to R5 to advertise into BGP AS 4567
the prefix 2.0.0.0/24 with a better (higher) local-preference than R4 as follow, by default the
Local-Pref is equal to 100:
R6#show ip bgp
BGP table version is 6, local router ID is 6.6.6.6
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
The traceroute shown that the packet goes through R5--R3 to reach 2.0.0.0/24:
R6#traceroute 2.0.0.1
Type escape sequence to abort.
Tracing the route to 2.0.0.1
1 10.100.1.5 76 msec 108 msec 20 msec
2 35.0.0.3 100 msec 120 msec 32 msec
3 13.0.0.1 148 msec * 176 msec
R6#
Ensure AS 4567 will use the link between R2-R4 towards network 1.0.0.0/8. Use LOCAL_PREF
only.
You will tell to R4 to advertise into BGP AS 4567 the prefix 1.0.0.0/24 with a better(higher)
local-preference than R4 as follow,by default the Local-Pref is equal to 100:
Now the best path to reach 1.0.0.0/24 is via R4 on both R6 and R7 because the better(higher)
Local-Preference 200 :
R6#show ip bgp
BGP table version is 10, local router ID is 6.6.6.6
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Note: you must enter the clear ip bgp * command to reset the bgp neighbors relationship when
configuring the Local-Preference to take effect.