Вы находитесь на странице: 1из 9

8/8/2016 BGP Next Hop Self | NetworkLessons.

com

Search...

Table of Contents
BGP

Unit 1: Introduction to BGP


Introduction to BGP

eBGP (external BGP)

eBGP Multi-Hop

iBGP (internal BGP)

How to read the BGP Table

How to advertise networks in BGP

iBGP Next Hop Self

BGP Auto-summary

Unit 2: BGP Neighbor Adjacency


Unit 3: BGP Attributes
Unit 4: BGP Communities
Unit 5: BGP Filtering
Unit 6: Advanced BGP Features

You are here: Home » BGP

BGP Next Hop Self


33 votes
https://networklessons.com/bgp/bgp­next­hop­self/ 1/16
8/8/2016 BGP Next Hop Self | NetworkLessons.com

One potential issue with iBGP is that it doesn’t change the next hop IP address. Sometimes this can
cause reachability issues. Let’s look at an example:

Above we have R1 and R2 in AS 12 running iBGP. R3 is in AS 3 and we use eBGP between R2 and
R3. Once we advertise network 3.3.3.0 /24 on R3 in BGP then R2 will learn this preခx and stores it
in its BGP table, the next hop IP adress will be 192.168.23.3.

Once R1 learns about preခx 3.3.3.0 /24 then the next hop IP address will remain 192.168.23.3.
When R1 doesn’t know how to reach this IP address then it will fail to install 3.3.3.0 /24 in its
routing table.

Let’s take a look at the conခguration, I’ll show you two methods how we can deal with this issue.

Configuration
Here’s the BGP conခguraton that we will use:

https://networklessons.com/bgp/bgp­next­hop­self/ 2/16
8/8/2016 BGP Next Hop Self | NetworkLessons.com

R1(config)#router bgp 12 
R1(config‐router)#neighbor 192.168.12.2 remote‐as 12

R2(config)#router bgp 12 
R2(config‐router)#neighbor 192.168.12.1 remote‐as 12 
R2(config‐router)#neighbor 192.168.23.3 remote‐as 3

R3(config)#router bgp 3 
R3(config‐router)#neighbor 192.168.23.2 remote‐as 12 
R3(config‐router)#network 3.3.3.0 mask 255.255.255.0

The conခguration is pretty straight forward. We use iBGP between R1/R2 and eBGP between
R2/R3. On R3 we advertised 3.3.3.0 /24 in BGP. Let’s take a look at the BGP tables:

R2#show ip bgp 
BGP table version is 2, local router ID is 192.168.23.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 
*> 3.3.3.0/24       192.168.23.3             0             0 3 i

R2 has installed 3.3.3.0 /24 in its BGP table and it is a valid route, the next hop is 192.168.23.3. Let’s
check R1:

R1#show ip bgp 
BGP table version is 1, local router ID is 192.168.12.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 
* i3.3.3.0/24       192.168.23.3             0    100      0 3 i
https://networklessons.com/bgp/bgp­next­hop­self/ 3/16
8/8/2016 BGP Next Hop Self | NetworkLessons.com

R1 learns the preခx but it’s unable to install it in the routing table:

R1#show ip route bgp 

The problem here is that the next hop IP address is 192.168.23.3. Does R1 have any clue how to
reach this address?

R1#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 

C    192.168.12.0/24 is directly connected, FastEthernet0/0

R1 doesn’t know so it’s impossible to install 3.3.3.0 /24 in the routing table. How can we ခx this? I’ll
show you two di肠erent methods.

Advertise Network
The ခrst solution is simple, we can advertise the network in iBGP (or an IGP if you use one) so that
R1 is able to reach the next hop. Let’s advertise 192.168.23.0 /24 in BGP:

R2(config)#router bgp 12 
R2(config‐router)#network 192.168.23.0 mask 255.255.255.0

Now take a look at R1:

R1#show ip bgp 

https://networklessons.com/bgp/bgp­next­hop­self/ 4/16
8/8/2016 BGP Next Hop Self | NetworkLessons.com

BGP table version is 3, local router ID is 192.168.12.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 
*>i3.3.3.0/24       192.168.23.3             0    100      0 3 i 
*>i192.168.23.0     192.168.12.2             0    100      0 i

R1 learns about 192.168.23.0 /24 so now it knows how to reach the next hop for 3.3.3.0 /24. It can
now install this network in the routing table:

R1#show ip route bgp 
     3.0.0.0/24 is subnetted, 1 subnets 
