- Network requirements
• • All switches run OSPF, and the entire AS is divided into three areas.
• • Switch A and Switch B as ABR to forward routing information between areas.
• • After configuration, all switches can learn routes to every network segment in the AS. - Lab topology
- 配置步骤
(1) 配置各接口的 IP 地址(略)
例SwitchB:
<H3C>sys
[H3C]hostname SwitchB
[SwitchB]vlan 100
[SwitchB-vlan100]port g 1/0/10
[SwitchB-vlan100]quit
[SwitchB]vlan 200
[SwitchB-vlan200]port g 1/0/20
[SwitchB-vlan200]quit
[SwitchB]inter vlan 100
[SwitchB-Vlan-interface100]ip add 10.1.1.2 24
[SwitchB-Vlan-interface100]quit
[SwitchB]inter vlan 200
[SwitchB-Vlan-interface200]ip add 10.3.1.1 24
[SwitchB-Vlan-interface200]quit
[SwitchB]
(2) Configuration The basic configuration OSPF
Configure Switch A.
<SwitchA> system-view
[SwitchA] router id 10.2.1.1
[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] router id 10.3.1.1
[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
Configure Switch C.
<SwitchC> system-view
[SwitchC] router id 10.4.1.1
[SwitchC] ospf
[SwitchC-ospf-1] area 1
[SwitchC-ospf-1-area-0.0.0.1] network 10.2.1.0 0.0.0.255
[SwitchC-ospf-1-area-0.0.0.1] network 10.4.1.0 0.0.0.255
[SwitchC-ospf-1-area-0.0.0.1] quit
[SwitchC-ospf-1] quit
Configuration Switch D.
<SwitchD> system-view
[SwitchD] router id 10.5.1.1
[SwitchD] ospf
[SwitchD-ospf-1] area 2
[SwitchD-ospf-1-area-0.0.0.2] network 10.3.1.0 0.0.0.255
[SwitchD-ospf-1-area-0.0.0.2] network 10.5.1.0 0.0.0.255
[SwitchD-ospf-1-area-0.0.0.2] quit
[SwitchD-ospf-1] quit4.
验证配置
OSPF neighbor information on Switch A.
[SwitchA] display ospf peer verbose
Check the OSPF routing information on Switch A.
[SwitchA] display ospf routing
Switch D to view OSPF routing information.
[SwitchD] display ospf routing
On Switch D, the Ping test the connectivity.
[SwitchD] ping 10.4.1.1