Description
This article describes that BGP Route reflectors have the special ability to advertise routes learned from an iBGP peer to other iBGP peers.
The route reflector will reduce the number of iBGP peering’s but it does not change the next hop.
Solution
In the following diagram, eBGP peering is configured over directly connected interfaces.
The iBGP peerings are configured over Loopback addresses.
An IGP is running to advertise Loopback addresses.
Each router advertises its Loopback address (/32) into BGP.
R4 is configured as a Route Reflector.
The BGP configurations are as follows:
R1:
config router bgp
set as 65002
set router-id 1.1.1.1
config neighbor
edit "10.1.0.2"
set remote-as 65001
next
end
config network
edit 1
set prefix 1.1.1.1 255.255.255.255
next
end
R3:
config router bgp
set as 65001
set router-id 3.3.3.3
config neighbor
edit "10.1.0.1"
set remote-as 65002
next
edit "4.4.4.4"
set remote-as 65001
set update-source "Lo3"
next
end
config network
edit 1
set prefix 3.3.3.3 255.255.255.255
next
end
R4:
config router bgp
set as 65001
set router-id 4.4.4.4
config neighbor
edit "3.3.3.3"
set remote-as 65001
set update-source "Lo4"
set route-reflector-client enable
next
edit "2.2.2.2"
set next-hop-self-rr enable
set remote-as 65001
set update-source "Lo4"
set route-reflector-client enable
next
end
config network
edit 1
set prefix 4.4.4.4 255.255.255.255
next
end
R2:
config router bgp
set as 65001
set router-id 2.2.2.2
config neighbor
edit "4.4.4.4"
set remote-as 65001
set update-source "Lo2"
next
end
config network
edit 1
set prefix 2.2.2.2 255.255.255.255
next
end
The expectation is that:
- R4 sees R3 (3.3.3.3) as the next hop for the eBGP route(1.1.1.1).
- R2 sees R4 (4.4.4.4) as the next hop for iBGP and eBGP routes.
- R3 sees R4 (4.4.4.4) as the next hop for iBGP routes and R1 (10.1.3.1) for eBGP route.
By design, when R3 advertises the eBGP route received from R1, it will not change the next hop. This can be changed using 'set next-hop-self enable' on iBGP peering with R4.
BGP table on R3:
config router bgp
config neighbor
edit "4.4.4.4"
set next-hop-self enable
next
end
end
Verification on R4:
R4 # get router info bgp network
VRF 0 BGP table version is 2, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight RouteTag Path
*>i1.1.1.1/32 3.3.3.3 0 100 0 0 65002 i <-/1> <-----
*>i2.2.2.2/32 2.2.2.2 0 100 0 0 i <-/1>
*>i3.3.3.3/32 3.3.3.3 0 100 0 0 i <-/1>
*> 4.4.4.4/32 0.0.0.0 100 32768 0 i <-/1>
Total number of prefixes 4
The external route (1.1.1.1/32) is received with R3 as the next hop.
The external and internal routes are not received with R4 as the next hop, which is expected as iBGP does not change the next hop.
Then, 'set next-hop-self enable' would have no effect on the next hop of iBGP routes reflected by R4.
It modifies only the next hop of local and eBGP learned routes.
Note: next-hop-self normally does not work on reflected routes (iBGP learned routes), and only works on eBGP learned routes.
If for some reason it is needed to change the next hop with R4.
BGP table on R2:
R2# get router info bgp network
VRF 0 BGP table version is 4, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight RouteTag Path
*>i1.1.1.1/32 3.3.3.3 0 100 0 0 65002 i <-/1> <-----
*> 2.2.2.2/32 0.0.0.0 100 32768 0 i <-/1>
*>i3.3.3.3/32 3.3.3.3 0 100 0 0 i <-/1> <-----
*>i4.4.4.4/32 4.4.4.4 0 100 0 0 i <-/1>
Total number of prefixes
The next-hop does not change by the Route-Reflector (R4) server for the network 1.1.1.1/32 and 3.3.3.3/32 when it is advertised to R2, the next hop should be 4.4.4.4 when it is advertised to R2.
BGP table on R3:
R3 # get router info bgp network
BGP table version is 11, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight RouteTag Path
*> 1.1.1.1/32 10.1.0.1 0 0 0 65002 i
*>i2.2.2.2/32 2.2.2.2 0 100 0 0 i
*> 3.3.3.3/32 0.0.0.0 100 32768 0 i
*>i4.4.4.4/32 4.4.4.4 0 100 0 0 i
Total number of prefixes 4
The next-hop does not change by the Route-Reflector (R4) server for the network 2.2.2.2/32 when it is advertised to R3, the next hop should be 4.4.4.4 when it is advertised to R3.
Solution:
- The solution is to apply an inbound route map on R2 and R3 to change the next hop of iBGP routes.
- The new feature 'set next-hop-self-rr enable' is introduced in 6.4.2 higher version.
New Solution.
R4:
config router bgp
set as 65001
set router-id 4.4.4.4
config neighbor
edit "3.3.3.3"
set next-hop-self-rr enable <--
set remote-as 65001
set update-source "Lo4"
set route-reflector-client enable
next
edit "2.2.2.2"
set next-hop-self-rr enable <--
set remote-as 65001
set update-source "Lo4"
set route-reflector-client enable
next
end
config network
edit 1
set prefix 4.4.4.4 255.255.255.255
next
end
Then clear BGP neighbors to take effect the configuration changes.
R2 # get router info bgp network
VRF 0 BGP table version is 5, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight RouteTag Path
*>i1.1.1.1/32 4.4.4.4 0 100 0 0 65002 i <-/1> <-----
*> 2.2.2.2/32 0.0.0.0 100 32768 0 i <-/1>
*>i3.3.3.3/32 4.4.4.4 0 100 0 0 i <-/1> <-----
*>i4.4.4.4/32 4.4.4.4 0 100 0 0 i <-/1>
Total number of prefixes 4
R3# get router info bgp network
BGP table version is 12, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight RouteTag Path
*> 1.1.1.1/32 10.1.0.1 0 0 0 65002 i
*>i2.2.2.2/32 4.4.4.4 0 100 0 0 i <--
*> 3.3.3.3/32 0.0.0.0 100 32768 0 i
*>i4.4.4.4/32 4.4.4.4 0 100 0 0 i
Total number of prefixes 4
The next hop is now R4 for all iBGP routes reflected by R4.
Related Articles:
Technical Tip: How to modify BGP next hop for route reflector peering.
Technical Tip: Configuring BGP route reflector.