98
OSPF configuration examples
These examples only cover commands for OSPF configuration.
Configuring OSPF basic functions
Network requirements
As shown in
, all switches run OSPF. The AS is split into three areas, where Switch A and Switch
B act as ABRs to forward routing information between areas.
After configuration, all switches can learn routes to every network segment in the AS.
Figure 38
Network diagram
Configuration procedure
1.
Configure IP addresses for interfaces. (Details not shown.)
2.
Configure OSPF basic functions:
# Configure Switch A.
<SwitchA> system-view
[SwitchA] ospf
[SwitchA-ospf-1] area 0
[SwitchA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] quit
[SwitchA-ospf-1] area 1
[SwitchA-ospf-1-area-0.0.0.1] network 10.2.1.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.1] quit
[SwitchA-ospf-1] quit
# Configure Switch B.
<SwitchB> system-view
[SwitchB] ospf
[SwitchB-ospf-1] area 0
[SwitchB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[SwitchB-ospf-1-area-0.0.0.0] quit
[SwitchB-ospf-1] area 2
[SwitchB-ospf-1-area-0.0.0.2] network 10.3.1.0 0.0.0.255
[SwitchB-ospf-1-area-0.0.0.2] quit
[SwitchB-ospf-1] quit
Area 0
Area 1
Area 2
Switch C
Vlan-int100
10.1.1.2/24
Vlan-int100
10.1.1.1/24
Vlan-int300
10.4.1.1/24
Vlan-int200
10.2.1.2/24
Switch B
Vlan-int200
10.3.1.1/24
Vlan-int200
10.3.1.2/24
Switch A
Vlan-int200
10.2.1.1/24
Vlan-int300
10.5.1.1/24
Switch D