B       3.3.3.0 [200/0] via 192.168.23.3, 00:16:20 
B    192.168.23.0/24 [200/0] via 192.168.12.2, 00:16:25

Configurations
Want to take a look for yourself? Here you will ခnd the conခguration of each device.

R1
hostname R1 

interface fastEthernet0/0 
 ip address 192.168.12.1 255.255.255.0 

router bgp 12 
 neighbor 192.168.12.2 remote‐as 12 

end

R2
hostname R2 

https://networklessons.com/bgp/bgp­next­hop­self/ 5/16
8/8/2016 BGP Next Hop Self | NetworkLessons.com


interface fastEthernet1/0 
 ip address 192.168.12.2 255.255.255.0 

interface fastEthernet0/1 
 ip address 192.168.23.1 255.255.255.0 

router bgp 12 
 neighbor 192.168.12.1 remote‐as 12 
 neighbor 192.168.23.3 remote‐as 3 
 neighbor 192.168.12.1 next‐hop‐self 
 network 192.168.23.0 mask 255.255.255.0 

end

R3
hostname R3 

interface fastEthernet0/0 
 ip address 192.168.23.3 255.255.255.0 

router bgp 3 
 neighbor 192.168.23.2 remote‐as 12 
 network 3.3.3.0 mask 255.255.255.0 

end

This will work but there is another solution that is easier. Let’s clean up before we continue:

R2(config)#router bgp 12 
R2(config‐router)#no network 192.168.23.0 mask 255.255.255.0

Now we can try something else…

Next Hop Self


https://networklessons.com/bgp/bgp­next­hop­self/ 6/16
8/8/2016 BGP Next Hop Self | NetworkLessons.com

Next Hop Self


Instead of advertising the network in between R2 and R3 we can conခgure R2 so that it will change
the next hop IP address to it's own address:

R2(config)#router bgp 12 
R2(config‐router)#neighbor 192.168.12.1 next‐hop‐self

From now on, when R2 advertises something to R1 then it will include it's own IP address as the
next hop. Let's verify this:

R1#show ip bgp 
BGP table version is 6, local router ID is 192.168.12.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 
*>i3.3.3.0/24       192.168.12.2             0    100      0 3 i

Above you can see that R1 learns 3.3.3.0 /24 with 192.168.12.2 as the next hop. Since this is
directly connected, we can use this information:

R1#show ip route bgp 
     3.0.0.0/24 is subnetted, 1 subnets 
B       3.3.3.0 [200/0] via 192.168.12.2, 00:00:33

R1 has installed it in its routing table, problem solved!

Configurations

Want to take a look for yourself? Here you will ခnd the conခguration of each device.

R1

https://networklessons.com/bgp/bgp­next­hop­self/ 7/16
8/8/2016 BGP Next Hop Self | NetworkLessons.com

hostname R1 

interface fastEthernet0/0 
 ip address 192.168.12.1 255.255.255.0 

router bgp 12 
 neighbor 192.168.12.2 remote‐as 12 

end

R2
hostname R2 

interface fastEthernet1/0 
 ip address 192.168.12.2 255.255.255.0 

interface fastEthernet0/1 
 ip address 192.168.23.1 255.255.255.0 

router bgp 12 
 neighbor 192.168.12.1 remote‐as 12 
 neighbor 192.168.23.3 remote‐as 3 
 neighbor 192.168.12.1 next‐hop‐self 

end

R3
hostname R3 

interface fastEthernet0/0 
 ip address 192.168.23.3 255.255.255.0 

router bgp 3 
 neighbor 192.168.23.2 remote‐as 12 

https://networklessons.com/bgp/bgp­next­hop­self/ 8/16
8/8/2016 BGP Next Hop Self | NetworkLessons.com

 network 3.3.3.0 mask 255.255.255.0 

end

I hope this lesson has been useful, if you have any questions feel free to leave a comment!

Rate this Lesson:

« Previous Lesson
How to advertise networks in BGP
Next Lesson
BGP Auto-summary »
Home › Forums › BGP Next Hop Self

This topic contains 28 replies, has 13 voices, and was last updated by   Hoan N 1 week, 5 days
ago.

Viewing 15 posts - 1 through 15 (of 28 total)


12→
Author
Posts  | Subscribe
June 24, 2015 at 18:50 #10571 Reply

ammar a
Member

https://networklessons.com/bgp/bgp­next­hop­self/ 9/16

Вам также может понравиться