cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3213
Views
5
Helpful
8
Replies

bgp next-hop

sachin30720041
Level 1
Level 1

Hello

 

R1(1.1.1.1)              R2(2.2.2.2)

   \(vrf1)                            /(vrf1)

   PE1--------P------PE2

  /(vrf2)                            \(vrf2)

R3 (3.3.3.3)              R4(4.4.4.4)

 

There is BGP vpnv4 running between PE1 and PE2.

6.6.6.6(loopback1), 61.61.61.61(loopback2) and 62.62.62.62(loopback3) are the loopbacks on PE2. All 3 loopbacks are advertised in igp. As a result, PE1 has a reachability to all 3 loopbacks.

 

On PE1, 6.6.6.6 is the next hop for 2.2.2.2 and 4.4.4.4.

I want to configure 61.61.61.61 as the next hop for 2.2.2.2  and 62.62.62.62 as the next hop for 4.4.4.4 on PE1.

So I configured 'bgp next-hop' under vrf1 and vrf2. And restarted the BGP process.

 

vrf definition vrf1
rd 12:12
!
address-family ipv4
route-target export 12:12
route-target import 11:11
bgp next-hop Loopback1
exit-address-family
vrf definition vrf2
rd 22:22
!
address-family ipv4
route-target export 22:22
route-target import 21:21
bgp next-hop Loopback2
exit-address-family

 

But still, I see 6.6.6.6 as the next hop for 2.2.2.2 and 4.4.4.4.

Am I missing anything?

 

Thanks,

Sachin

 

 

 

 

1 Accepted Solution

Accepted Solutions

Hi @sachin30720041 ,

 

This feature is not supported for interAS vpnv4. You need to include R4 in AS3 for it to work.

 

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

View solution in original post

8 Replies 8

Harold Ritter
Level 12
Level 12

Hi @sachin30720041 ,

 

Is this a typo?

 

vrf definition vrf1
rd 12:12
!
address-family ipv4
route-target export 12:12
route-target import 11:11
bgp next-hop Loopback1 <++++++++ according to what you mentioned, this is 6.6.6.6, right?
exit-address-family

 

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Hi Harold,

 

Yes, That is a typo.

Correct config is.

 

vrf definition vrf1
rd 12:12
!
address-family ipv4
route-target export 12:12
route-target import 11:11
bgp next-hop Loopback2
exit-address-family
vrf definition vrf2
rd 22:22
!
address-family ipv4
route-target export 22:22
route-target import 21:21
bgp next-hop Loopback3
exit-address-family

 

lo2 and lo3 are in the global table. 

 

Thanks,

Sachin

Hi @sachin30720041 ,

 

And just to make sure, the config with the "bgp next-hop" is applied on PE2, right? If so, it should just work. Did you try a "clear bgp vpnv4 uni * soft out"  from PE2 to see if it solves the issue.

 

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Below is the complete configuration.

 

R1

    \

    R3-----R4

    /

R2

 

R3 and R4 are PE routers. BGP vpnv4 session is up between R3 and R4.

R1 and R2 are CE routers.

 

R1
---------------------
int gi1
ip address 100.10.30.1 255.255.255.0
no sh

int lo0
ip address 1.1.1.1 255.255.255.255


router bgp 1
neighbor 100.10.30.3 remote-as 3
network 1.1.1.1 mask 255.255.255.255


R2
---------------------------------
int gi2
ip address 100.20.30.2 255.255.255.0
no sh

int lo0
ip address 2.2.2.2 255.255.255.255

router bgp 2
neighbor 100.20.30.3 remote-as 3
network 2.2.2.2 mask 255.255.255.255
 

 

R3

---------------------------------------

int lo1
ip address 31.31.31.31 255.255.255.255
ip ospf 1 area 0

int lo2
ip address 32.32.32.32 255.255.255.255
ip ospf 1 area 0

vrf def vrf1
rd 31:31
address-family ipv4 uni
route-target export 31:31
route-target import 4:4
bgp next-hop lo1

vrf def vrf2
rd 32:32
address-family ipv4 uni
route-target export 32:32
route-target import 4:4
bgp next-hop lo2

int gi1
vrf forwarding vrf1
ip address 100.10.30.3 255.255.255.0
no sh

int gi2
vrf forwarding vrf2
ip address 100.20.30.3 255.255.255.0
no sh

int gi3
ip ospf 1 area 0
ip address 100.30.40.3 255.255.255.0
no sh

int lo0
ip ospf 1 area 0
ip address 3.3.3.3 255.255.255.255

router ospf 1
router-id 3.3.3.3
mpls ldp autoconfig

router bgp 3
neighbor 4.4.4.4 remote-as 4
neighbor 4.4.4.4 update-source lo0
neighbor 4.4.4.4 ebgp-multihop 255
address vpnv4 unicast
neighbor 4.4.4.4 activate
address-family ipv4 vrf vrf1
neighbor 100.10.30.1 remote-as 1
address-family ipv4 vrf vrf2
neighbor 100.20.30.2 remote-as 2
 
R4
---------------------------------------

 

vrf def vrf1
rd 4:4
address-family ipv4 uni
route-target export 4:4
route-target import 32:32
route-target import 31:31

router ospf 1
router-id 4.4.4.4
mpls ldp autoconfig
 
int gi3
ip ospf 1 area 0
ip address 100.30.40.4 255.255.255.0
no sh

int lo0
ip ospf 1 area 0
ip address 4.4.4.4 255.255.255.255

router bgp 4
neighbor 3.3.3.3 remote-as 3
neighbor 3.3.3.3 update-source lo0
neighbor 3.3.3.3 ebgp-multihop 255
address-family vpnv4 unicast
neighbor 3.3.3.3 activate
 
After executing " clear bgp vpnv4 unicast *" on R3 and R4, I see the following output on R4
 

Router#show bgp vpnv4 unicast all
Route Distinguisher: 4:4 (default for vrf vrf1)
*> 1.1.1.1/32              3.3.3.3          0 3 1 i
*> 2.2.2.2/32              3.3.3.3         0 3 2 i
Route Distinguisher: 31:31
*> 1.1.1.1/32              3.3.3.3         0 3 1 i
Route Distinguisher: 32:32
*> 2.2.2.2/32             3.3.3.3         0 3 2 i

 
 
I am expecting the next hop for 1.1.1.1 should be 31.31.31.31 and the next hop for 2.2.2.2 should be 32.32.32.32.
I am not sure what I am missing.
 
Thanks,
Sachin 
 
 

config the Lo with vrf forwarding.

Hi @sachin30720041 ,

 

This feature is not supported for interAS vpnv4. You need to include R4 in AS3 for it to work.

 

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

addition to Mr.Harold suggest, do you config each loopback with it VRF i think it not use loopback as loopback in different vrf or in global.

ntikader
Cisco Employee
Cisco Employee

Hi Sachin , 

 

The VRF  address-family  BGP next hop is  made  to  works for Intra AS  network .

------------------

As with inter AS in your setup due to BGP Next Hop attribute for E-BGP  , the next hop will be the E-BGP configured  neighbor (here it is 3.3.3.3).

 

--------------------------------------------------------------

BGP Nexthop Attribute. The BGP nexthop attribute is the next hop IP address that is going to be used to reach a certain destination.
For EBGP, the next hop is always the IP address of the neighbor specified in the neighbor command.

 

PE3(config)#vrf definition 2
PE3(config-vrf)#address-family ipv4 unicast
PE3(config-vrf-af)#bgp ?
next-hop Next-hop for the routes of a VRF in the backbone(in backbone we should  normally have intra AS )

-------------------------------------------------------------------------------------

PE 3 will send next hop as it's loopback

 

