OSPFv3 area configuration example
Network requirements
As shown in Figure 79:
Enable OSPFv3 on all switches.
Split the AS into three areas.
Configure Switch B and Switch C as ABRs to forward routing information between areas.
Configure Area 2 as a stub area to reduce LSAs in the area without affecting route reachability.
Figure 79: Network diagram
![](images/image78.png)
Configuration procedure
Configure IPv6 addresses for interfaces. (Details not shown.)
Configure basic OSPFv3:
# Configure Switch A: enable OSPFv3 and specify the router ID as 1.1.1.1.
<SwitchA> system-view [SwitchA] ospfv3 [SwitchA-ospfv3-1] router-id 1.1.1.1 [SwitchA-ospfv3-1] quit [SwitchA] interface vlan-interface 300 [SwitchA-Vlan-interface300] ospfv3 1 area 1 [SwitchA-Vlan-interface300] quit [SwitchA] interface vlan-interface 200 [SwitchA-Vlan-interface200] ospfv3 1 area 1 [SwitchA-Vlan-interface200] quit
# Configure Switch B: enable OSPFv3 and specify the router ID as 2.2.2.2.
<SwitchB> system-view [SwitchB] ospfv3 [SwitchB-ospfv3-1] router-id 2.2.2.2 [SwitchB-ospfv3-1] quit [SwitchB] interface vlan-interface 100 [SwitchB-Vlan-interface100] ospfv3 1 area 0 [SwitchB-Vlan-interface100] quit [SwitchB] interface vlan-interface 200 [SwitchB-Vlan-interface200] ospfv3 1 area 1 [SwitchB-Vlan-interface200] quit
# Configure Switch C: enable OSPFv3 and specify the router ID as 3.3.3.3.
<SwitchC> system-view [SwitchC] ospfv3 [SwitchC-ospfv3-1] router-id 3.3.3.3 [SwitchC-ospfv3-1] quit [SwitchC] interface vlan-interface 100 [SwitchC-Vlan-interface100] ospfv3 1 area 0 [SwitchC-Vlan-interface100] quit [SwitchC] interface vlan-interface 400 [SwitchC-Vlan-interface400] ospfv3 1 area 2 [SwitchC-Vlan-interface400] quit
# Configure Switch D: enable OSPFv3 and specify the router ID as 4.4.4.4.
<SwitchD> system-view [SwitchD] ospfv3 [SwitchD-ospfv3-1] router-id 4.4.4.4 [SwitchD-ospfv3-1] quit [SwitchD] interface vlan-interface 400 [SwitchD-Vlan-interface400] ospfv3 1 area 2 [SwitchD-Vlan-interface400] quit
# Display OSPFv3 neighbors on Switch B.
[SwitchB] display ospfv3 peer OSPFv3 Process 1 with Router ID 2.2.2.2 Area: 0.0.0.0 ------------------------------------------------------------------------- Router ID Pri State Dead-Time Interface Inst ID 3.3.3.3 1 Full/Backup 00:00:40 Vlan100 0 Area: 0.0.0.1 ------------------------------------------------------------------------- Router ID Pri State Dead-Time Interface Inst ID 1.1.1.1 1 Full/DR 00:00:40 Vlan200 0
# Display OSPFv3 neighbors on Switch C.
[SwitchC] display ospfv3 peer OSPFv3 Process 1 with Router ID 3.3.3.3 Area: 0.0.0.0 ------------------------------------------------------------------------- Router ID Pri State Dead-Time Interface Inst ID 2.2.2.2 1 Full/DR 00:00:40 Vlan100 0 Area: 0.0.0.2 ------------------------------------------------------------------------- Router ID Pri State Dead-Time Interface Inst ID 4.4.4.4 1 Full/Backup 00:00:40 Vlan400 0
# Display OSPFv3 routing table information on Switch D.
[SwitchD] display ospfv3 routing OSPFv3 Process 1 with Router ID 4.4.4.4 ------------------------------------------------------------------------- E1 - Type 1 external route, IA - Inter area route, I - Intra area route E2 - Type 2 external route, * - Selected route *Destination: 2001::/64 Type : IA Cost : 2 NextHop : FE80::F40D:0:93D0:1 Interface: Vlan400 *Destination: 2001:1::/64 Type : IA Cost : 3 NextHop : FE80::F40D:0:93D0:1 Interface: Vlan400 *Destination: 2001:2::/64 Type : I Cost : 1 NextHop : directly-connected Interface: Vlan400 *Destination: 2001:3::/64 Type : IA Cost : 4 NextHop : FE80::F40D:0:93D0:1 Interface: Vlan400 Total: 4 Intra area: 1 Inter area: 3 ASE: 0
Configure Area 2 as a stub area:
# Configure Switch D
[SwitchD] ospfv3 [SwitchD-ospfv3-1] area 2 [SwitchD-ospfv3-1-area-0.0.0.2] stub
# Configure Switch C, and specify the cost of the default route sent to the stub area as 10.
[SwitchC] ospfv3 [SwitchC-ospfv3-1] area 2 [SwitchC-ospfv3-1-area-0.0.0.2] stub [SwitchC-ospfv3-1-area-0.0.0.2] default-cost 10
# Display OSPFv3 routing table information on Switch D.
[SwitchD] display ospfv3 routing OSPFv3 Process 1 with Router ID 4.4.4.4 ------------------------------------------------------------------------- E1 - Type 1 external route, IA - Inter area route, I - Intra area route E2 - Type 2 external route, * - Selected route *Destination: ::/0 Type : IA Cost : 11 NextHop : FE80::F40D:0:93D0:1 Interface: Vlan400 *Destination: 2001::/64 Type : IA Cost : 2 NextHop : FE80::F40D:0:93D0:1 Interface: Vlan400 *Destination: 2001:1::/64 Type : IA Cost : 3 NextHop : FE80::F40D:0:93D0:1 Interface: Vlan400 *Destination: 2001:2::/64 Type : I Cost : 1 NextHop : directly-connected Interface: Vlan400 *Destination: 2001:3::/64 Type : IA Cost : 4 NextHop : FE80::F40D:0:93D0:1 Interface: Vlan400 Total: 5 Intra area: 1 Inter area: 4 ASE: 0
The output shows that a default route is added, and its cost is the cost of a direct route plus the configured cost.
Configure Area 2 as a totally stub area:
# Configure Area 2 as a totally stub area on Switch C.
[SwitchC-ospfv3-1-area-0.0.0.2] stub no-summary
# Display OSPFv3 routing table information on Switch D.
[SwitchD] display ospfv3 routing OSPFv3 Process 1 with Router ID 4.4.4.4 ------------------------------------------------------------------------- E1 - Type 1 external route, IA - Inter area route, I - Intra area route E2 - Type 2 external route, * - Selected route *Destination: ::/0 Type : IA Cost : 11 NextHop : FE80::F40D:0:93D0:1 Interface: Vlan400 *Destination: 2001:2::/64 Type : I Cost : 1 NextHop : directly-connected Interface: Vlan400 Total: 2 Intra area: 1 Inter area: 1 ASE: 0
The output shows that route entries are reduced. All indirect routes are removed, except the default route.