www.netprotocolxpert.in 1
 BGP is an autonomous system by autonomous system routing protocol,
and next hop value of BGP network updates that leave an AS, is the IP
address of the router at the exit point from AS. Further, that
advertisement is sent through iBGP to neighbors, but next hop
attribute remains the same. Usually, a router inside AS, does not have
a route to external IP address from next hop attribute.
 To overcome this issue, use next command:
 neighbor {ip-addr | group-name } next-hop-self
 This command will change next hop attribute for received updates to
its own IP address. Type this command under BGP configuration mode
on Router at the entry point in AS.
2
When ISP2 Router advertise its network 192.168.0.0/24, next hop ip address will
be 10.0.0.2 (its fa0/0 interface). ISP1 advertise this network to Branch router
with the same 10.0.0.2 next hop attribute. Let’s configure those routers, but
won’t change next hop attribute for now.
3
ISP1
 ISP1(config)#interface fastEthernet 0/0
 ISP1(config-if)#ip address 10.0.0.1 255.255.255.252
 ISP1(config-if)#no shutdown
 ISP1(config-if)#interface fastEthernet 0/1
 ISP1(config-if)#ip address 10.0.1.1 255.255.255.252
 ISP1(config-if)#no shutdown
 ISP1(config-if)#exit
 ISP1(config)#router bgp 65000
 ISP1(config-router)#neighbor 10.0.1.2 remote-as 65000
 ISP1(config-router)#neighbor 10.0.0.2 remote-as 65100
 ISP1(config-router)#network 10.0.1.0 mask 255.255.255.252
4
Branch
 Branch(config)#interface fastEthernet 0/0
 Branch(config-if)#ip address 10.0.1.2 255.255.255.252
 Branch(config-if)#no shutdown
 Branch(config)#router bgp 65000
 Branch(config-router)#neighbor 10.0.1.1 remote-as 65000
5
 ISP2
 ISP2(config)#interface fastEthernet 0/0
 ISP2(config-if)#ip address 10.0.0.2 255.255.255.252
 ISP2(config-if)#no shutdown
 ISP2(config-if)#interface lo 0
 ISP2(config-if)#ip address 192.168.0.1 255.255.255.0
 ISP2(config-if)#exit
 ISP2(config)#router bgp 65100
 ISP2(config-router)#neighbor 10.0.0.1 remote-as 65000
 ISP2(config-router)#network 192.168.0.0 mask 255.255.255.0
6
 Branch#show ip bgp
 BGP table version is 3, local router ID is 10.0.1.2
 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>i10.0.1.0/30 10.0.1.1 0 100 0 i
 * i192.168.0.0 10.0.0.2 0 100 0 65100 i
 Branch#
7
 Branch#show ip route
 Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
 E1 - OSPF external type 1, E2 - OSPF external type 2
 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
 ia - IS-IS inter area, * - candidate default, U - per-user static route
 o - ODR, P - periodic downloaded static route
 Gateway of last resort is not set
 10.0.0.0/30 is subnetted, 1 subnets
 C 10.0.1.0 is directly connected, FastEthernet0/0
 Branch#
8
 Type next-hop-self command on ISP1 to change next-hop attribute for
external networks that will be advertised to Branch router:
 ISP1(config-router)#neighbor 10.0.1.2 next-hop-self
9
 Branch#show ip bgp
 BGP table version is 6, local router ID is 10.0.1.2
 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>i10.0.1.0/30 10.0.1.1 0 100 0 i
 *>i192.168.0.0 10.0.1.1 0 100 0 65100 I
 Next hop attribute has changed from 10.0.0.2 to 10.0.1.1
10
 Branch#show ip route
 Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
 E1 - OSPF external type 1, E2 - OSPF external type 2
 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
 ia - IS-IS inter area, * - candidate default, U - per-user static route
 o - ODR, P - periodic downloaded static route
 Gateway of last resort is not set
 10.0.0.0/30 is subnetted, 1 subnets
 C 10.0.1.0 is directly connected, FastEthernet0/0
 B 192.168.0.0/24 [200/0] via 10.0.1.1, 00:02:02
 Branch# 11
 Branch#ping 192.168.0.1
 Type escape sequence to abort.
 Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
 !!!!!
 Success rate is 100 percent (5/5), round-trip min/avg/max = 28/47/76 ms
 Branch#
12
https://www.facebook.com/
NetProtocolXpert/
https://www.linkedin.com/
company/netprotocol-xpert
https://plus.google.com/u
/0/collection/AYQ-EB
https://www.instagram.co
m/netprotocol_xpert/
https://twitter.com/NPX_cis
co
https://branded.me/netpr
otocolxpert
13

