This is the eighth lab in my JNCIP-ENT series. It continues from the multi-area OSPF and route summarization lab and the stub and NSSA areas lab. The physical topology does not change. I add IPv6 to the same five vMX routers. Then I run OSPFv3 next to the existing OSPFv2 domain.
OSPFv3 is not only OSPFv2 with IPv6 addresses. It is a separate protocol instance. It has its own neighbors, link-state database, and routing table. It also works per link and uses IPv6 link-local addresses for neighbor communication. Authentication is also different. OSPFv2 has authentication inside the protocol. OSPFv3 uses IPsec for authentication.
Reset the Area Types
Lab 7 ended with Area 1 as a totally stubby area and Area 2 as a totally NSSA. These area types suppress some LSAs. This lab needs to show those LSAs, so both areas must return to regular areas first.
Keep the existing area-range 10.1.0.0/16 on R1. Delete the stub and NSSA configuration from the routers in the related areas:
delete protocols ospf area 0.0.0.1 stubdelete protocols ospf area 0.0.0.2 nssaConfirm that the IPv4 OSPF domain is healthy:
show ospf neighborshow ospf routeAll neighbors should be in the Full state. On R3, show ospf route should show Intra, Inter, and Ext2 routes.
IPv6 Addressing on the Existing Topology
The same physical interfaces are used. IPv6 is added on top of the IPv4 design. R5 has one real IPv6 edge network. It stays outside OSPFv3 and is redistributed as an external route.
OSPFv3 Requires IPv6 on the Interface
Every OSPFv3 interface needs family inet6. OSPFv3 sends Hello packets through IPv6 link-local addresses. Without family inet6, the interface does not have a link-local address. It cannot form an OSPFv3 neighbor relationship.
The global IPv6 address is used for routing traffic. The link-local address is used for OSPFv3 neighbor communication.
This is the R1 configuration:
set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:0::1/64set interfaces ge-0/0/1 unit 0 family inet6 address 2001:db8:1::1/64set interfaces lo0 unit 0 family inet6 address 2001:db8:255::1/128set protocols ospf3 area 0.0.0.0 interface ge-0/0/0.0set protocols ospf3 area 0.0.0.0 interface lo0.0 passiveset protocols ospf3 area 0.0.0.1 interface ge-0/0/1.0We will use the same configuration pattern on the other routers. R4 access interfaces must be passive. R5 edge interface has IPv6 addressing, but it does not have an ospf3 statement.
R5 needs a separate IPv6 export policy. It is better to keep IPv4 and IPv6 export policies separate. This makes the configuration easier to read. It also avoids using an IPv4 route filter for an IPv6 route.
set policy-options policy-statement redist-edge-v6 term edge from family inet6set policy-options policy-statement redist-edge-v6 term edge from protocol directset policy-options policy-statement redist-edge-v6 term edge from route-filter 2001:db8:113::/48 orlongerset policy-options policy-statement redist-edge-v6 term edge then metric 50set policy-options policy-statement redist-edge-v6 term edge then external-type 2set policy-options policy-statement redist-edge-v6 term edge then acceptset protocols ospf3 export redist-edge-v6The router IDs from Labs 6 and 7 remain configured. OSPFv3 still uses a 32-bit dotted-decimal router ID. It does not use an IPv6 address as its router ID.
OSPFv2 and OSPFv3 Are Separate
Commit the configuration on all five routers. Then compare the protocol output:
show ospf neighborshow ospf3 neighborshow route table inet6.0 protocol ospf3There should be two neighbor tables. Both can show Full neighbors on the same physical interface. OSPFv2 installs IPv4 routes into inet.0. OSPFv3 installs IPv6 routes into inet6.0.
The two protocols share the physical link and router ID. They do not share neighbor state, LSDB, or routes. If OSPFv3 fails on one interface, OSPFv2 can remain Full. The same is true in the other direction.
Reading the OSPFv3 Database
We can use these commands to examine the OSPFv3 database and routing table:
show ospf3 databaseshow ospf3 routeThe route table still uses Intra and Inter path types. External routes can show Ext1 or Ext2, based on the export policy. In this live lab, the R5 IPv6 external route currently shows Ext1. However, some LSA names and functions are different.
| OSPFv2 | OSPFv3 | Explanation |
|---|---|---|
| Router, Type 1 | Router, 0x2001 | It carries topology information only. It does not carry prefixes. |
| Network, Type 2 | Network, 0x2002 | It carries topology information only. It does not carry prefixes. |
| Summary, Type 3 | InterArPfx, 0x2003 | It advertises inter-area prefixes. |
| ASBR Summary, Type 4 | InterArRtr, 0x2004 | It advertises reachability to an ASBR. |
| External, Type 5 | Extern, 0x4005 | It carries the R5 external IPv6 route. |
| None | Link, 0x0008 | It has link-local flooding scope. It never leaves the link. |
| None | IntraArPfx, 0x2009 | It carries prefixes that are removed from Router and Network LSAs. |
The OSPFv3 does not put prefixes inside router and network LSAs. It stores prefixes in intra-area-prefix LSAs. R4 uses these LSAs to advertise its IPv6 access networks.
The Link LSA is also new in OSPFv3. It advertises the router link-local address and prefix information on one link. It is visible only on that link.
The live R1 backbone database shows the Router, Network, InterArPfx, InterArRtr, IntraArPfx, Extern, and Link LSAs. The Link LSAs appear in the link-local database section.
The R5 external route currently uses an external Type 1 metric in this lab. Confirm the route and test connectivity:
show ospf3 routerun ping 2001:db8:113::1 source 2001:db8:1:255::3 count 2The ping starts from the R3 loopback. It crosses Area 1, Area 0, and Area 2. It ends on the real R5 edge interface. This confirms that OSPFv3 inter-area and external routing work correctly.
IPv6 Route Summarization
OSPFv3 uses the same ABR summarization idea as OSPFv2. We will configure the area range on R1:
set protocols ospf3 area 0.0.0.1 area-range 2001:db8:1::/48On R2 and R5, the individual Area 1 IPv6 prefixes become one inter-area-prefix route for 2001:db8:1::/48. The summary route metric is the highest metric of the reachable component routes. This behavior is the same as the OSPFv2 area range in Lab 6. OSPFv2 uses a Summary LSA. OSPFv3 uses an InterArPfx LSA.
OSPFv2 Authentication and Key Rotation
Junos supports no authentication, simple authentication, and MD5 authentication for OSPFv2. Simple authentication sends a password in the packet. It can help to identify a basic configuration error, but it does not protect the password. MD5 sends a keyed message digest. The key itself is not sent in the packet.
First, configure MD5 on R1 only. This intentionally breaks the backbone adjacency:
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 authentication md5 1 key <key-one>R1 now ignores the unauthenticated Hello packets from R2. The neighbor may remain visible until the dead timer expires. The default logs do not clearly show the reason.
Configure OSPF tracing on R1:
set protocols ospf traceoptions file trace-ospfset protocols ospf traceoptions flag error detailrun show log trace-ospfThe trace output shows an authentication type mismatch. This is the reason for the failed adjacency. Configure the same MD5 key on R2 and commit the configuration:
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 authentication md5 1 key <key-one>show ospf neighborshow ospf interface ge-0/0/0.0 detailThe neighbor should return to Full. The interface detail output should show Auth type: MD5 and the active key ID.
Rotating the MD5 Key
MD5 uses a key ID. This allows more than one key to exist during a key rotation. Configure key ID 2 on both routers. Use the same key and the same future start time on R1 and R2.
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 authentication md5 2 key <key-two> start-time <YYYY-MM-DD.hh:mm>Commit the new key on both routers before the start time. Before the scheduled time, key ID 1 remains active. After the scheduled time, key ID 2 becomes active. The OSPF neighbor should remain Full during this change.
The new key must be configured on both routers before it becomes active. The router clocks must also be synchronized. In a production network, use NTP. In this lab, compare show system uptime on both routers before selecting the start time.
For a quick test, start-time now changes the active key immediately. Use it only when the new key is already configured on both routers. After key ID 2 is active on both routers, delete the old key:
delete protocols ospf area 0.0.0.0 interface ge-0/0/0.0 authentication md5 1Do not remove key ID 1 before key ID 2 is active everywhere. OSPF does not negotiate the active key. Both routers must use the same active key.
OSPFv3 Authentication with IPsec
OSPFv3 does not have an authentication field in the OSPF header. This is part of the OSPFv3 protocol design. OSPFv3 uses IPsec for authentication and optional encryption.
For this lab we will configure a manual bidirectional IPsec security association in transport mode. There is no IKE negotiation. R1 and R2 must use the same security association values.
We will configure this on both R1 and R2:
set security ipsec security-association ospf3-auth mode transportset security ipsec security-association ospf3-auth manual direction bidirectional protocol ahset security ipsec security-association ospf3-auth manual direction bidirectional spi 256set security ipsec security-association ospf3-auth manual direction bidirectional authentication algorithm hmac-sha1-96set security ipsec security-association ospf3-auth manual direction bidirectional authentication key ascii-text <20-character-ascii-key>set protocols ospf3 area 0.0.0.0 interface ge-0/0/0.0 ipsec-sa ospf3-authVerify the security association and the neighbor state:
show ospf3 interface ge-0/0/0.0 detailshow ospf3 neighborSummary
This lab adds three main concepts to the previous OSPF labs:
- OSPFv2 and OSPFv3 are separate protocols. They can use the same physical interfaces and router IDs, but they have separate neighbors, LSDBs, and route tables.
- OSPFv3 moved prefix information to IntraArPfx LSAs. It also added link-scoped Link LSAs. The main routing concepts are still intra-area, inter-area, and external routing.
- OSPFv2 uses MD5 authentication with numbered keys. OSPFv3 uses IPsec authentication instead of an OSPF authentication command.
