Example for Configuring Basic OSPFv3 Functions
Networking Requirements
As shown in Figure 6-12, all switches run OSPFv3. The entire autonomous system is divided into three areas. SwitchB and SwitchC serve as ABRs to forward the inter-area routes.
After the configuration, each router should learn the routes from the AS to all network segments.
Configuration Roadmap
The configuration roadmap is as follows:
Enable basic OSPFv3 functions on each switch.
Check the routing list and LSDB.
Procedure
- Assign an IPv6 address to each interface. The detailed configuration is not provided here.
- Configure basic OSPFv3 functions.
# Configure SwitchA.
[~SwitchA] ospfv3
[*SwitchA-ospfv3-1] router-id 10.10.10.1
[*SwitchA-ospfv3-1] quit
[*SwitchA] interface vlanif 20
[*SwitchA-Vlanif20] ospfv3 1 area 1
[*SwitchA-Vlanif20] quit
[*SwitchA] interface vlanif 40
[*SwitchA-Vlanif40] ospfv3 1 area 1
[*SwitchA-Vlanif40] quit
[*SwitchA] commit
# Configure SwitchB.
[~SwitchB] ospfv3
[*SwitchB-ospfv3-1] router-id 10.10.10.2
[*SwitchB-ospfv3-1] quit
[*SwitchB] interface vlanif 10
[*SwitchB-Vlanif10] ospfv3 1 area 0
[*SwitchB-Vlanif10] quit
[*SwitchB] interface vlanif 20
[*SwitchB-Vlanif20] ospfv3 1 area 1
[*SwitchB-Vlanif20] quit
[*SwitchB] commit
# Configure SwitchC.
[~SwitchC] ospfv3
[*SwitchC-ospfv3-1] router-id 10.10.10.3
[*SwitchC-ospfv3-1] quit
[*SwitchC] interface vlanif 10
[*SwitchC-Vlanif10] ospfv3 1 area 0
[*SwitchC-Vlanif10] quit
[*SwitchC] interface vlanif 30
[*SwitchC-Vlanif30] ospfv3 1 area 2
[*SwitchC-Vlanif30] quit
[*SwitchC] commit
# Configure SwitchD.
[~SwitchD] ospfv3
[*SwitchD-ospfv3-1] router-id 10.10.10.4
[*SwitchD-ospfv3-1] quit
[*SwitchD] interface vlanif 30
[*SwitchD-Vlanif30] ospfv3 1 area 2
[*SwitchD-Vlanif30] quit
[*SwitchD] commit
- Verify the configuration.
#View the neighbors of Switch B, and you can see that the status of the neighbor relationship between Switch B and other devices is Full.
[~SwitchB] display ospfv3 peer
OSPFv3 Process (1)
Total number of peer(s): 2
Peer(s) in full state: 2
OSPFv3 Area (0.0.0.0)
Neighbor ID Pri State Dead Time Interface Instance ID
10.10.10.3 1 Full/DR 00:00:32 Vlanif10 0
OSPFv3 Area (0.0.0.1)
Neighbor ID Pri State Dead Time Interface Instance ID
10.10.10.1 1 Full/Backup 00:00:34 Vlanif20 0
# Display the OSPFv3 neighbors of SwitchC.
[~SwitchC] display ospfv3 peer
OSPFv3 Process (1)
Total number of peer(s): 2
Peer(s) in full state: 2
OSPFv3 Area (0.0.0.0)
Neighbor ID Pri State Dead Time Interface Instance ID
10.10.10.2 1 Full/Backup 00:00:37 Vlanif10 0
OSPFv3 Area (0.0.0.2)
Neighbor ID Pri State Dead Time Interface Instance ID
10.10.10.4 1 Full/DR 00:00:33 Vlanif30 0
# Display the OSPFv3 routing table of SwitchD.
[~SwitchD] display ospfv3 routing
Codes : E2 - Type 2 External, E1 - Type 1 External, IA - Inter-Area, N - NSSA Flags : A - Added to URT6 OSPFv3 Process (1) Destination Metric Next-hop IA FC00:0:0:1000::/64 2 via FE80::225:9EFF:FE01:211, Vlanif30, Flags : A IA FC00:0:0:1001::/64 3 via FE80::225:9EFF:FE01:211, Vlanif30, Flags : A FC00:0:0:1002::/64 1 directly connected, Vlanif30, Flags : A IA FC00:0:0:2000::/64 4 via FE80::225:9EFF:FE01:211, Vlanif30, Flags : A
Configuration Files
Configuration file of SwitchA
#
sysname SwitchA
#
vlan batch 20 40
#
ospfv3 1
router-id 10.10.10.1
area 0.0.0.1
#
interface Vlanif20
ipv6 enable
ipv6 address FC00:0:0:1001::2/64
ospfv3 1 area 0.0.0.1
#
interface Vlanif40
ipv6 enable
ipv6 address FC00:0:0:2000::1/64
ospfv3 1 area 0.0.0.1
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 40
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
return
Configuration file of SwitchB
#
sysname SwitchB
#
vlan batch 10 20
#
ospfv3 1
router-id 10.10.10.2
area 0.0.0.0
area 0.0.0.1
#
interface Vlanif10
ipv6 enable
ipv6 address FC00:0:0:1000::1/64
ospfv3 1 area 0.0.0.0
#
interface Vlanif20
ipv6 enable
ipv6 address FC00:0:0:1001::1/64
ospfv3 1 area 0.0.0.1
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
return
Configuration file of SwitchC
#
sysname SwitchC
#
vlan batch 10 30
#
ospfv3 1
router-id 10.10.10.3
area 0.0.0.0
area 0.0.0.2
#
interface Vlanif10
ipv6 enable
ipv6 address FC00:0:0:1000::2/64
ospfv3 1 area 0.0.0.0
#
interface Vlanif30
ipv6 enable
ipv6 address FC00:0:0:1002::1/64
ospfv3 1 area 0.0.0.2
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 30
#
return
Configuration file of SwitchD
#
sysname SwitchD
#
vlan batch 30
#
ospfv3 1
router-id 10.10.10.4
area 0.0.0.2
#
interface Vlanif30
ipv6 enable
ipv6 address FC00:0:0:1002::2/64
ospfv3 1 area 0.0.0.2
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 30
#
return