Tuesday 5 May 2020

BGP CHAPTER 13 - Next Hop Self in BGP

Today in this post we will focus on a BGP  "Next Hop Self "

Lets try to understand with help of the below Lab 


In this LAB R1 AND R2 belongs to AS 100 , R3 belongs to AS 200

There is already iBGP  Configuration between R1 & R2 ,eBGP between Configuration between R1 & R2 

!! Checks for Interfaces and IP address assigned 

R1#sh int des
Interface                      Status         Protocol Description
Fa0                            up             up       Connection to R2
Se0                            up             up       Connection to R3

R1#sh ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0              121.1.1        YES manual up                    up
Serial0                    13.1.1.1        YES manual up                    up

R2#sh int des
Interface                      Status         Protocol Description
Fa0                            up             up       Connection to R1

R2#sh ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0              12.1.1.2      YES manual up                    up


R3#sh int des
Interface                      Status         Protocol Description
Se0                            up             up       Connection to R3

R3#sh ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0              unassigned      YES unset  administratively down down
Serial0                    13.1.1.3        YES manual up                    up

!! Checks for BGP Neighborship

R1#sh ip bgp summary
BGP router identifier 13.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.1.1.2        4   100       8       8        1    0    0 00:05:18        0
13.1.1.3        4   200       7       7        1    0    0 00:03:51        0

R2#sh ip bgp summary
BGP router identifier 12.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.1.1.1        4   100       8       8        1    0    0 00:05:49        0

R3#sh ip bgp summ
BGP router identifier 13.1.1.3, local AS number 200
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
13.1.1.1        4   100       8       8        1    0    0 00:04:57        0

Next Hop Behaviour In BGP

  • When a BGP router sends an update (route) to its eBGP neighbor its next-hop will be itself.
  • When a BGP router sends an update (route) to its iBGP neighbor its next-hop will not change.
Now lets configure an loopback interface on R3 and advertise it to its eBGP Neighbor R1 and check the Next Hop Behavior.

R3(config)#int loopback 0

R3(config-if)#ip address 100.0.0.1 255.255.255.0
R3(config-if)#^Z


R3(config)#router bgp 200

R3(config-router)#network 100.0.0.0 mask 255.255.255.0
R3(config-router)#^Z

R1#sh ip bgp
BGP table version is 2, local router ID is 13.1.1.1
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
*> 100.0.0.0/24     13.1.1.3                 0             0 200 i

R2#sh ip bgp
BGP table version is 1, local router ID is 12.1.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
* i100.0.0.0/24     13.1.1.3                 0    100      0 200 i

R2#ping 100.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.0.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

From R2 100.0.0.1 is not pingable because for it next hop to reach it is 13.1.1.3 for which it dont have route .

Solution on it to -
  • Add static route for 100.0.0.1/24 on R2 and reverse route on R3.
  • Advertise the LAN WAN links network in BGP.
  • Configure Next hop self on R1 and reverse route on R3.
Lets add static router for 100.0.0.1/24 on R2 and reverse route on R3.

R2(config)#ip route 100.0.0.0 255.255.255.0 12.1.1.1
R2(config)#^Z

R3(config)#ip route 12.1.1.0 255.255.255.0 13.1.1.1
R3(config)#^Z

R2#ping 100.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/29/40 ms

Lets remove the static route and advertise WAN links in BGP .
R2(config)#no ip route 100.0.0.0 255.255.255.0 12.1.1.1
R2(config)#

R3(config)#no ip route 12.1.1.0 255.255.255.0 13.1.1.1
R3(config)#^Z

R1(config)#router bgp 100
R1(config-router)#network 12.1.1.0 mask 255.255.255.0
R1(config-router)#network 13.1.1.0 mask 255.255.255.0
R1(config-router)#^Z

R2(config)#router bgp 100
R2(config-router)#network 12.1.1.0 mask 255.255.255.0
R2(config-router)#^Z
R2#

R3(config)#router bgp 200
R3(config-router)#network 13.1.1.0 mask 255.255.255.0
R3(config-router)#^Z
R3#

!! Checking BGP table on R2

R2#sh ip bgp
BGP table version is 11, local router ID is 12.1.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
* i12.1.1.0/24      12.1.1.1                 0    100      0 i
*>                  0.0.0.0                  0         32768 i
*>i13.1.1.0/24      12.1.1.1                 0    100      0 i
*>i100.0.0.0/24     13.1.1.3                 0    100      0 200 i
R2#

R2#ping 100.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/21/36 ms

Lets remove the network advertisment of 13.1.1.1/24 network on R1 and R3.

R3(config)#router bgp 200
R3(config-router)#no network 13.1.1.0 mask 255.255.255.0
R3(config-router)#^Z

R1(config)#router bgp 100
R1(config-router)#no network 13.1.1.0 mask 255.255.255.0
R1(config-router)#^Z

Now we wont be able to reach 100.0.0.1 from R2

R2#ping 100.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.0.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)


R1(config)#router bgp 100
R1(config-router)#neighbor 12.1.1.2 next-hop-self  
R1(config-router)#^Z

R2#sh ip bgp
BGP table version is 15, local router ID is 12.1.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
* i12.1.1.0/24      12.1.1.1                 0    100      0 i
*>                  0.0.0.0                  0         32768 i
*>i100.0.0.0/24     12.1.1.1                 0    100      0 200 i
R2#


R2#ping 100.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/25/44 ms

Hope you all like this post 

Thanks for reading !!!

No comments:

Post a Comment