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 MD-CLI configuration in this chapter are based on SR OS Release 20.7.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 5549, 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 following 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:
[ex:configure router "Base" bgp]
A:admin@PE-1# advertise-ipv6-next-hops
advertise-ipv6-next-hops
evpn - Advertise EVPN routes with IPv6 addresses
ipv4 - Advertise IPv4 routes with IPv6 addresses
label-ipv4 - Advertise label IPv4 routes with IPv6 addresses
label-ipv6 - Advertise label IPv6 routes with IPv6 addresses
vpn-ipv4 - Advertise VPN IPv4 routes with IPv6 addresses
vpn-ipv6 - Advertise VPN IPv6 routes with IPv6 addresses
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 5549 capability to the peer for the different address families. The extended-nh-encoding command can be configured for several address families, as follows:
[ex:configure router "Base" bgp]
A:admin@PE-1# extended-nh-encoding
extended-nh-encoding
ipv4 - Advertise extended NH encoding for IPv4 routes
label-ipv4 - Advertise extended NH encoding for label-IPv4 routes
vpn-ipv4 - Advertise extended NH encoding for VPN-IPv4 routes
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:admin@PE-1# show router bgp neighbor 2001:db8::12:2 | match Capability post-lines 1
Local Capability : RtRefresh MPBGP 4byte ASN
: EXT_NH_ENCODING
Remote Capability : RtRefresh MPBGP 4byte ASN
: EXT_NH_ENCODING
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 will be 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 will be 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 will be 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, 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" {
bgp {
loop-detect discard-route
inter-as-vpn true
split-horizon true
ebgp-default-reject-policy {
import false
export false
}
multipath {
max-paths 2
ebgp 2
}
group "eBGP-IPv6" {
family {
ipv4 true
vpn-ipv4 true
ipv6 true
vpn-ipv6 true
label-ipv4 true
label-ipv6 true
}
local-as {
as-number 64502
}
import {
policy ["import-1:1-3:3"]
}
export {
policy ["export-10.2" "export-10.132"]
}
}
neighbor "2001:db8::12:1" {
group "eBGP-IPv6"
next-hop-self true
peer-as 64501
extended-nh-encoding {
vpn-ipv4 true
label-ipv4 true
ipv4 true
}
advertise-ipv6-next-hops {
vpn-ipv6 true
label-ipv6 true
vpn-ipv4 true
label-ipv4 true
ipv4 true
}
}
neighbor "2001:db8::23:2" {
group "eBGP-IPv6"
next-hop-self true
peer-as 64503
extended-nh-encoding {
vpn-ipv4 true
label-ipv4 true
ipv4 true
}
advertise-ipv6-next-hops {
vpn-ipv6 true
label-ipv6 true
vpn-ipv4 true
label-ipv4 true
ipv4 true
}
}
neighbor "2001:db8::23:6" {
group "eBGP-IPv6"
next-hop-self true
peer-as 64503
extended-nh-encoding {
vpn-ipv4 true
label-ipv4 true
ipv4 true
}
advertise-ipv6-next-hops {
vpn-ipv6 true
label-ipv6 true
vpn-ipv4 true
label-ipv4 true
ipv4 true
}
}
The BGP configuration on PE-1 and PE-3 is 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:admin@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. Instance 64502 22 0 00h02m38s 2/2/1 (IPv4)
16 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:admin@PE-1# show router bgp routes
===============================================================================
BGP Router ID:255.0.0.0 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
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:admin@PE-2# show router bgp routes vpn-ipv4
===============================================================================
BGP Router ID:255.0.0.0 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
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:admin@PE-3# show router bgp routes label-ipv4
===============================================================================
BGP Router ID:255.0.0.0 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
Origin codes : i - IGP, e - EGP, ? - incomplete
===============================================================================
BGP 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 524284
u*>i 10.131.0.1/32 None None
2001:db8::23:5 None 0
64502 64501 524284
u*>i 10.132.0.1/32 None None
2001:db8::23:1 None 0
64502 524285
u*>i 10.132.0.1/32 None None
2001:db8::23:5 None 0
64502 524285
-------------------------------------------------------------------------------
Routes : 4
===============================================================================
The route table on PE-3 includes BGP IPv4 and label-IPv4 routes with IPv6 next-hops, as follows:
[]
A:admin@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 00h03m36s 170
2001:db8::23:1 0
10.1.0.1/32 Remote BGP 00h03m36s 170
2001:db8::23:5 0
10.2.0.1/32 Remote BGP 00h03m36s 170
2001:db8::23:1 0
10.2.0.1/32 Remote BGP 00h03m36s 170
2001:db8::23:5 0
10.3.0.1/32 Local Local 00h04m20s 0
lo1 0
10.131.0.1/32 Remote BGP_LABEL 00h03m36s 170
2001:db8::23:1 0
10.131.0.1/32 Remote BGP_LABEL 00h03m36s 170
2001:db8::23:5 0
10.132.0.1/32 Remote BGP_LABEL 00h03m36s 170
2001:db8::23:1 0
10.132.0.1/32 Remote BGP_LABEL 00h03m36s 170
2001:db8::23:5 0
10.133.0.1/32 Local Local 00h04m20s 0
lo2 0
192.0.2.3/32 Local Local 00h04m20s 0
system 0
-------------------------------------------------------------------------------
No. of Routes: 11
The tunnel table on PE-3 shows four BGP tunnels with IPv6 next-hops, as follows:
[]
A:admin@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
-------------------------------------------------------------------------------
Flags: B = BGP or MPLS backup hop available
L = Loop-Free Alternate (LFA) hop available
E = Inactive best-external BGP route
k = RIB-API or Forwarding Policy backup hop
===============================================================================
The route table for VPRN 1 on PE-3 includes BGP VPN-IPv4 routes with IPv6 next-hops, as follows:
[]
A:admin@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 00h03m36s 170
2001:db8::23:1 0
172.31.0.1/32 Remote BGP VPN 00h03m36s 170
2001:db8::23:5 0
172.31.0.2/32 Remote BGP VPN 00h03m36s 170
2001:db8::23:1 0
172.31.0.2/32 Remote BGP VPN 00h03m36s 170
2001:db8::23:5 0
172.31.0.3/32 Local Local 00h04m20s 0
lo3 0
-------------------------------------------------------------------------------
No. of Routes: 5
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:admin@PE-3# traceroute 172.31.0.1 router-instance "VPRN 1"
source-address 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 (172.31.0.1) 3.68 ms 3.51 ms 3.78 ms
However, the following traceroute from lo1 on PE-3 to lo1 on PE-1 fails:
[]
A:admin@PE-3# traceroute 10.1.0.1 source-address 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 * * * traceroute aborted by user
Likewise, the traceroute from lo2 on PE-3 to PE-1 will fail (not shown here).
In an IPv6-only network, the IPv4 interfaces are down, as follows:
[]
A:admin@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/2:100
2001:db8::12:2/126 PREFERRED
fe80::14:1ff:fe01:2/64 PREFERRED
int-PE-2-PE-3_0 Up Down/Up Network 1/1/1:100
2001:db8::23:1/126 PREFERRED
fe80::14:1ff:fe01:1/64 PREFERRED
int-PE-2-PE-3_4 Up Down/Up Network 1/1/3:100
2001:db8::23:5/126 PREFERRED
fe80::14:1ff:fe01:3/64 PREFERRED
lo1 Up Up/Up Network loopback
10.2.0.1/32 n/a
2001:db8::10:2:0:1/128 PREFERRED
fe80::13:ffff: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::13:ffff: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" {
port 1/1/2:100
ipv6 {
forward-ipv4-packets true
address 2001:db8::12:2 {
prefix-length 126
}
}
}
interface "int-PE-2-PE-3_0" {
port 1/1/1:100
ipv6 {
forward-ipv4-packets true
address 2001:db8::23:1 {
prefix-length 126
}
}
}
interface "int-PE-2-PE-3_4" {
port 1/1/3:100
ipv6 {
forward-ipv4-packets true
address 2001:db8::23:5 {
prefix-length 126
}
}
}
The connectivity between the lo1 and lo2 interfaces can now be verified from PE-3, as follows:
[]
A:admin@PE-3# traceroute 10.1.0.1 source-address 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 (10.2.0.1) 2.02 ms 2.65 ms 2.55 ms
2 10.1.0.1 (10.1.0.1) 3.85 ms 3.69 ms 3.73 ms
[]
A:admin@PE-3# traceroute 10.2.0.1 source-address 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 (10.2.0.1) 2.39 ms 2.70 ms 2.94 ms
[]
A:admin@PE-3# traceroute 10.131.0.1 source-address 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 (10.2.0.1) 2.38 ms 2.91 ms 2.54 ms
2 10.131.0.1 (10.131.0.1) 3.74 ms 3.58 ms 5.38 ms
[]
A:admin@PE-3# traceroute 10.132.0.1 source-address 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 (10.132.0.1) 2.43 ms 2.89 ms 2.92 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 5549 and is useful in IPv6-only networks or regions.