What is BGP Next-Hop-Self? Actually BGP next hop is different like IGP. For example, please see below picture, R1 want to route Network A, the next hop in R1 is f0/0 in R3!!! That's why we need 'next-hop-self' to inform other router to pass the route via this router with 'next-hop-self'. Please correct me if I am wrong!
Let's try the lab
R1#
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Loopback1
ip address 100.100.100.1 255.255.255.255
!
interface FastEthernet0/0
ip address 12.12.12.1 255.255.255.0
R2#
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface Loopback1
ip address 200.200.200.2 255.255.255.255
!
interface FastEthernet0/0
ip address 12.12.12.2 255.255.255.0
!
interface FastEthernet0/1
ip address 23.23.23.2 255.255.255.0
R3#
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface Loopback1
ip address 33.33.33.33 255.255.255.255
!
interface FastEthernet0/0
ip address 23.23.23.3 255.255.255.0
Make sure loopback can be ping… Solution using IGP
R1#
router rip
network 1.0.0.0
network 12.0.0.0
R2#
router rip
network 2.0.0.0
network 12.0.0.0
network 23.0.0.0
R3#
router rip
network 3.0.0.0
network 23.0.0.0
After loopback can be ping, we can activate BGP
R1#
router bgp 12
neighbor 2.2.2.2 remote-as 12
neighbor 2.2.2.2 update-source loopback0
net 100.100.100.1 mask 255.255.255.255
R2#
router bgp 12
nei 1.1.1.1 remot 12
nei 1.1.1.1 upd lo0
nei 3.3.3.3 remot 3
nei 3.3.3.3 upd lo0
nei 3.3.3.3 ebgp
net 200.200.200.2 mask 255.255.255.255
R3#
router bgp 3
nei 2.2.2.2 remot 12
nei 2.2.2.2 upd lo0
nei 2.2.2.2 ebgp
net 33.33.33.33 mask 255.255.255.255
Check bgp
R1(config-router)#do sh ip bgp
BGP table version is 3, local router ID is 100.100.100.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
* i33.33.33.33/32 3.3.3.3 0 100 0 3 i
*> 100.100.100.1/32 0.0.0.0 0 32768 i
*>i200.200.200.2/32 2.2.2.2 0 100 0 i
R2(config-router)#do sh ip bgp
BGP table version is 4, local router ID is 200.200.200.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
*> 33.33.33.33/32 3.3.3.3 0 0 3 i
*>i100.100.100.1/32 1.1.1.1 0 100 0 i
*> 200.200.200.2/32 0.0.0.0 0 32768 i
R3(config-router)#do sh ip bgp
BGP table version is 4, local router ID is 33.33.33.33
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
*> 33.33.33.33/32 0.0.0.0 0 32768 i
*> 100.100.100.1/32 2.2.2.2 0 12 i
*> 200.200.200.2/32 2.2.2.2 0 0 12 i
Check ping
R1(config-router)#do ping 200.200.200.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 200.200.200.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/48/68 ms
R1(config-router)#do ping 33.33.33.33
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.33.33.33, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R2(config-router)#do ping 33.33.33.33
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.33.33.33, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/48/68 ms
R2(config-router)#do ping 100.100.100.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.100.100.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/48/64 ms
R3(config-router)#do ping 100.100.100.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.100.100.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R3(config-router)#do ping 200.200.200.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 200.200.200.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/41/64 ms
Oupss, R1 can not ping to loopback R2 and vice versa!!! Let’s add command ‘next-hop-self’ in R2
R2#
router bgp 12
neighbor 1.1.1.1 next-hop-self
Now verify BGP routing
R1(config-router)#do sh ip bgp
BGP table version is 114, local router ID is 100.100.100.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
*>i33.33.33.33/32 2.2.2.2 0 100 0 3 i
*> 100.100.100.1/32 0.0.0.0 0 32768 i
*>i200.200.200.2/32 2.2.2.2 0 100 0 i
R1(config-router)#do ping 33.33.33.33
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.33.33.33, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/58/88 ms
No comments:
Post a Comment