1.配置各路由器
R1
[Huawei]sysname R1
[R1]interface G0/0/0
[R1-GigabitEthernet0/0/0]IP address 192.168.1.1 24
[R1]interface G0/0/1
[R1-GigabitEthernet0/0/1]ip address 172.16.1.1 24
[R1]interface g0/0/2
[R1-GigabitEthernet0/0/2]ip address 12.1.1.1 24
[R1]DHCP enable
[R1]ip pool aaa
[R1-ip-pool-aaa]network 192.168.1.0 mask 24
[R1-ip-pool-aaa]gateway-list 192.168.1.1
[R1-ip-pool-aaa]dns-list 8.8.8.8 114.114.114.114
[R1-ip-pool-aaa]static-bind ip-address 192.168.1.11 mac-address 5489-9865-065C
[R1-ip-pool-aaa]static-bind ip-address 192.168.1.22 mac-address 5489-9820-09FA
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]dhcp select global
[R1]ip pool aa
[R1-ip-pool-a]network 172.16.1.0 mask 16
[R1-ip-pool-aa]gateway-list 172.16.1.1
[R1-ip-pool-aa]dns-list 8.8.8.8 114.114.114.114
[R1-ip-pool-aa]static-bind ip-address 172.16.1.11 mac-address 5489-9899-6DA3
[R1-ip-pool-aa]static-bind ip-address 172.16.1.22 mac-address 5489-98AA-13A6
[R1]interface g0/0/1
[R1-GigabitEthernet0/0/1]dhcp select global
[R1]interface loopback0
[R1-LoopBack0]ip address 1.1.1.1
[R1-LoopBack0]ospf
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.1]network 12.1.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.1]network 192.168.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.1]network 172.16.1.0 0.0.0.255
[R1]interface g0/0/2
[R1-GigabitEthernet0/0/2]ospf authentication-mode simple cipher 666
R2
<R2>system-view
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 23.1.1.1 24
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 2.2.2.2 32
[R2-LoopBack0]ospf
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.1]network 12.1.1.0 0.0.0.255
[R2-ospf-1-area-0.0.0.1]network 23.1.1.0 0.0.0.255
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ospf authentication-mode simple cipher 666
R3
[Huawei]sysname R3
[R3]interface G0/0/0
[R3-GigabitEthernet0/0/0]IP address 23.1.1.2 24
[R3]interface G0/0/1
[R3-GigabitEthernet0/0/1]IP address 123.1.1.1 24
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 3.3.3.3 32
[R3-LoopBack0]ospf
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 123.1.1.0 0.0.0.255
[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ospf authentication-mode simple cipher 666
R4
[Huawei]sysname R4
[R4]interface G0/0/0
[R4-GigabitEthernet0/0/0]ip address 123.1.1.4 24
[R4]interface G0/0/1
[R4-GigabitEthernet0/0/1]IP address 45.1.1.1 24
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 4.4.4.4 255.255.255.255
[R4-LoopBack0]ospf
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]network 4.4.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.2]network 123.1.1.0 0.0.0.255
[R4-ospf-1-area-0.0.0.2]network 45.1.1.0 0.0.0.255
[R4]interface g0/0/0
[R4-GigabitEthernet0/0/0]ospf dr-priority 0
[R4]interface G0/0/1
[R4-GigabitEthernet0/0/1]ospf
[R4-GigabitEthernet0/0/1]ospf authentication-mode simple cipher 666
[R4-GigabitEthernet0/0/1]ospf authentication-mode md5
R5
[Huawei]sysname R5
[R5]interface G0/0/0
[R5-GigabitEthernet0/0/0]IP address 123.1.1.3 24
[R5]interface G0/0/1
[R5-GigabitEthernet0/0/1]IP address 56.1.1.1 24
[R5]interface G0/0/2
[R5-GigabitEthernet0/0/2]IP address 45.1.1.2 24
[Huawei]sysname R5
[R5]interface G0/0/0
[R5-GigabitEthernet0/0/0]IP address 123.1.1.3 24
[R5]interface G0/0/1
[R5-GigabitEthernet0/0/1]IP address 56.1.1.1 24
[R5]interface G0/0/2
[R5-GigabitEthernet0/0/2]IP address 45.1.1.2 24
[R5]interface g0/0/0
[R5-GigabitEthernet0/0/0]ospf dr-priority 0
[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]ospf authentication-mode simple cipher 666
[R5-GigabitEthernet0/0/1]ospf authentication-mode md5
[R5]interface g0/0/02
[R5-GigabitEthernet0/0/2]ospf
[R5-GigabitEthernet0/0/2]ospf authentication-mode simple cipher 666
[R5-GigabitEthernet0/0/2]ospf authentication-mode md5
R6
[R6]sysname R6
[R6]interface G0/0/0
[R6-GigabitEthernet0/0/0]IP ADDRESS 123.1.1.2 24
[R6]interface G0/0/1
[R6-GigabitEthernet0/0/1]ip address 56.1.1.2 24
[R6]interface LoopBack 0
[R6-LoopBack0]ip address 6.6.6.6 255.255.255.255
[R6-LoopBack0]ospf
[R6-ospf-1]area 2
[R6-ospf-1-area-0.0.0.2]network 6.6.6.6 0.0.0.0
[R6-ospf-1-area-0.0.0.2]network 123.1.1.0 0.0.0.255
[R6-ospf-1-area-0.0.0.2]network 56.1.1.0 0.0.0.255
[R6]interface g0/0/1
[R6-GigabitEthernet0/0/1]ospf authentication-mode simple cipher 666
[R6-GigabitEthernet0/0/1]ospf authentication-mode md5