*Dec 12 03:31:01.100: %BGP_SESSION-5-ADJCHANGE: neighbor 4.4.4.4 VPNv4 Unicast topology base removed from session BGP Notification received
*Dec 12 03:31:01.100: %BGP_SESSION-5-ADJCHANGE: neighbor 4.4.4.4 IPv4 Unicast topology base removed from session BGP Notification received
*Dec 12 03:31:01.922: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Up
*Dec 12 03:31:01.923: BGP(4): (base) 4.4.4.4 send UPDATE (format) 31:31:1.1.1.1/32, next 3.3.3.3, label 17, metric 0, path 1, extended community RT:31:31
*Dec 12 03:31:01.924: BGP(4): (base) 4.4.4.4 send UPDATE (format) 32:32:2.2.2.2/32, next 3.3.3.3, label 18, metric 0, path 1, extended community RT:32:32



PE4#sh bgp vpnv4 unicast all
BGP table version is 159, local router ID is 4.4.4.4
Route Distinguisher: 4:4 (default for vrf vrf1)
*> 1.1.1.1/32 3.3.3.3 0 3 1 i
*> 2.2.2.2/32 3.3.3.3 0 3 1 i
*> 72.72.72.72/32 3.3.3.3 0 0 3 i
Route Distinguisher: 31:31
*> 1.1.1.1/32 3.3.3.3 0 3 1 i
*> 72.72.72.72/32 3.3.3.3 0 0 3 i
Route Distinguisher: 32:32
*> 2.2.2.2/32 3.3.3.3 0 3 1 i
P


PE4#sh bgp vpnv4 unicast all nexthops  ---------- as said next hop will be EBGP neighbor 
# Paths Nexthop Address
Route Distinguisher: 4:4 (default for vrf vrf1)
6 3.3.3.3
Route Distinguisher: 31:31
6 3.3.3.3
Route Distinguisher: 32:32
6 3.3.3.3



solution---------------------

 

when i changed PE 4 to AS 3 as simillar to PE 3 you can see the change you need .( Harold has already sugegsted this earlier )

 

Dec 12 03:39:37.298: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Up
*Dec 12 03:39:37.300: BGP(4): (base) 4.4.4.4 send UPDATE (format) 31:31:1.1.1.1/32, next 31.31.31.31, label 17, metric 0, path 1, extended community RT:31:31
*Dec 12 03:39:37.300: BGP(4): (base) 4.4.4.4 send UPDATE (format) 32:32:2.2.2.2/32, next 32.32.32.32, label 18, metric 0, path 1, extended community RT:32:32

 

PE3
router bgp 3
bgp router-id 3.3.3.3
bgp log-neighbor-changes
neighbor 4.4.4.4 remote-as 3
neighbor 4.4.4.4 update-source Loopback0


PE4#sh bgp vpnv4 unicast all nexthops
# Paths Nexthop Address
Route Distinguisher: 4:4 (default for vrf vrf1)
4 31.31.31.31 ----------- changed
2 32.32.32.32
Route Distinguisher: 31:31
4 31.31.31.31 ---------- changed
Route Distinguisher: 32:32
2 32.32.32.32


PE4#sh bgp vpnv4 unicast all 1.1.1.1
BGP routing table entry for 4:4:1.1.1.1/32, version 17
Paths: (1 available, best #1, table vrf1)
Not advertised to any peer
Refresh Epoch 1
1, imported path from 31:31:1.1.1.1/32 (global)
31.31.31.31 (metric 2) (via default) from 3.3.3.3 (3.3.3.3)
Origin IGP, metric 0, localpref 100, valid, internal, best
Extended Community: RT:31:31
mpls labels in/out nolabel/17
rx pathid: 0, tx pathid: 0x0
Updated on Dec 12 2021 03:39:37 UTC


BGP routing table entry for 31:31:1.1.1.1/32, version 14
Paths: (1 available, best #1, no table)
Not advertised to any peer
Refresh Epoch 1
1
31.31.31.31 (metric 2) (via default) from 3.3.3.3 (3.3.3.3)
Origin IGP, metric 0, localpref 100, valid, internal, best
Extended Community: RT:31:31
mpls labels in/out nolabel/17
rx pathid: 0, tx pathid: 0x0
Updated on Dec 12 2021 03:39:37 UTC