OSPF is used in numerous networks, it is well documented, well-known and widely tested in many scenarios. When IPv6 came along, good old OSPF which was used for IPv4 (OSPFv2), got a younger brother – OSPFv3. Many networks now run both protocols, one for IPv4 and the other for IPv6. This is getting more and more ridiculous, because OSPFv3 can be used to route IPv4 also.

See how this can be done with Cisco IOS and Juniper JUNOS.
The following snippet shows a Cisco IOS configuration. Here, the router “speak” OSPFv3 on interfaces Te0/2/0.3 (for IPv6 and IPv4) and Te0/2/0.6 (for IPv4 only). As an example, I have configured a passive loopback interface for both address families:

interface Loopback100
 ip address
 ipv6 address 2001:DB8::111/128
 ipv6 enable
 ospfv3 1 ipv4 area 0
 ospfv3 1 ipv6 area 0
interface TenGigabitEthernet0/2/0.6
 encapsulation dot1Q 219
 ip address
 ipv6 enable
 ospfv3 1 ipv4 area 0
 ospfv3 1 ipv4 network point-to-point
 ospfv3 1 ipv4 cost 1000
router ospfv3 1
 address-family ipv4 unicast
  passive-interface default
  no passive-interface TenGigabitEthernet0/2/0.3
  no passive-interface TenGigabitEthernet0/2/0.6
 address-family ipv6 unicast
  passive-interface default
  no passive-interface TenGigabitEthernet0/2/0.3

A Juniper router is connected to Te0/2/0.6. It runs OSPFv3 for IPv4 only. Here is the configuration:

[edit interfaces]
xe-0/0/0 {
    unit 219 {
        vlan-id 219;
        family inet {
        family inet6;
[edit protocols ospf3]
realm ipv4-unicast {
    area {
        interface xe-0/0/0.219 {
            interface-type p2p;
            metric 1000;

Note that Juniper uses the word “realm” instead of “address family”.
Let’s verify the adjacency from both sides:

cisco#show ospfv3 neighbor

          OSPFv3 1 address-family ipv4 (router-id

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface       0   FULL/  -        00:00:31    1               TenGigabitEthernet0/2/0.6           0   FULL/  -        00:00:39    28              TenGigabitEthernet0/2/0.3

          OSPFv3 1 address-family ipv6 (router-id

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface           0   FULL/  -        00:00:33    28              TenGigabitEthernet0/2/0.3

user@juniper.re0> show ospf3 neighbor realm ipv4-unicast
ID               Interface              State     Pri   Dead          xe-0/0/0.219           Full        1     34
  Neighbor-address fe80::b614:89ff:fe00:1111

Now you can check for routes, look into OSPFv3 database, …etc. All the usual stuff. Here is the “show route” example from a Cisco and a Juniper box:

cisco2#show ip route ospfv3
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is to network is variably subnetted, 8 subnets, 3 masks
O [110/1] via, 00:25:02, Vlan218
O [110/1001] via, 00:25:02, Vlan218

user@juniper.re0> show route protocol ospf3 table inet.0

inet.0: 437010 destinations, 765247 routes (437002 active, 6 holddown, 2 hidden)
+ = Active Route, - = Last Active, * = Both        *[OSPF3/10] 00:20:27, metric 1001
                    > to via xe-0/0/0.219     *[OSPF3/10] 00:20:27, metric 1001
                    > to via xe-0/0/0.219     *[OSPF3/10] 00:20:27, metric 1000
                    > to via xe-0/0/0.219

Please, keep in mind that OSPFv3 runs on IPv6. It uses IPv6 link-local addresses as the source of hello packets and next-hop calculations. As such, you must enable IPv6 on the links even if you use OSPFv3 to route IPv4 only.

To try this you will need Cisco IOS 15.1(1)SY or IOS-XE 15.2(2)S2 or some other recently released version. According to Juniper documentation, Junos OS 9.2 or later should be fine but I’m not sure if this really works – I’ve tried with the latest 12.2R2.4.