实验要求:
分析配置以及拓扑:
配置:
首先进行所有的ip配置
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 172.16.0.1 20
[r3]int s4/0/0
[r3-Serial4/0/0]ip add 14.1.1.1 24
[r3]int loop 0
[r3-LoopBack0]ip add 172.16.48.1 20
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 172.16.0.2 20
[r1-GigabitEthernet0/0/0]int loop 0
[r1-LoopBack0]ip add 172.16.16.1 20
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 172.16.0.3 20
[r2-GigabitEthernet0/0/0]
[r2-GigabitEthernet0/0/0]int loop 0
[r2-LoopBack0]ip add 172.16.32.1 20
[r7]int s4/0/0
[r7-Serial4/0/0]ip add 44.1.1.1 24
[r7-Serial4/0/0]int g0/0/1
[r7-GigabitEthernet0/0/1]ip add 172.16.72.1 21
[r7-GigabitEthernet0/0/1]int loop 0
[r7-LoopBack0]ip add 172.16.64.1 21
[r8]int g0/0/0
[r8-GigabitEthernet0/0/0]ip add 172.16.72.2 21
[r8-GigabitEthernet0/0/0]int g0/0/1
[r8-GigabitEthernet0/0/1]ip add 172.16.88.1 21
[r8-GigabitEthernet0/0/1]int loop 0
[r8-LoopBack0]ip add 172.16.80.1 21
[r9]int g0/0/0
[r9-GigabitEthernet0/0/0]ip add 172.16.88.2 21
[r9-GigabitEthernet0/0/0]int g0/0/1
[r9-GigabitEthernet0/0/1]ip add 172.16.104.1 21
[r9-GigabitEthernet0/0/1]int loop 0
[r9-LoopBack0]ip add 172.16.96.1 21
[r10]int g0/0/0
[r10-GigabitEthernet0/0/0]ip add 172.16.104.2 21
[r10-GigabitEthernet0/0/0]int loop 0
[r10-LoopBack0]ip add 172.16.112.1 21
[r5]int s4/0/0
[r5-Serial4/0/0]ip add 24.1.1.1 24
[r5-Serial4/0/0]int loop 0
[r5-LoopBack0]ip add 172.16.128.1 18
[r6]int s4/0/0
[r6-Serial4/0/0]ip add 34.1.1.1 24
[r6-Serial4/0/0]int g0/0/1
[r6-GigabitEthernet0/0/1]ip add 172.16.200.1 21
[r6-GigabitEthernet0/0/1]int loop 0
[r6-LoopBack0]ip add 172.16.192.1 21
[r11]int g0/0/0
[r11-GigabitEthernet0/0/0]ip add 172.16.200.2 21
[r11-GigabitEthernet0/0/0]int g0/0/1
[r11-GigabitEthernet0/0/1]ip add 172.16.216.1 21
[r11-GigabitEthernet0/0/1]int loop 0
[r11-LoopBack0]ip add 172.16.208.1 21
[r12]int g0/0/0
[r12-GigabitEthernet0/0/0]ip add 172.16.216.2 21
[r12-GigabitEthernet0/0/0]int loop 0
[r12-LoopBack0]ip add 172.16.232.1 21
[r12-LoopBack0]int loop 1
[r12-LoopBack1]ip add 172.16.240.1 21
[ISP]int s2/0/0
[ISP-Serial2/0/0]ip add 14.1.1.2 24
[ISP-Serial2/0/0]
[ISP-Serial2/0/0]int s2/0/1
[ISP-Serial2/0/1]ip add 24.1.1.2 24
[ISP-Serial2/0/1]
[ISP-Serial2/0/1]int s4/0/0
[ISP-Serial4/0/0]ip add 34.1.1.2 24
[ISP-Serial4/0/0]
[ISP-Serial4/0/0]int s4/0/1
[ISP-Serial4/0/1]ip add 44.1.1.2 24
[ISP-Serial4/0/1]
[ISP]int loop 0
[ISP-LoopBack0]ip add 2.2.2.2 24
然后配置MGRE环境:
[r3]int t0/0/0
[r3-Tunnel0/0/0]ip add 10.1.1.1 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 14.1.1.1
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r5]int t0/0/0
[r5-Tunnel0/0/0]ip add 10.1.1.2 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source 24.1.1.1
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 10.1.1.1 14.1.1.1 register
[r7]int t0/0/0
[r7-Tunnel0/0/0]ip add 10.1.1.3 24
[r7-Tunnel0/0/0]tunnel-protocol gre p2mp
[r7-Tunnel0/0/0]source 44.1.1.1
[r7-Tunnel0/0/0]nhrp network-id 100
[r7-Tunnel0/0/0]nhrp entry 10.1.1.1 14.1.1.1 register
[r6]int t0/0/0
[r6-Tunnel0/0/0]ip add 10.1.1.4 24
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source 34.1.1.1
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]nhrp entry 10.1.1.1 14.1.1.1 register
然后配置缺省路由:
[r3]ip route-static 0.0.0.0 0 14.1.1.2
[r5]ip route-static 0.0.0.0 0 24.1.1.2
[r6]ip route-static 0.0.0.0 0 34.1.1.2
[r7]ip route-static 0.0.0.0 0 44.1.1.2
然后写OSPF:
其他同理
[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.0.0 0.0.255.255
[r1-ospf-1-area-0.0.0.1]network 172.16.16.0 0.0.0.255
area1位末梢区域
[r1-ospf-1-area-0.0.0.1]stub
[r2-ospf-1-area-0.0.0.1]stub
[r3-ospf-1-area-0.0.0.1]stub
area3位nass区域
[r9-ospf-1]area 3
[r9-ospf-1-area-0.0.0.1]nssa
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.1]nssa no-summary
最后进行测试: