OSPFv3 stub area configuration example

Network requirements

As shown in Figure 88:

Figure 88: Network diagram

Configuration procedure

  1. Configure IPv6 addresses for interfaces. (Details not shown.)

  2. Configure basic OSPFv3:

    # On 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
    

    # On 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
    

    # On 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
    

    # On 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 InstID Interface
     3.3.3.3         1   Full/BDR          00:00:40  0      Vlan100
    
     Area: 0.0.0.1
    -------------------------------------------------------------------------
     Router ID       Pri State             Dead-Time InstID Interface
     1.1.1.1         1   Full/DR           00:00:40  0      Vlan200
    

    # 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 InstID Interface
     2.2.2.2         1   Full/DR           00:00:40  0      Vlan100
    
     Area: 0.0.0.2
    -------------------------------------------------------------------------
     Router ID       Pri State             Dead-Time InstID Interface
     4.4.4.4         1   Full/BDR          00:00:40  0      Vlan400
    

    # Display OSPFv3 routing table information on Switch D.

    [SwitchD] display ospfv3 routing
    
                   OSPFv3 Process 1 with Router ID 4.4.4.4
    -------------------------------------------------------------------------
     I  - Intra area route,  E1 - Type 1 external route,  N1 - Type 1 NSSA route
     IA - Inter area route,  E2 - Type 2 external route,  N2 - Type 2 NSSA route
     *  - Selected route
    
     *Destination: 2001::/64
      Type       : IA                                        Cost     : 2
      NextHop    : FE80::F40D:0:93D0:1                       Interface: Vlan400
      AdvRouter  : 3.3.3.3                                   Area     : 0.0.0.2
      Preference : 10
    
     *Destination: 2001:1::/64
      Type       : IA                                        Cost     : 3
      NextHop    : FE80::F40D:0:93D0:1                       Interface: Vlan400
      AdvRouter  : 3.3.3.3                                   Area     : 0.0.0.2
      Preference : 10
    
     *Destination: 2001:2::/64
      Type       : I                                         Cost     : 1
      Nexthop    : ::                                        Interface: Vlan400
      AdvRouter  : 4.4.4.4                                   Area     : 0.0.0.2
      Preference : 10
    
     *Destination: 2001:3::/64
      Type       : IA                                        Cost     : 4
      NextHop    : FE80::F40D:0:93D0:1                       Interface: Vlan400
      AdvRouter  : 3.3.3.3                                   Area     : 0.0.0.2
      Preference : 10
    
     Total: 4
     Intra area: 1         Inter area: 3         ASE: 0         NSSA: 0
    
  3. 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
    -------------------------------------------------------------------------
     I  - Intra area route,  E1 - Type 1 external route,  N1 - Type 1 NSSA route
     IA - Inter area route,  E2 - Type 2 external route,  N2 - Type 2 NSSA route
     *  - Selected route
    
     *Destination: ::/0
      Type       : IA                                        Cost     : 11
      NextHop    : FE80::F40D:0:93D0:1                       Interface: Vlan400
      AdvRouter  : 4.4.4.4                                   Area     : 0.0.0.2
      Preference : 10
    
     *Destination: 2001::/64
      Type       : IA                                        Cost     : 2
      NextHop    : FE80::F40D:0:93D0:1                       Interface: Vlan400
      AdvRouter  : 3.3.3.3                                   Area     : 0.0.0.2
      Preference : 10
    
     *Destination: 2001:1::/64
      Type       : IA                                        Cost     : 3
      NextHop    : FE80::F40D:0:93D0:1                       Interface: Vlan400
      AdvRouter  : 3.3.3.3                                   Area     : 0.0.0.2
      Preference : 10
    
     *Destination: 2001:2::/64
      Type       : I                                         Cost     : 1
      Nexthop    : ::                                        Interface: Vlan400
      AdvRouter  : 4.4.4.4                                   Area     : 0.0.0.2
      Preference : 10
    
     *Destination: 2001:3::/64
      Type       : IA                                        Cost     : 4
      NextHop    : FE80::F40D:0:93D0:1                       Interface: Vlan400
      AdvRouter  : 3.3.3.3                                   Area     : 0.0.0.2
      Preference : 10
    
     Total: 5
     Intra area: 1         Inter area: 4         ASE: 0         NSSA: 0
    

    The output shows that a default route is added, and its cost is the cost of a direct route plus the configured cost.

  4. 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
    -------------------------------------------------------------------------
     I  - Intra area route,  E1 - Type 1 external route,  N1 - Type 1 NSSA route
     IA - Inter area route,  E2 - Type 2 external route,  N2 - Type 2 NSSA route
     *  - Selected route
    
     *Destination: ::/0
      Type       : IA                                        Cost     : 11
      NextHop    : FE80::F40D:0:93D0:1                       Interface: Vlan400
      AdvRouter  : 4.4.4.4                                   Area     : 0.0.0.2
      Preference : 10
    
     *Destination: 2001:2::/64
      Type       : I                                         Cost     : 1
      Nexthop    : ::                                        Interface: Vlan400
      AdvRouter  : 4.4.4.4                                   Area     : 0.0.0.2
      Preference : 10
    
     Total: 2
     Intra area: 1         Inter area: 1         ASE: 0         NSSA: 0
    

    The output shows that route entries are reduced. All indirect routes are removed, except the default route.