Two ways to set iBGP “next-hop-self” for full reachability

Q. Do internal BGP (iBGP) sessions modify the next hop?

A. iBGP sessions preserve the next hop attribute learned from eBGP peers. This is why it is important to have an internal route to the next hop. The BGP route is otherwise unreachable. In order to make sure you can reach the eBGP next hop, include the network that the next hop belongs to in the IGP or issue the next-hop-self neighbor command to force the router to advertise itself, rather than the external peer, as the next hop. Refer to the BGP Next Hop Attribute section of BGP Case Studies for a more detailed explanation.

http://www.cisco.com/en/US/tech/tk365/technologies_q_and_a_item09186a00800949e8.shtml

BGP_next-hop-self

1st standard way using ‘next-hop-self’ on iBGP (eBGP conneted router upstream)

R3(config-if)#do sh run | s bgp
router bgp 34
no synchronization
bgp log-neighbor-changes
network 4.4.4.4 mask 255.255.255.255
network 34.34.34.0 mask 255.255.255.0
neighbor 13.13.13.1 remote-as 12
neighbor 13.13.13.1 send-community both
neighbor 13.13.13.1 route-map 34->12 out
neighbor 23.23.23.2 remote-as 21
neighbor 34.34.34.4 remote-as 34
neighbor 34.34.34.4 next-hop-self

R4(config-router)#do sh ip bgp
BGP table version is 44, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete

Network          Next Hop            Metric LocPrf Weight Path
r>i4.4.4.4/32       34.34.34.3               2    100      0 i
*>i8.8.8.8/32       34.34.34.3               0    100      0 12 i
r>i34.34.34.0/24    34.34.34.3               0    100      0 i

R3(config-router)#no  neighbor 34.34.34.4 next-hop-self

R4#sh ip bgp
BGP table version is 43, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete

Network          Next Hop            Metric LocPrf Weight Path
r>i4.4.4.4/32       34.34.34.3               2    100      0 i
* i8.8.8.8/32       13.13.13.1               0    100      0 12 i
r>i34.34.34.0/24    34.34.34.3               0    100      0 i

2nd way use route-map and set ‘ip next-hop peer-address’ command on downstream iBGP peer

R4(config)#route-map SET_NEXTHOP_PEER_ADDRESS
R4(config-route-map)#set ip next-hop peer-address
R4(config-route-map)#router bgp 34
R4(config-router)#neighbor 34.34.34.3 route-map SET_NEXTHOP_PEER_ADDRESS in
R4(config-router)#do clear ip bgp * soft in
R4(config-router)#
*Jul 26 20:38:52.371: RT: add 8.8.8.8/32 via 34.34.34.3, bgp metric [200/0]
*Jul 26 20:38:52.375: RT: NET-RED 8.8.8.8/32
R4(config-router)#do sh ip bgp
BGP table version is 44, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete

Network          Next Hop            Metric LocPrf Weight Path
r>i4.4.4.4/32       34.34.34.3               2    100      0 i
*>i8.8.8.8/32       34.34.34.3               0    100      0 12 i
r>i34.34.34.0/24    34.34.34.3               0    100      0 i

 

configurations files:

https://www.dropbox.com/s/vcdumrhr151yp6l/BGP_set_next-hop-self.zip

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s