IPv6 · Topic 3 of 3
BGP for IPv6 and IPv6 over IPv4 Tunneling
Learn IPv6 BGP for the JN0-364: family inet6 unicast, IPv6 peers and next hops, IPv4-mapped next hops, GRE tunnels carrying IPv6 and 6PE over an MPLS core.
- 6 min
- IPv6 routes use
family inet6 unicast; 6PE usesfamily inet6 labeled-unicast. - Configuring any family limits the session to the listed families.
- IPv6 over an IPv4 session gives an IPv4-mapped next hop (
::ffff:) that must resolve.
What it is
BGP carries IPv6 routes through multiprotocol BGP: the IPv6 prefixes travel in their own address family, inet6 unicast in Junos. The BGP session itself can run over IPv6 or IPv4 addresses, but the protocol next hop of each IPv6 route must be an address the router can resolve.
IPv6 over IPv4 tunneling carries IPv6 packets across a part of the network that only routes IPv4. On an MX router the two common methods are a GRE tunnel with family inet6 on the gr- interface, and 6PE, which uses the existing IPv4 MPLS core.
How it works
IPv6 BGP peering
The simplest design is native: IPv6 routes over a session between IPv6 addresses.
user@R1# set protocols bgp group EBGP-V6 type external
user@R1# set protocols bgp group EBGP-V6 peer-as 65002
user@R1# set protocols bgp group EBGP-V6 family inet6 unicast
user@R1# set protocols bgp group EBGP-V6 neighbor 2001:db8:12::2
For IBGP, peer between IPv6 loopbacks, set local-address to your own IPv6 loopback and make sure the IGP (OSPFv3 or IS-IS) reaches every loopback. As with IPv4, IBGP does not change the next hop by default, so an export policy with then next-hop self is often needed for EBGP-learned IPv6 routes.
user@R1# set protocols bgp group IBGP-V6 type internal
user@R1# set protocols bgp group IBGP-V6 local-address 2001:db8:ffff::1
user@R1# set protocols bgp group IBGP-V6 family inet6 unicast
user@R1# set protocols bgp group IBGP-V6 neighbor 2001:db8:ffff::4
Address families change the session
When you configure any family statement for a neighbor, Junos negotiates only the families listed. Adding family inet6 unicast to a group that used to carry IPv4 removes IPv4 unless you also list family inet unicast. Changing families also resets the session.
| Configuration | Families negotiated |
|---|---|
family inet6 unicast only | IPv6 unicast only |
family inet unicast and family inet6 unicast | Both |
family inet6 labeled-unicast | Labeled IPv6, as used by 6PE |
Next hops for IPv6 routes
If IPv6 routes are sent over an IPv4 session, the next hop becomes an IPv4-mapped IPv6 address such as ::ffff:192.168.0.4. A router can only use the route if that next hop resolves in inet6.0 or inet6.3. Without a tunnel or 6PE, it usually does not, and the routes are hidden.
GRE tunnel carrying IPv6
A GRE tunnel uses IPv4 endpoint addresses but can carry IPv6 inside. On an MX, tunnel services must be enabled on a PIC before the gr- interface exists.
user@R1# set chassis fpc 0 pic 0 tunnel-services bandwidth 1g
user@R1# set interfaces gr-0/0/0 unit 0 tunnel source 192.168.0.1
user@R1# set interfaces gr-0/0/0 unit 0 tunnel destination 192.168.0.4
user@R1# set interfaces gr-0/0/0 unit 0 family inet6 address 2001:db8:14::1/64
user@R1# set routing-options rib inet6.0 static route 2001:db8:400::/48 next-hop 2001:db8:14::2
The tunnel destination must be reachable over IPv4 through the physical network. You can also run OSPFv3 or IS-IS across the gr- interface instead of a static route. The Tunnels chapter covers GRE in detail.
6PE over an MPLS core
6PE lets dual-stack PE routers carry IPv6 between them over an IPv4-only MPLS core. The core routers never see IPv6.
- PE routers run IBGP over IPv4 loopbacks and exchange IPv6 routes as
inet6 labeled-unicast, with an inner label for each route. - The next hop is the IPv4-mapped form of the remote PE loopback.
ipv6-tunnelingunderprotocols mplscopies the IPv4 LSP routes from inet.3 into inet6.3 as IPv4-mapped addresses, so the next hop resolves.- Packets cross the core with the LSP label on top of the 6PE label.
user@PE1# set protocols mpls ipv6-tunneling
user@PE1# set protocols bgp group IBGP family inet6 labeled-unicast explicit-null
user@PE1# set interfaces ge-0/0/1 unit 0 family inet6
The explicit-null option advertises label 2, IPv6 explicit null. The core-facing interfaces running MPLS also need family inet6, so the PE can process the IPv6 packets that arrive under that label.
Monitoring and troubleshooting
| Command | Shows |
|---|---|
show bgp summary | Each peer with counters for the inet6.0 table |
show bgp neighbor 2001:db8:12::2 | NLRI families negotiated and session state |
show route receive-protocol bgp 2001:db8:12::2 | IPv6 routes received from that peer |
show route table inet6.0 protocol bgp | Active IPv6 BGP routes |
show route table inet6.0 hidden | Routes with an unusable next hop |
show route table inet6.3 | IPv4-mapped LSP routes created by ipv6-tunneling |
If an IPv6 BGP route appears only as hidden and its next hop starts with ::ffff:, the route was learned over an IPv4 session. Check ipv6-tunneling and inet6.3 first.
Common mistakes
Adding family inet6 unicast and losing IPv4. Once a family is configured, only listed families are negotiated. List family inet unicast too if the session should carry both.
Expecting IPv4-mapped next hops to resolve by themselves. Without 6PE or another way to reach them, routes with ::ffff: next hops stay hidden.
Forgetting tunnel services on an MX. No gr- interface exists until tunnel-services is enabled on a PIC.
Thinking 6PE needs IPv6 in the core. Only the PE routers run IPv6; the core forwards by label.
Changing the families on a BGP group resets the sessions in that group. On a live router, plan the change.
What to remember for the exam
- IPv6 routes use
family inet6 unicast; 6PE usesfamily inet6 labeled-unicast. - Configuring any family limits the session to the listed families.
- IPv6 over an IPv4 session gives an IPv4-mapped next hop (
::ffff:) that must resolve. protocols mpls ipv6-tunnelingcopies LSP routes into inet6.3 for 6PE.- 6PE with
explicit-nulluses label 2 and needsfamily inet6on core-facing interfaces. - A GRE
gr-interface withfamily inet6carries IPv6 between IPv4 endpoints.
Check yourself
IPv6 routes received over an IPv4 IBGP session are hidden with next hop
::ffff:192.168.0.4. What enables them on a 6PE router?set protocols mpls ipv6-tunneling, which puts IPv4-mapped LSP routes into inet6.3 so the next hop resolves.You add
family inet6 unicastto an IPv4 BGP group and IPv4 routes disappear. Why?Junos now negotiates only the listed families, so
family inet unicastmust be added too.Which interface type carries IPv6 across an IPv4-only network without MPLS on an MX?
A GRE
gr-interface with IPv4 tunnel endpoints andfamily inet6.
Topic 3 of 3 in IPv6
Test yourself on IPv6
The full Juniper JNCIS-SP JN0-364 question bank has 860 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.