Advertising IPv4 NLRI with IPv6 Next-Hop
This chapter describes Advertising IPv4 NLRI with IPv6 Next-Hop.
Topics in this chapter include:
Applicability
The information and configuration in this chapter are based on SR OS Release 26.3.R2. Advertising IPv4 Network Layer Reachability Information (NLRI) with IPv6 next-hop is supported in SR OS Release 19.5.R1 and later.
Overview
In networks where the routers are interconnected by IPv6-only links, SR OS routers can advertise and receive BGP routes that convey reachability to IPv4-unicast destinations that are reachable through IPv6 next-hops. Advertising and receiving IPv4 routes with IPv6 next-hops is useful in networks or regions with IPv6-only interfaces, such as data center deployments where leaf, spine, and aggregation routers are interconnected by IPv6-only links that carry a mix of unencapsulated IPv4 and IPv6 packets.
This feature requires the Extended Next Hop encoding BGP capability which is described in RFC 8950, Advertising IPv4 Network Layer Reachability Information with an IPv6 Next Hop. BGP capabilities are advertised between peers. For the Extended Next Hop encoding capability, the capability code field must be set to 5, the capability length field set to the length of the capability value field, and a capability value field with the format shown in Capability value field format:
Each triplet (NLRI AFI, NLRI SAFI, Nexthop AFI) indicates that NLRI AFI/SAFI may be advertised with a next-hop address belonging to the network-layer protocol of "Nexthop AFI".
By default, IPv4-unicast routes are advertised with IPv4 next-hops. However, on IPv6-only TCP transport sessions, IPv4-unicast routes can be advertised with IPv6 next-hops if the advertise-ipv6-next-hops command with the ipv4 option applies to the session. The advertise-ipv6-next-hops command can be enabled for several address families, as follows:
*A:PE-1>config>router>bgp# advertise-ipv6-next-hops
- advertise-ipv6-next-hops [vpn-ipv6] [label-ipv6] [evpn] [vpn-ipv4] [label-ipv4] [ipv4]
- no advertise-ipv6-next-hops
<vpn-ipv6> : keyword - provision support of the specific family
<label-ipv6> : keyword - provision support of the specific family
<evpn> : keyword - provision support of the specific family
<vpn-ipv4> : keyword - provision support of the specific family
<label-ipv4> : keyword - provision support of the specific family
<ipv4> : keyword - provision support of the specific family
For receiving IPv4-unicast routes with IPv6 next-hop addresses, the extended-nh-encoding command with the ipv4 option must be applied to the session. This advertises the RFC 8950 capability to the peer for the different address families. The extended-nh-encoding command can be configured for several address families, as follows:
*A:PE-1>config>router>bgp# extended-nh-encoding
- extended-nh-encoding [label-ipv4] [vpn-ipv4] [ipv4]
- no extended-nh-encoding
<label-ipv4> : keyword - provision support of the specific family
<vpn-ipv4> : keyword - provision support of the specific family
<ipv4> : keyword - provision support of the specific family
When the BGP session is established, the BGP peers advertise the capability to each other, and the Extended Next Hop encoding capability is both a local and a remote capability, as in the following example between BGP peers 2001:db8::12:1 and 2001:db8::12:2:
*A:PE-1# show router bgp neighbor 2001:db8::12:2 | match "Capability"
Local Capability : RtRefresh MPBGP 4byte ASN ExtNhEncoding
Remote Capability : RtRefresh MPBGP 4byte ASN ExtNhEncoding
When next-hop-self applies to the BGP session and the neighbor address is IPv6, an IPv4-unicast route that is advertised or re-advertised gets the following as next-hop:
The IPv6 local address used for peering, if the peer opened the BGP session by advertising an extended next-hop encoding capability with NLRI AFI=1, SAFI=1, and nexthop AFI=2, and the session is associated with an advertise-ipv6-next-hops ipv4 command.
The IPv4 system interface address in all other cases.
Configuration
Example topology with IPv6 interfaces shows the example topology with three nodes with IPv6-only interfaces in different Autonomous Systems (ASs).
The initial configuration includes:
Cards, MDAs, ports
Router interfaces with IPv6 addresses
In the example, IPv4, label-IPv4, and VPN-IPv4 routes are advertised with an IPv6 next-hop. On PE-1, loopback interfaces lo1 (10.1.0.1/32) and lo2 (10.131.0.1/32) are configured; lo1 is advertised as an IPv4 route and lo2 as a label-IPv4 route. VPRN 1 is configured on all nodes with loopback interface lo3, and prefix 172.31.0.1/32 is advertised as a VPN-IPv4 route on PE-1. PE-2 and PE-3 have similar loopback interfaces. Loopback addresses and advertised IPv4, label-IPv4, and VPN-IPv4 routes shows the loopback addresses and the advertised routes.
On PE-2, the interface configuration is as follows:
# on PE-2:
configure
router "Base"
interface "int-PE-2-PE-1"
port 1/1/c2/1
ipv6
address 2001:db8::12:2/126
exit
no shutdown
exit
interface "int-PE-2-PE-3_0"
port 1/1/c1/1
ipv6
address 2001:db8::23:1/126
exit
no shutdown
exit
interface "int-PE-2-PE-3_4"
port 1/1/c3/1
ipv6
address 2001:db8::23:5/126
exit
no shutdown
exit
interface "lo1"
loopback
address 10.2.0.1/32
ipv6
address 2001:db8::10:2:0:1/128
exit
no shutdown
exit
interface "lo2"
loopback
address 10.132.0.1/32
ipv6
address 2001:db8::10:132:0:1/128
exit
no shutdown
exit
interface "system"
address 192.0.2.2/32
ipv6
address 2001:db8::2:2/128
exit
no shutdown
exitThe interface configuration on PE-1 and on PE-3 is similar.# on PE-2:
configure
service
vprn 1 name "VPRN-1" customer 1 create
ecmp 2
interface "lo3" create
loopback
address 172.31.0.2/32
ipv6
address 2001:db8::172:31:0:2/128
exit
exit
bgp-ipvpn
mpls
auto-bind-tunnel
resolution-filter
exit
resolution filter
exit
route-distinguisher 64502:1
vrf-target target:1:1
no shutdown
exit
exit
no shutdownThe VPRN configuration on PE-1 and on PE-3 is similar.
On PE-2, eBGP is configured toward three IPv6 neighbors with next-hop-self enabled. For each of the BGP neighbors, extended-nh-encoding and advertise-ipv6-next-hops are configured for different address families. The BGP configuration is as follows:
# on PE-2:
configure
router "Base"
autonomous-system 64502
ecmp 2
bgp
loop-detect discard-route
enable-inter-as-vpn # inter-AS VPN model B
split-horizon
multi-path
maximum-paths 2 ebgp 2
exit
group "eBGP-IPv6"
family ipv4 vpn-ipv4 ipv6 vpn-ipv6 label-ipv4 label-ipv6
local-as 64502
import "p_import-1:1-3:3"
export "p_export-10.2" "p_export-10.132"
neighbor 2001:db8::12:1
next-hop-self
peer-as 64501
extended-nh-encoding ipv4 vpn-ipv4 label-ipv4
advertise-ipv6-next-hops ipv4 vpn-ipv4 vpn-ipv6 label-ipv4 label-ipv6
exit
neighbor 2001:db8::23:2
next-hop-self
peer-as 64503
extended-nh-encoding ipv4 vpn-ipv4 label-ipv4
advertise-ipv6-next-hops ipv4 vpn-ipv4 vpn-ipv6 label-ipv4 label-ipv6
exit
neighbor 2001:db8::23:6
next-hop-self
peer-as 64503
extended-nh-encoding ipv4 vpn-ipv4 label-ipv4
advertise-ipv6-next-hops ipv4 vpn-ipv4 vpn-ipv6 label-ipv4 label-ipv6
exit
no shutdown
exit
no shutdown
exit
The BGP configuration on PE-1 and on PE-3 is similar.
# on PE-2:
configure
router "Base"
policy-options
begin
community "c_1:1"
members "1:1"
exit
community "c_2:2"
members "2:2"
exit
community "c_3:3"
members "3:3"
exit
prefix-list "pl_10.2.0.0/16"
prefix 10.2.0.0/16 longer
exit
prefix-list "pl_10.132.0.0/16"
prefix 10.132.0.0/16 longer
exit
prefix-list "pl_2001:db8::10:2:0:0/96"
prefix 2001:db8::10:2:0:0/96 longer
exit
prefix-list "pl_2001:db8::10:132:0:0/96"
prefix 2001:db8::10:132:0:0/96 longer
exit
policy-statement "p_export-10.2"
entry 10
from
prefix-list "pl_10.2.0.0/16"
exit
to
protocol bgp
exit
action accept
community add "c_2:2"
exit
exit
entry 20
from
prefix-list "pl_2001:db8::10:2:0:0/96"
exit
to
protocol bgp
exit
action accept
community add "c_2:2"
exit
exit
exit
policy-statement "p_export-10.132"
entry 10
from
prefix-list "pl_10.132.0.0/16"
exit
to
protocol bgp-label
exit
action accept
community add "c_2:2"
exit
exit
entry 20
from
prefix-list "pl_2001:db8::10:132:0:0/96"
exit
to
protocol bgp-label
exit
action accept
community add "c_2:2"
exit
exit
exit
policy-statement "p_import-1:1-3:3"
entry 10
from
community "c_1:1"
exit
action accept
exit
exit
entry 20
from
community "c_3:3"
exit
action accept
exit
exit
exit
commitThe policies on PE-1 and on PE-3 are similar.
The BGP summary on PE-1 shows that for each of the configured address families, one route is advertised and two routes are received and accepted:
*A:PE-1# show router bgp summary all
===============================================================================
BGP Summary
===============================================================================
Legend : D - Dynamic Neighbor
===============================================================================
Neighbor
Description
ServiceId AS PktRcvd InQ Up/Down State|Rcv/Act/Sent (Addr Family)
PktSent OutQ
-------------------------------------------------------------------------------
2001:db8::12:2
Def. Inst 64502 139 0 00h59m24s 2/2/1 (IPv4)
133 0 2/2/1 (IPv6)
2/2/1 (VpnIPv4)
2/2/1 (VpnIPv6)
2/2/1 (Lbl-IPv4)
2/2/1 (Lbl-IPv6)
On PE-1, the following IPv4 routes with IPv6 next-hop are received and used: route 10.2.0.1/32 originates from PE-2 and route 10.3.0.1/32 from PE-3. Both routes have next-hop 2001:db8::12:2 because next-hop-self is enabled, as follows:
*A:PE-1# show router bgp routes
===============================================================================
BGP Router ID:192.0.2.1 AS:64501 Local AS:64501
===============================================================================
Legend -
Status codes : u - used, s - suppressed, h - history, d - decayed, * - valid
l - leaked, x - stale, > - best, b - backup, p - purge,
w - unused-weight-only
Origin codes : i - IGP, e - EGP, ? - incomplete
===============================================================================
BGP IPv4 Routes
===============================================================================
Flag Network LocalPref MED
Nexthop (Router) Path-Id IGP Cost
As-Path Label
-------------------------------------------------------------------------------
u*>i 10.2.0.1/32 None None
2001:db8::12:2 None 0
64502 -
u*>i 10.3.0.1/32 None None
2001:db8::12:2 None 0
64502 64503 -
-------------------------------------------------------------------------------
Routes : 2
===============================================================================
On PE-2, the following VPN-IPv4 routes with different IPv6 next-hops are received and used:
*A:PE-2# show router bgp routes vpn-ipv4
===============================================================================
BGP Router ID:192.0.2.2 AS:64502 Local AS:64502
===============================================================================
Legend -
Status codes : u - used, s - suppressed, h - history, d - decayed, * - valid
l - leaked, x - stale, > - best, b - backup, p - purge,
w - unused-weight-only
Origin codes : i - IGP, e - EGP, ? - incomplete
===============================================================================
BGP VPN-IPv4 Routes
===============================================================================
Flag Network LocalPref MED
Nexthop (Router) Path-Id IGP Cost
As-Path Label
-------------------------------------------------------------------------------
u*>i 64501:1:172.31.0.1/32 None None
2001:db8::12:1 None 0
64501 524287
u*>i 64503:1:172.31.0.3/32 None None
2001:db8::23:2 None 0
64503 524287
u*>i 64503:1:172.31.0.3/32 None None
2001:db8::23:6 None 0
64503 524287
-------------------------------------------------------------------------------
Routes : 3
===============================================================================
On PE-3, the following label-IPv4 routes with IPv6 next-hop are received and used. Route 10.131.0.1/32 originates from PE-1 and is re-advertised by PE-2 on two eBGP paths, with next-hop addresses 2001:db8::23:1 and 2001:db8::23:5. Route 10.132.0.1/32 originates from PE-2 and is also advertised over these two eBGP paths.
*A:PE-3# show router bgp routes label-ipv4
===============================================================================
BGP Router ID:192.0.2.3 AS:64503 Local AS:64503
===============================================================================
Legend -
Status codes : u - used, s - suppressed, h - history, d - decayed, * - valid
l - leaked, x - stale, > - best, b - backup, p - purge,
w - unused-weight-only
Origin codes : i - IGP, e - EGP, ? - incomplete
===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag Network LocalPref MED
Nexthop (Router) Path-Id IGP Cost
As-Path Label
-------------------------------------------------------------------------------
u*>i 10.131.0.1/32 None None
2001:db8::23:1 None 0
64502 64501 524283
u*>i 10.131.0.1/32 None None
2001:db8::23:5 None 0
64502 64501 524283
u*>i 10.132.0.1/32 None None
2001:db8::23:1 None 0
64502 524286
u*>i 10.132.0.1/32 None None
2001:db8::23:5 None 0
64502 524286
-------------------------------------------------------------------------------
Routes : 4
===============================================================================
The route table on PE-3 includes BGP IPv4 and label-IPv4 routes with IPv6 next-hops, as follows:
*A:PE-3# show router route-table
===============================================================================
Route Table (Router: Base)
===============================================================================
Dest Prefix[Flags] Type Proto Age Pref
Next Hop[Interface Name] Metric
-------------------------------------------------------------------------------
10.1.0.1/32 Remote BGP 01h06m28s 170
2001:db8::23:1 0
10.1.0.1/32 Remote BGP 01h06m28s 170
2001:db8::23:5 0
10.2.0.1/32 Remote BGP 01h06m59s 170
2001:db8::23:1 0
10.2.0.1/32 Remote BGP 01h06m59s 170
2001:db8::23:5 0
10.3.0.1/32 Local Local 01h07m42s 0
lo1 0
10.131.0.1/32 Remote BGP_LABEL 01h06m28s 170
2001:db8::23:1 0
10.131.0.1/32 Remote BGP_LABEL 01h06m28s 170
2001:db8::23:5 0
10.132.0.1/32 Remote BGP_LABEL 01h06m59s 170
2001:db8::23:1 0
10.132.0.1/32 Remote BGP_LABEL 01h06m59s 170
2001:db8::23:5 0
10.133.0.1/32 Local Local 01h07m42s 0
lo2 0
192.0.2.3/32 Local Local 01h07m42s 0
system 0
-------------------------------------------------------------------------------
No. of Routes: 11
---snip---
===============================================================================
The tunnel table on PE-3 shows four BGP tunnels with IPv6 next-hops, as follows:
*A:PE-3# show router tunnel-table
===============================================================================
IPv4 Tunnel Table (Router: Base)
===============================================================================
Destination Owner Encap TunnelId Pref Nexthop Metric
Color
-------------------------------------------------------------------------------
10.131.0.1/32 bgp MPLS 262146 12 2001:db8::23:1 1000
10.131.0.1/32 bgp MPLS 262146 12 2001:db8::23:5 1000
10.132.0.1/32 bgp MPLS 262145 12 2001:db8::23:1 1000
10.132.0.1/32 bgp MPLS 262145 12 2001:db8::23:5 1000
-------------------------------------------------------------------------------
---snip---
===============================================================================
The route table for VPRN 1 on PE-3 includes BGP VPN-IPv4 routes with IPv6 next-hops, as follows:
*A:PE-3# show router 1 route-table
===============================================================================
Route Table (Service: 1)
===============================================================================
Dest Prefix[Flags] Type Proto Age Pref
Next Hop[Interface Name] Metric
-------------------------------------------------------------------------------
172.31.0.1/32 Remote BGP VPN 01h08m40s 170
2001:db8::23:1 0
172.31.0.1/32 Remote BGP VPN 01h08m40s 170
2001:db8::23:5 0
172.31.0.2/32 Remote BGP VPN 01h09m11s 170
2001:db8::23:1 0
172.31.0.2/32 Remote BGP VPN 01h09m11s 170
2001:db8::23:5 0
172.31.0.3/32 Local Local 01h09m54s 0
lo3 0
-------------------------------------------------------------------------------
No. of Routes: 5
---snip---
===============================================================================
The reachability between source address 172.31.0.3 and destination 172.31.0.1 can be verified, but the following traceroute does not display any address for the intermediate node:
*A:PE-3# traceroute 172.31.0.1 no-dns router-instance "VPRN-1" source 172.31.0.3
traceroute to 172.31.0.1 from 172.31.0.3, 30 hops max, 40 byte packets
1 0.0.0.0 * * *
2 172.31.0.1 2.12 ms 1.65 ms 1.66 ms
However, the following traceroute from lo1 on PE-3 to lo1 on PE-1 fails:
*A:PE-3# traceroute 10.1.0.1 no-dns router-instance "Base" source 10.3.0.1
traceroute to 10.1.0.1 from 10.3.0.1, 30 hops max, 40 byte packets
1 0.0.0.0 * * *
2 0.0.0.0 * * *
3 0.0.0.0 * * *
4 0.0.0.0 * * *
5 0.0.0.0 * * *
6 0.0.0.0 * ^C
traceroute aborted by user
In an IPv6-only network, the IPv4 interfaces are down, as follows:
*A:PE-2# show router interface
===============================================================================
Interface Table (Router: Base)
===============================================================================
Interface-Name Adm Opr(v4/v6) Mode Port/SapId
IP-Address PfxState
-------------------------------------------------------------------------------
int-PE-2-PE-1 Up Down/Up Network 1/1/c2/1
2001:db8::12:2/126 PREFERRED
fe80::60b:1ff:fe01:b/64 PREFERRED
int-PE-2-PE-3_0 Up Down/Up Network 1/1/c1/1
2001:db8::23:1/126 PREFERRED
fe80::60b:1ff:fe01:1/64 PREFERRED
int-PE-2-PE-3_4 Up Down/Up Network 1/1/c3/1
2001:db8::23:5/126 PREFERRED
fe80::60b:1ff:fe01:15/64 PREFERRED
lo1 Up Up/Up Network loopback
10.2.0.1/32 n/a
2001:db8::10:2:0:1/128 PREFERRED
fe80::202:feff:fe00:0/64 PREFERRED
lo2 Up Up/Up Network loopback
10.132.0.1/32 n/a
2001:db8::10:132:0:1/128 PREFERRED
fe80::202:feff:fe00:0/64 PREFERRED
system Up Up/Up Network system
192.0.2.2/32 n/a
2001:db8::2:2/128 PREFERRED
-------------------------------------------------------------------------------
Interfaces : 6
===============================================================================
To allow CPM-originated or terminated packets, such as IPv4 ping or traceroute traffic, the forward-ipv4-packets command is configured in the ipv6 context of these interfaces, as follows:
# on PE-2:
configure
router "Base"
interface "int-PE-2-PE-1"
ipv6
forward-ipv4-packets
exit
exit
interface "int-PE-2-PE-3_0"
ipv6
forward-ipv4-packets
exit
exit
interface "int-PE-2-PE-3_4"
ipv6
forward-ipv4-packets
exit
exit
The configuration on PE-1 and on PE-3 is similar.
The connectivity between the lo1 and lo2 interfaces can now be verified from PE-3, as follows:
*A:PE-3# traceroute 10.1.0.1 no-dns router-instance "Base" source 10.3.0.1
traceroute to 10.1.0.1 from 10.3.0.1, 30 hops max, 40 byte packets
1 10.2.0.1 0.992 ms 1.06 ms 1.02 ms
2 10.1.0.1 1.94 ms 1.74 ms 1.71 ms
*A:PE-3# traceroute 10.2.0.1 no-dns router-instance "Base" source 10.3.0.1
traceroute to 10.2.0.1 from 10.3.0.1, 30 hops max, 40 byte packets
1 10.2.0.1 1.29 ms 2.65 ms 1.05 ms
*A:PE-3# traceroute 10.131.0.1 no-dns router-instance "Base" source 10.133.0.1
traceroute to 10.131.0.1 from 10.133.0.1, 30 hops max, 40 byte packets
1 10.2.0.1 1.07 ms 0.986 ms 0.968 ms
2 10.131.0.1 1.88 ms 1.69 ms 1.67 ms
*A:PE-3# traceroute 10.132.0.1 no-dns router-instance "Base" source 10.133.0.1
traceroute to 10.132.0.1 from 10.133.0.1, 30 hops max, 40 byte packets
1 10.132.0.1 1.05 ms 1.01 ms 1.02 ms
With the forward-ipv4-packets command, the IOM is instructed by the CPM to consider the IPv4 operational state of the interface as up when the IPv6 interface is operationally up. IPv4 packets can be sent and received on the interface when the IPv6 interface is up, even when the IPv4 interface is operationally down.
Conclusion
SR OS routers can advertise and receive BGP routes for IPv4 destinations with IPv6 next-hops. This feature requires the Extended Next Hop encoding BGP capability in RFC 8950 and is useful in IPv6-only networks or regions.