BGP Next-hop-self

  • 1.
  • 2.
     BGP isan autonomous system by autonomous system routing protocol, and next hop value of BGP network updates that leave an AS, is the IP address of the router at the exit point from AS. Further, that advertisement is sent through iBGP to neighbors, but next hop attribute remains the same. Usually, a router inside AS, does not have a route to external IP address from next hop attribute.  To overcome this issue, use next command:  neighbor {ip-addr | group-name } next-hop-self  This command will change next hop attribute for received updates to its own IP address. Type this command under BGP configuration mode on Router at the entry point in AS. 2
  • 3.
    When ISP2 Routeradvertise its network 192.168.0.0/24, next hop ip address will be 10.0.0.2 (its fa0/0 interface). ISP1 advertise this network to Branch router with the same 10.0.0.2 next hop attribute. Let’s configure those routers, but won’t change next hop attribute for now. 3
  • 4.
    ISP1  ISP1(config)#interface fastEthernet0/0  ISP1(config-if)#ip address 10.0.0.1 255.255.255.252  ISP1(config-if)#no shutdown  ISP1(config-if)#interface fastEthernet 0/1  ISP1(config-if)#ip address 10.0.1.1 255.255.255.252  ISP1(config-if)#no shutdown  ISP1(config-if)#exit  ISP1(config)#router bgp 65000  ISP1(config-router)#neighbor 10.0.1.2 remote-as 65000  ISP1(config-router)#neighbor 10.0.0.2 remote-as 65100  ISP1(config-router)#network 10.0.1.0 mask 255.255.255.252 4
  • 5.
    Branch  Branch(config)#interface fastEthernet0/0  Branch(config-if)#ip address 10.0.1.2 255.255.255.252  Branch(config-if)#no shutdown  Branch(config)#router bgp 65000  Branch(config-router)#neighbor 10.0.1.1 remote-as 65000 5
  • 6.
     ISP2  ISP2(config)#interfacefastEthernet 0/0  ISP2(config-if)#ip address 10.0.0.2 255.255.255.252  ISP2(config-if)#no shutdown  ISP2(config-if)#interface lo 0  ISP2(config-if)#ip address 192.168.0.1 255.255.255.0  ISP2(config-if)#exit  ISP2(config)#router bgp 65100  ISP2(config-router)#neighbor 10.0.0.1 remote-as 65000  ISP2(config-router)#network 192.168.0.0 mask 255.255.255.0 6
  • 7.
     Branch#show ipbgp  BGP table version is 3, local router ID is 10.0.1.2  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>i10.0.1.0/30 10.0.1.1 0 100 0 i  * i192.168.0.0 10.0.0.2 0 100 0 65100 i  Branch# 7
  • 8.
     Branch#show iproute  Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP  D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area  N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2  E1 - OSPF external type 1, E2 - OSPF external type 2  i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2  ia - IS-IS inter area, * - candidate default, U - per-user static route  o - ODR, P - periodic downloaded static route  Gateway of last resort is not set  10.0.0.0/30 is subnetted, 1 subnets  C 10.0.1.0 is directly connected, FastEthernet0/0  Branch# 8
  • 9.
     Type next-hop-selfcommand on ISP1 to change next-hop attribute for external networks that will be advertised to Branch router:  ISP1(config-router)#neighbor 10.0.1.2 next-hop-self 9
  • 10.
     Branch#show ipbgp  BGP table version is 6, local router ID is 10.0.1.2  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>i10.0.1.0/30 10.0.1.1 0 100 0 i  *>i192.168.0.0 10.0.1.1 0 100 0 65100 I  Next hop attribute has changed from 10.0.0.2 to 10.0.1.1 10
  • 11.
     Branch#show iproute  Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP  D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area  N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2  E1 - OSPF external type 1, E2 - OSPF external type 2  i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2  ia - IS-IS inter area, * - candidate default, U - per-user static route  o - ODR, P - periodic downloaded static route  Gateway of last resort is not set  10.0.0.0/30 is subnetted, 1 subnets  C 10.0.1.0 is directly connected, FastEthernet0/0  B 192.168.0.0/24 [200/0] via 10.0.1.1, 00:02:02  Branch# 11
  • 12.
     Branch#ping 192.168.0.1 Type escape sequence to abort.  Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:  !!!!!  Success rate is 100 percent (5/5), round-trip min/avg/max = 28/47/76 ms  Branch# 12
  • 13.