May 22, 2024

BGP next hop self configuration example

BGP next hop self configuration example:

[boxads]Today i will discuss bgp next hop self configuration example in cisco router. When any router receive BGP route from eBGP  source & forward it any iBGP peer, then BGP normally pass directly connected next hop ip address.  To overcome this issue, we use next hop self command in BGP section at the entry point router which router is directly connected to eBGP peer.

neighbor {ip-addr | group-name } next-hop-self

Let’s take an example.

BGP next hop self configuration example Diagram:

BGP next hop self configuration example
BGP next hop self configuration example

In this diagram we look Two ISP connected via eBGP peer & ISP-1 has a internal iBGP peer. Here R1 & R3 use 10.10.10.0/30 network ip, R1 & R2 use 172.16.1.0/30 network ip. Also test purpose we add a loopback ip in R2 router that is 20.20.20.20/24. When ISP-2 Router R2 advertise its network 20.20.20.0/24, next hop ip address will be 172.16.1.2 (its fa0/0 interface of R2 router). ISP-1 Router R1 advertise this network to iBGP peer router R3 with the same 172.16.1.2 next hop attribute. Let’s configure those routers, but won’t change next hop attribute for now.

Router R1 Configure:

R1#conf t
R1(config)#int fa0/1
R1(config-if)#ip address 10.10.10.1 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#int fa0/0
R1(config-if)#ip address 172.16.1.1 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#router bgp 100
R1(config-router)#neighbor 172.16.1.2 remote-as 200
R1(config-router)#neighbor 10.10.10.2 remote-as 100
R1(config-router)#network 10.10.10.0 mask 255.255.255.252

[adsense]

Router R2 Configure:

R2#conf t
R2(config)#int fa0/0
R2(config-if)#ip address 172.16.1.2 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#int loopback 0
R2(config-if)#ip address 20.20.20.20 255.255.255.0
R2(config-if)#exit
R2(config)#router bgp 200
R2(config-router)#neighbor 172.16.1.1 remote-as 100
R2(config-router)#network 20.20.20.0 mask 255.255.255.0

Router R3 Configure:

R3#conf t
R3(config)#int fa0/1
R3(config-if)#ip address 10.10.10.2 255.255.255.252
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#router bgp 100
R3(config-router)#neighbor 10.10.10.1 remote-as 100

 Now we will be check next hop attribute on R3 router for network 172.16.1.0:

show ip bgp router R3
show ip bgp router R3

As you can see, next hop for 20.20.20.0 network is 172.16.1.2 which is out site of AS-100,and we didn’t get ping 20.20.20.20 ip. Also R3 router doesn’t have a route to it. BGP will not put 20.20.20.0 into routing table because it doesn’t know how to reach next hop, you can see this below:

sh ip route R3 router
sh ip route R3 router

Now, I will type next-hop-self command on ISP-1 R1 router to change next-hop attribute for external networks that will be advertised to R3 router:

BGP next hop self configuration example:

R1(config)#router bgp 100
R1(config-router)#neighbor 10.10.10.2 next-hop-self

And again we will verify on R3 router:

BGP next hop self configuration example
BGP next hop self configuration example

Have you seen? Next hop attribute has changed from 172.16.1.2 to 10.10.10.1. And we got ping 20.20.20.0 network ip, Let’s check routing table:

Routing table after configure next hop self
Routing table after configure next hop self

Here we found 20.20.20.0 network in our routing table. That’s all, I hope you enjoyed this lab!

Shahed

Hi! I am Shahed Israr. I try to help GPON Technology users with their queries and provide them with relevant and accurate information to the best of my ability. My main goal is to assist and enhance GPON Technology user and help people find the answers they're looking for quickly and easily.

Follow Me:
TwitterFacebookLinkedInPinterestGoogle PlusDiggYouTubeRedditDelicious

Visited 425 times, 2 visit(s) today

Comments

comments

Shahed

Hi! I am Shahed Israr. I try to help GPON Technology users with their queries and provide them with relevant and accurate information to the best of my ability. My main goal is to assist and enhance GPON Technology user and help people find the answers they're looking for quickly and easily.

View all posts by Shahed →

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

error: Content is protected !!