单区域和多区域OSPF协议配置
单区域OSPF配置:
启动设备
AR6配置信息
<Huawei>undo terminal monitor
<Huawei>system-view
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]sysname AR6
[AR6]int g0/0/0
[AR6-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[AR6-GigabitEthernet0/0/0]undo shutdown
[AR6-GigabitEthernet0/0/0]int loop 0
[AR6-LoopBack0]ip add 1.1.1.1 32
[AR6-LoopBack0]quit
[AR6]ospf 1 router-id 1.1.1.1
[AR6-ospf-1]area 0
[AR6-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[AR6-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[AR6-ospf-1-area-0.0.0.0]quit
[AR6-ospf-1]quit
AR7配置信息
<Huawei>undo terminal monitor
<Huawei>system-view
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]sysname AR7
[AR7]int g0/0/0
[AR7-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[AR7-GigabitEthernet0/0/0]undo shutdown
[AR7-GigabitEthernet0/0/0]int g0/0/1
[AR7-GigabitEthernet0/0/1]ip add 20.1.1.2 24
[AR7-GigabitEthernet0/0/1]undo shutdown
[AR7-GigabitEthernet0/0/1]int loop 0
[AR7-LoopBack0]ip add 2.2.2.2 32
[AR7-LoopBack0]quit
[AR7]ospf 1 router-id 2.2.2.2
[AR7-ospf-1]area 0
[AR7-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[AR7-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[AR7-ospf-1-area-0.0.0.0]network 20.1.1.0 0.0.0.255
[AR7-ospf-1-area-0.0.0.0]quit
AR8配置信息
<Huawei>undo terminal monitor
<Huawei>system-view
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]sysname AR8
[AR8]int g0/0/0
[AR8-GigabitEthernet0/0/0]ip add 20.1.1.5 24
[AR8-GigabitEthernet0/0/0]undo shutdown
[AR8-GigabitEthernet0/0/0]int loop 0
[AR8-LoopBack0]ip add 5.5.5.5 32
[AR8-LoopBack0]quit
[AR8]ospf 1 router-id 5.5.5.5
[AR8-ospf-1]area 0
[AR8-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[AR8-ospf-1-area-0.0.0.0]network 20.1.1.0 0.0.0.255
AR9配置信息
<Huawei>undo terminal monitor
<Huawei>system-view
[Huawei]user-interface con
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]sysname AR9
[AR9]int g0/0/0
[AR9-GigabitEthernet0/0/0]ip add 20.1.1.4 24
[AR9-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[AR9-GigabitEthernet0/0/0]int g0/0/1
[AR9-GigabitEthernet0/0/1]ip add 45.1.1.4 24
[AR9-GigabitEthernet0/0/1]undo shutdown
[AR9-GigabitEthernet0/0/1]int loop 0
[AR9-LoopBack0]ip add 4.4.4.4 32
[AR9-LoopBack0]quit
[AR9]os
[AR9]ospf 1 router-id 4.4.4.4
[AR9-ospf-1]area 0
[AR9-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[AR9-ospf-1-area-0.0.0.0]network 20.1.1.0 0.0.0.255
[AR9-ospf-1-area-0.0.0.0]network 45.1.1.0 0.0.0.255
AR10配置信息
<Huawei>undo terminal monitor
<Huawei>system-view
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]sysname AR10
[AR10]int g0/0/0
[AR10-GigabitEthernet0/0/0]ip add 45.1.1.3 24
[AR10-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[AR10-GigabitEthernet0/0/0]int loop 0
[AR10-LoopBack0]ip add 3.3.3.3 32
[AR10-LoopBack0]quit
[AR10]ospf 1 router-id 3.3.3.3
[AR10-ospf-1]area 0
[AR10-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[AR10-ospf-1-area-0.0.0.0]network 45.1.1.0 0.0.0.255
[AR10-ospf-1-area-0.0.0.0]quit
[AR10-ospf-1]quit
多区域OSPF配置:
启动设备
AR1配置信息
<Huawei>undo terminal monitor
<Huawei>system-view
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]sysname R11
[R11]sysname R11
[R11]int g0/0/0
[R11-GigabitEthernet0/0/0]ip add 10.1.1.1 24
[R11-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R11-GigabitEthernet0/0/0]int loop 0
[R11-LoopBack0]ip add 1.1.1.1 32
[R11-LoopBack0]quit
[R11]ospf 1 router-id 1.1.1.1
[R11-ospf-1]area 1
[R11-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.255
[R11-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0
[R11-ospf-1-area-0.0.0.1]quit
[R11-ospf-1]quit
AR2配置信息
<Huawei>undo terminal monitor
<Huawei>system-view
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]sysname R12
[R12]int g0/0/0
[R12-GigabitEthernet0/0/0]ip add 10.1.1.2 24
[R12-GigabitEthernet0/0/0]undo shutdown
[R12-GigabitEthernet0/0/0]int g0/0/1
[R12-GigabitEthernet0/0/1]ip add 10.1.2.2 24
[R12-GigabitEthernet0/0/1]undo shutdown
[R12-GigabitEthernet0/0/1]int loop 0
[R12-LoopBack0]ip add 2.2.2.2 32
[R12-LoopBack0]quit
[R12]ospf 1 router-id 2.2.2.2
[R12-ospf-1]area 1
[R12-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.255
[R12-ospf-1-area-0.0.0.1]quit
[R12-ospf-1]area 0
[R12-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R12-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[R12-ospf-1-area-0.0.0.0]quit
[R12-ospf-1]quit
AR3配置信息
<Huawei>undo terminal monitor
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]sysname R13
[R13]int g0/0/0
[R13-GigabitEthernet0/0/0]ip add 10.1.2.3 24
[R13-GigabitEthernet0/0/0]undo shutdown
[R13-GigabitEthernet0/0/0]int g0/0/1
[R13-GigabitEthernet0/0/1]ip add 10.1.3.3 24
[R13-GigabitEthernet0/0/1]undo shutdown
[R13-GigabitEthernet0/0/1]int loop 0
[R13-LoopBack0]ip add 3.3.3.3 32
[R13-LoopBack0]quit
[R13]ospf 1 router-id 3.3.3.3
[R13-ospf-1]area 0
[R13-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R13-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[R13-ospf-1-area-0.0.0.0]quit
[R13-ospf-1]area 2
[R13-ospf-1-area-0.0.0.2]network 10.1.3.0 0.0.0.255
[R13-ospf-1-area-0.0.0.2]quit
[R13-ospf-1]quit
AR4配置信息
<Huawei>undo terminal monitor
<Huawei>system-view
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]sysname R14
[R14]int g0/0/0
[R14-GigabitEthernet0/0/0]ip add 10.1.3.4 24
[R14-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R14-GigabitEthernet0/0/0]int loop 0
[R14-LoopBack0]ip add 4.4.4.4 32
[R14-LoopBack0]quit
[R14]ospf 1 router-id 4.4.4.4
[R14-ospf-1]area 2
[R14-ospf-1-area-0.0.0.2]network 4.4.4.4 0.0.0.0
[R14-ospf-1-area-0.0.0.2]network 10.1.3.0 0.0.0.255
[R14-ospf-1-area-0.0.0.2]quit
[R14-ospf-1]quit