Using OSPF for IPv6

Problem

You want to distribute your IPv6 routing information using OSPF Version 3.

Solution

Configuring OSPF for IPv6 is similar to the IPv4 configuration:

Router1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#ip cef Router1(config)#ipv6 cef Router1(config)#ipv6 unicast-routing Router1(config)#ipv6 router ospf 1 Router1(config-rtr)#router-id 1.0.0.1 Router1(config-rtr)#area 0 range AAAA:5::/64 Router1(config-rtr)#exit Router1(config)#interface FastEthernet0/0 Router1(config-if)#ipv6 address AAAA:5::1/64 Router1(config-if)#ipv6 ospf 1 area 0 Router1(config-if)#exit Router1(config)#end Router1#

 

Discussion

OSPF Version 3 is a set of relatively straightforward extensions to the existing OSPF Version 2 protocol. These extensions are used purely to allow IPv6 support. The basic operation of OSPF, with its Link State Advertisement (LSA) packets, its strict two-level hierarchy of areas, flooding, Designated Routers, and so forth are exactly the same as what we previously saw for IPv4 in Chapter 8.

OSPFv3 is defined in RFC 2740.

Configuring OSPF for IPv6 has a few more steps than configuring RIP. In particular, CEF must be enabled for both IPv4 and IPv6:

Router1(config)#ip cef Router1(config)#ipv6 cef

You then define an OSPF process:

Router1(config)#ipv6 router ospf 1 Router1(config-rtr)#router-id 1.0.0.1 Router1(config-rtr)#area 0 range AAAA:5::/64

Note that OSPF requires a router ID for every router, and that this ID is always a 32-bit IPv4 style address. If your router has IPv4 configured, then it will select a router-id automatically using the same criteria that we discussed in Chapter 8. However, if there are no IPv4 addresses on the router, you must manually configure a router-ID, as OSPF will not work without it.

We have used the area range command to define a single area on this router. Once again, OSPF Version 3 area ID numbers are 32-bit values that can be written in IPv4 style dotted decimal notation or as an integer value between 0 and 4,294,967,295, exactly the same as we saw in Chapter 8 when discussing OSPF Version 2 for IPv4.

Finally, we must configure at least one interface to take part in OSPF process number 1:

Router1(config)#interface FastEthernet0/0 Router1(config-if)#ipv6 address AAAA:5::1/64 Router1(config-if)#ipv6 ospf 1 area 0 You can view OSPF neighbor relationships using the show ipv6 ospf neighbor command. Router1#show ipv6 ospf neighbor Neighbor ID Pri State Dead Time Interface ID Interface 1.0.0.2 1 FULL/DR 00:00:36 3 FastEthernet0/ 0 Router1#

And you can look at the OSPF routing information with the command show ipv6 route ospf:

Router1#show ipv6 route ospf IPv6 Routing Table - 15 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 O AAAA:F::AA:1/128 [110/1] via FE80::20E:D7FF:FED6:1060, FastEthernet0/0 OI AAAA:99::9:0/112 [110/2] via FE80::20E:D7FF:FED6:1060, FastEthernet0/0 OI AAAA:99::A:0/112 [110/151] via FE80::20E:D7FF:FED6:1060, FastEthernet0/0 OI AAAA:99::B:0/112 [110/163] via FE80::20E:D7FF:FED6:1060, FastEthernet0/0 OI AAAA:99::C:0/112 [110/20] via FE80::20E:D7FF:FED6:1060, FastEthernet0/0 OI AAAA:99::D:0/112 [110/893] via FE80::20E:D7FF:FED6:1060, FastEthernet0/0 OI AAAA:99::E:0/112 [110/2] via FE80::20E:D7FF:FED6:1060, FastEthernet0/0 Router1#

This routing table shows a single intra-area route, designated by the "O" at the start of the line. All of the other routes shown are OSPF interarea routes.

We note in passing that the area range command we included in the example is not strictly necessary. The interface ipv6 ospf area command instructs the router to include all of the IPv6 prefixes defined on this interface in the specified area anyway. The area command is useful, however, when we want to define nondefault characteristics for the area. For example, with this command, we can specify that a particular area is to be a stub or Not So Stubby Area (NSSA) as follows:

Router1(config)#ipv6 router ospf 1 Router1(config-rtr)#area 15 stub no-summary

All of the same area types that we discussed in Chapter 8 for IPv4 are available for IPv6 as well.

We can also use the area command to define virtual links:

Router1(config)#ipv6 router ospf 1 Router1(config-rtr)#area 16 virtual-link 1.0.0.5

Note that the IPv4 address used in the area virtual-link command is the router-id of the destination device.

Several of the familiar OSPF options from OSPFv2 for IPv4 are not currently available for IPv6. For example, the OSPFv3 standard deliberately removes neighbor authentication, relying instead on IPv6's IPSec Authentication Header (AH) and Encapsulating Security Payload (ESP) options.

See Also

RFC 2740; Chapter 8

Категории