Nexthop-Self

This scenario demonstrates how to configure nexthop-self for IPv6 BGP neighbors. The nexthop-self command sets the router’s own address as the next-hop for routes advertised to this neighbor. This is commonly used in iBGP to ensure routes learned from eBGP have a reachable next-hop within the iBGP domain.

../../../../../../_images/nexthop-self.svg

Test iBGP IPv6 - Without nexthop-self reflected route has unreachable next-hop

Description

Test that without nexthop-self, routes advertised to iBGP peer DUT1 keep the original next-hop (DUT2: 2001:db8:2::200). Since DUT1 has no route to 2001:db8:2::/64, the next-hop is inaccessible and the route is not usable.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '2001:db8:1::100/64'
set interfaces ethernet eth1 address '2001:db8:2::100/64'
set protocols bgp 100 neighbor dut1 address-family ipv6-unicast activate
set protocols bgp 100 neighbor dut1 remote-address '2001:db8:1::1'
set protocols bgp 100 neighbor dut1 remote-as 100
set protocols bgp 100 neighbor dut2 address-family ipv6-unicast activate
set protocols bgp 100 neighbor dut2 address-family ipv6-unicast route-map import PERMIT
set protocols bgp 100 neighbor dut2 remote-address '2001:db8:2::200'
set protocols bgp 100 neighbor dut2 remote-as 200
set protocols bgp 100 parameters router-id 1.1.1.100
set protocols route-map PERMIT rule 1 action permit
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address '2001:db8:1::1/64'
set protocols bgp 100 neighbor peer address-family ipv6-unicast activate
set protocols bgp 100 neighbor peer remote-address '2001:db8:1::100'
set protocols bgp 100 neighbor peer remote-as 100
set protocols bgp 100 parameters router-id 1.1.1.1
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Set the following configuration in DUT2 :

set interfaces dummy dum0 address '2001:db8:10::1/64'
set interfaces ethernet eth1 address '2001:db8:2::200/64'
set protocols bgp 200 address-family ipv6-unicast redistribute connected
set protocols bgp 200 neighbor peer address-family ipv6-unicast activate
set protocols bgp 200 neighbor peer address-family ipv6-unicast route-map export PERMIT
set protocols bgp 200 neighbor peer remote-address '2001:db8:2::100'
set protocols bgp 200 neighbor peer remote-as 100
set protocols bgp 200 parameters router-id 1.1.1.200
set protocols route-map PERMIT rule 1 action permit
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify eBGP and iBGP sessions establish on DUT0.

Step 4: Run command protocols bgp show ipv6 summary at DUT0 and check if output matches the following regular expressions:

2001:db8:1::1.*Established.*\n.*2001:db8:2::200.*Established
Show output
IPv6 Unicast Summary:
BGP router identifier 1.1.1.100, local AS number 100 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 2, using 47 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
2001:db8:1::1   0.0.0.0         4        100         4         4        0    0    0 00:00:02  Established        0        0 FRRouting/10.4.1
2001:db8:2::200 0.0.0.0         4        200         2         2        0    0    0 00:00:00  Established        0 (Policy) N/A

Total number of neighbors 2

Note

DUT1 receives the route but next-hop 2001:db8:2::200 is inaccessible (not installed in RIB).

Step 5: Run command protocols bgp show ipv6 2001:db8:10::/64 at DUT1 and check if output matches the following regular expressions:

2001:db8:2::200 \(inaccessible
Show output
BGP routing table entry for 2001:db8:10::/64, version 0
Paths: (1 available, no best path)
  Not advertised to any peer
  200
    2001:db8:2::200 (inaccessible, import-check enabled) from 2001:db8:1::100 (1.1.1.100)
      Origin incomplete, metric 0, localpref 100, invalid, internal
      Last update: Thu Mar  5 14:44:34 2026

Test iBGP IPv6 - With nexthop-self

Description

Test to verify that with nexthop-self, the next-hop is changed to DUT0’s address. DUT0 receives route from eBGP peer DUT2 and advertises to iBGP peer DUT1. With nexthop-self, DUT1 sees DUT0’s address as the next-hop.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '2001:db8:1::100/64'
set interfaces ethernet eth1 address '2001:db8:2::100/64'
set protocols bgp 100 neighbor dut1 address-family ipv6-unicast activate
set protocols bgp 100 neighbor dut1 address-family ipv6-unicast nexthop-self
set protocols bgp 100 neighbor dut1 remote-address '2001:db8:1::1'
set protocols bgp 100 neighbor dut1 remote-as 100
set protocols bgp 100 neighbor dut2 address-family ipv6-unicast activate
set protocols bgp 100 neighbor dut2 address-family ipv6-unicast route-map import PERMIT
set protocols bgp 100 neighbor dut2 remote-address '2001:db8:2::200'
set protocols bgp 100 neighbor dut2 remote-as 200
set protocols bgp 100 parameters router-id 1.1.1.100
set protocols route-map PERMIT rule 1 action permit
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address '2001:db8:1::1/64'
set protocols bgp 100 neighbor peer address-family ipv6-unicast activate
set protocols bgp 100 neighbor peer remote-address '2001:db8:1::100'
set protocols bgp 100 neighbor peer remote-as 100
set protocols bgp 100 parameters router-id 1.1.1.1
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Set the following configuration in DUT2 :

set interfaces dummy dum0 address '2001:db8:10::1/64'
set interfaces ethernet eth1 address '2001:db8:2::200/64'
set protocols bgp 200 address-family ipv6-unicast redistribute connected
set protocols bgp 200 neighbor peer address-family ipv6-unicast activate
set protocols bgp 200 neighbor peer address-family ipv6-unicast route-map export PERMIT
set protocols bgp 200 neighbor peer remote-address '2001:db8:2::100'
set protocols bgp 200 neighbor peer remote-as 100
set protocols bgp 200 parameters router-id 1.1.1.200
set protocols route-map PERMIT rule 1 action permit
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify eBGP and iBGP sessions establish on DUT0.

Step 4: Run command protocols bgp show ipv6 summary at DUT0 and check if output matches the following regular expressions:

2001:db8:1::1.*Established.*\n.*2001:db8:2::200.*Established
Show output
IPv6 Unicast Summary:
BGP router identifier 1.1.1.100, local AS number 100 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 2, using 47 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
2001:db8:1::1   0.0.0.0         4        100         4         4        0    0    0 00:00:04  Established        0        0 FRRouting/10.4.1
2001:db8:2::200 0.0.0.0         4        200         2         2        0    0    0 00:00:01  Established        0 (Policy) N/A

Total number of neighbors 2

Attention

Verify DUT1 receives route 2001:db8:10::/64 with next-hop as DUT0’s address.

Step 5: Run command protocols bgp show ipv6 2001:db8:10::/64 at DUT1 and check if output contains the following tokens:

2001:db8:1::100 from 2001:db8:1::100 (1.1.1.100)
Show output
BGP routing table entry for 2001:db8:10::/64, version 2
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  200
    2001:db8:1::100 from 2001:db8:1::100 (1.1.1.100)
      Origin incomplete, metric 0, localpref 100, valid, internal, best (First path received)
      Last update: Thu Mar  5 14:44:51 2026