一、子网划分
172.16.0.0/16(总网)
172.16.0.0/19 (A0区域)
172.16.32.0/19 (A1区域)
172.16.64.0/19 (A2区域)
172.16.96.0/19 (A3区域)
172.16.128.0/19 (A4区域)
172.16.160.0/19 (rip区域)
172.16.196.0/19
172.16.228.0/19
A0区域划分:172.16.0.0/19
172.16.0.0/30 P2P网络
172.16.0.128/ MA网络
172.16.1.0/25 172.16.1.128/25 --------172.16.31.128/25 终端
A1区域划分:172.16.32.0/19
172.16.32.0/30 p2p网络
172.16.32.128/29 MA网络
172.16.33.0/25 ---------- 172.16.63.128/25 终端
A2区域划分:172.16.64.0/19
172.16.64.0/30 p2p网络
172.16.64.128/30 MA网络
172.16.65.1/30----------- 172.16.95.128/30 终端
A3区域划分:172.16.96.0/19
172.16.96.0/30 P2P网络
172.16.96.128/29 MA 网络
172.16.97.0/25 终端
A4区域划分:172.16.128.0/19
172.16.128.0/30 P2P网络
172.16.128.128/29 MA 网络
172.16.129.0/25 终端
A5区域划分:172.16.160.0/19
172.16.160.0/20
176.16.176.0/20
二、配置ISP路由及构建MGRE环境:
[Huawei]sys r3
[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 10.1.34.3 24
[r3]ip route-static 0.0.0.0 0 10.1.34.4
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add 172.16.0.129 29
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 10.1.34.3
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]ospf network-type broadcast
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 10.1.34.4 24
[r4-GigabitEthernet0/0/0]int g2/0/0
[r4-GigabitEthernet2/0/0]ip add 10.1.45.4 24
[r4-GigabitEthernet2/0/0]int g0/0/2
[r4-GigabitEthernet0/0/2]ip add 10.1.46.4 24.
[r4-GigabitEthernet0/0/2]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 10.1.47.4 24
[r4-GigabitEthernet0/0/1]int lo0
[r4-LoopBack0]ip add 4.4.4.4 24
[r4-LoopBack0]q
[r5]int g0/0/1
[r5-GigabitEthernet0/0/1]ip add 10.1.45.5 24
[r5]ip route-static 0.0.0.0 0 10.1.45.4
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]ip add 172.16.0.130 29
[r5-Tunnel0/0/0]source GigabitEthernet 0/0/1
[r5-Tunnel0/0/0]nhrp entry 172.16.0.129 10.1.34.3 register
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]ospf network-type broadcast
[r5-Tunnel0/0/0]ospf dr-priority 0
[r6]int g0/0/1
[r6-GigabitEthernet0/0/1]ip add 10.1.46.6 24
[r6]ip route-static 0.0.0.0 0 10.1.46.4
[r6]int Tunnel 0/0/0
[r6-Tunnel0/0/0]ip add 172.16.0.131 29
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source g0/0/1
[r6-Tunnel0/0/0]nhrp entry 172.16.0.129 10.1.34.3 register
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]ospf network-type broadcast
[r6-Tunnel0/0/0]ospf dr-priority 0
三、配置其他地址及ospf认证
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 172.16.32.129 29
[r1-LoopBack0]ip add 172.16.33.1 25
[r1-LoopBack0]q
[r1]ospf 1 r
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]network 172.16.32.129 0.0.0.0
[r1-ospf-1-area-0.0.0.1]network 172.16.33.1 0.0.0.0
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 172.16.32.130 29
[r2-GigabitEthernet0/0/1]int lo0
[r2-LoopBack0]ip add 172.16.33.129 25
[r2-LoopBack0]q
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]network 172.16.32.130 0.0.0.0
[r2-ospf-1-area-0.0.0.1]network 172.16.33.
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 172.16.32.131 29
[r3-GigabitEthernet0/0/0]int lo0
[r3-LoopBack0]ip add 172.16.34.1 25
[r3-LoopBack0]q
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 172.16.32.131
[r5-Tunnel0/0/0]int lo0
[r5-LoopBack0]ip add 172.16.1.1 25
[r5-LoopBack0]q
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1-area-0.0.0.0]network 172.16.1.1 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 172.16.0.130 0.0.0.0
[r6-Tunnel0/0/0]int lo0
[r6-LoopBack0]ip add 172.16.1.129 25
[r6-LoopBack0]q
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 172.16.1.129 0.0.0.0
[r6-ospf-1-area-0.0.0.0]network 172.16.0.131 0.0.0.0
[r6-ospf-1-area-0.0.0.0]q
[r6-ospf-1]int g0/0/0
[r6-GigabitEthernet0/0/0]ip add 172.16.64.1 30
[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]network 172.16.64.1 0.0.0.0
[r7]int lo0
[r7-LoopBack0]ip add 172.16.2.1 25
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]area 0
[r7-ospf-1-area-0.0.0.0]network 172.16.2.1 0.0.0.0
[r7-ospf-1-area-0.0.0.0]ne
[r7-ospf-1-area-0.0.0.0]network 172.16.0.132 0.0.0.0
[r7]int g0/0/0
[r7-GigabitEthernet0/0/0]ip add 172.16.96.1 30
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]network 172.16.96.1 0.0.0.0
r8]int g0/0/01
[r8-GigabitEthernet0/0/1]ip add 172.16.96.2 30
[r8-GigabitEthernet0/0/1]int g0/0/0
[r8-GigabitEthernet0/0/0]ip add 172.16.96.5 30
[r8-GigabitEthernet0/0/0]int lo0
[r8-LoopBack0]ip add 172.16.97.1 25
[r8]ospf 1 router-id 8.8.8.8
[r8-ospf-1]area 3
[r8-ospf-1-area-0.0.0.3]network 172.16.96.0 0.0.1.255
[r9]int g0/0/1
[r9-GigabitEthernet0/0/1]ip add 172.16.96.6 30
[r9]ospf 1 router-id 9.9.9.9
[r9-ospf-1]area 3
[r9-ospf-1-area-0.0.0.3]network 172.16.96.6 0.0.0.0
[r9-ospf-1-area-0.0.0.3]q
[r9]int g0/0/0
[r9-GigabitEthernet0/0/0]ip add 172.16.128.1 30
[r9-GigabitEthernet0/0/0]int lo0
[r9-LoopBack0]ip add 172.16.129.1 25
[r9]ospf 2 router-id 9.9.9.9
[r9-ospf-2]area 4
[r9-ospf-2-area-0.0.0.4]network 172.16.128.0 0.0.1.255
[r10]int g0/0/1
[r10-GigabitEthernet0/0/1]ip add 172.16.128.2 30
[r10-GigabitEthernet0/0/1]int lo0
[r10-LoopBack0]ip add 172.16.129.129 25
[r10-LoopBack0]q
[r10]ospf 2 router-id 10.10.10.10
[r10-ospf-2]ne
[r10-ospf-2]area 4
[r10-ospf-2-area-0.0.0.4]network 172.16.128.0 0.0.1.255
[r11]int g0/0/1
[r11-GigabitEthernet0/0/1]ip add 172.16.64.2 30
[r11-GigabitEthernet0/0/1]int g0/0/0
[r11-GigabitEthernet0/0/0]ip add 172.16.64.5 30
[r11-GigabitEthernet0/0/0]q
[r11]int lo0
[r11-LoopBack0]ip add 172.16.65.1 25
[r11-LoopBack0]q
[r11]ospf 1 router-id 11.11.11.11
[r11-ospf-1-area-0.0.0.2]network 172.16.64.0 0.0.1.255
[r12]int g0/0/1
[r12-GigabitEthernet0/0/1]ip add 172.16.64.6 30
[r12]int g0/0/1
[r12-GigabitEthernet0/0/1]q
[r12]ospf 1 router-id 12.12.12.12
[r12-ospf-1]area 2
[r12-ospf-1-area-0.0.0.2]network 172.16.64.6 0.0.0.0
四、重发布
[r12]int lo0
[r12-LoopBack0]ip add 172.16.160.1 20
[r12-LoopBack0]int lo1
[r12-LoopBack1]ip add 172.16.176.1 20
[r12-LoopBack1]q
[r12]rip 1
[r12-rip-1]version 2
[r12-rip-1]network 172.16.0.0
[r12-rip-1]ospf 1
[r12-ospf-1]import-route rip
[r9]ospf 1
[r9-ospf-1]import-route ospf 2
[r9-ospf-1]q
[r9]ospf 2
[r9-ospf-2]import-route ospf 1
五、特殊区域
[R6]ospf
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]nssa
[R11]ospf
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]nssa
[R12]ospf
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]nssa no-summary
[R7]ospf
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]stub
[R8]ospf
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]stub
[R9]ospf 1
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]stub no-summary
[R9]ospf 2
[R9-ospf-2]default-route-advertise
六、路由汇总
[R3]ospf
[R3-ospf-1] a 1
[R3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
[R6]ospf
[R6-ospf-1] a 2
[R6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
[R7]ospf
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]abr-summary 172.168.96.0 255.255.224.0
[R9]ospf
[R9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
[R12]ospf
[R12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
七、空接口防环
[R3]ip route-static 172.16.32.0 255.255.224.0 NULL 0
[R6]ip route-static 172.16.64.0 255.255.224.0 NULL 0
[R7]ip route-static 172.16.96.0 255.255.224.0 NULL 0
[R9]ip route-static 172.16.128.0 255.255.224.0 NULL 0
[R12]ip route-static 172.16.160.0 255.255.224.0 NULL 0
八、安全认证(其他端如下图)
[R3]OSPF
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
九、NAT配置
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R3-acl-basic-2000]q
[R3]int s 4/0/0
[R3-Serial4/0/0]nat outbound 2000
[R7]acl 2000
[R7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R7-acl-basic-2000]q
[R7]int g 0/0/0
[R7-GigabitEthernet0/0/0]nat outbound 2000
至此,实验结束。