实验题目如下:
实验拓扑如下:
实验要求如下:
【1】R4为ISP,其上只能配置IP地址: R4与其他所有直连设备间使用公有
【2】R3---R5/6/7为MGRE环境,R3为中心站点
【3】整个OSPF环境IP地址为172.16.0.0/16
【4】所有设备均可访问R4的环回
【5】减少LSA的更新量,加快收敛,保障更新安全
【6】全网可达
实验思路如下:
(1)子网划分,一个区域一个网段
(2)合理的IP配置
(3)配置MGRE环境
(4)配置OSPF、RIP
实验步骤如下:
1、合理IP配置
指令如下:
R1:
[R1-LoopBack0]ip add 172.16.48.1 21
[R1-LoopBack0]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 172.16.32.2 21
R2:
[R2-LoopBack0]ip add 172.16.56.1 21
[R2-LoopBack0]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 172.16.32.3 21
R3:
[R3-LoopBack0]ip add 172.16.40.1 21
[R3-LoopBack0]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 34.1.1.1 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 172.16.32.1 21
R4:
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 34.1.1.2 24
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 54.1.1.2 24
[R4-GigabitEthernet0/0/1]int g0/0/2
[R4-GigabitEthernet0/0/2]ip add 64.1.1.2 24
[R4-GigabitEthernet0/0/2]int g9/0/0
[R4-GigabitEthernet9/0/0]ip add 74.1.1.2 24
[R4-GigabitEthernet9/0/0]int l0
[R4-LoopBack0]ip add 172.16.16.1 21
R5:
[R5-LoopBack0]ip add 172.16.8.1 21
[R5-LoopBack0]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 54.1.1.1 24
R6:
[R6-LoopBack0]ip add 172.16.24.1 22
[R6-LoopBack0]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 64.1.1.1 24
[R6-GigabitEthernet0/0/0]int g0/0/1
[R6-GigabitEthernet0/0/1]ip add 172.16.64.1 21
R7:
[R7-LoopBack0]ip add 172.16.28.1 22
[R7-LoopBack0]int g0/0/0
[R7-GigabitEthernet0/0/0]ip add 74.1.1.1 24
[R7-GigabitEthernet0/0/0]int g0/0/1
[R7-GigabitEthernet0/0/1]ip add 172.16.96.1 21
R8:
[R8-GigabitEthernet0/0/0]ip add 172.16.96.2 21
[R8-GigabitEthernet0/0/0]int g0/0/1
[R8-GigabitEthernet0/0/1]ip add 172.16.104.1 21
[R8-GigabitEthernet0/0/1]int l0
[R8-LoopBack0]ip add 172.16.112.1 21
R9:
[R9-GigabitEthernet0/0/0]ip add 172.16.104.2 21
[R9-GigabitEthernet0/0/0]int g0/0/1
[R9-GigabitEthernet0/0/1]ip add 172.16.128.1 21
[R9-GigabitEthernet0/0/1]int l0
[R9-LoopBack0]ip add 172.16.136.1 21
R10:
[R10-GigabitEthernet0/0/0]ip add 172.16.128.2 21
[R10-GigabitEthernet0/0/0]int l0
[R10-LoopBack0]ip add 172.16.144.1 21
R11:
[R11-GigabitEthernet0/0/0]ip add 172.16.64.2 21
[R11-GigabitEthernet0/0/0]int g0/0/1
[R11-GigabitEthernet0/0/1]ip add 172.16.72.1 21
[R11-GigabitEthernet0/0/1]int l0
[R11-LoopBack0]ip add 172.16.80.1 21
R12:
[R12-GigabitEthernet0/0/0]ip add 172.16.72.2 21
[R12-GigabitEthernet0/0/0]int l0
[R12-LoopBack0]ip add 12.1.1.1 24
[R12-LoopBack0]int l1
[R12-LoopBack1]ip add 12.1.2.1 24
2、缺省路由的配置
指令如下:
R1:
[R1]ip route-static 0.0.0.0 0 172.16.32.1
R2:
[R2]ip route-static 0.0.0.0 0 172.16.32.1
R3:
[R3]ip route-static 0.0.0.0 0 34.1.1.2
R5:
[R5]ip route-static 0.0.0.0 0 54.1.1.2
R6:
[R6]ip route-static 0.0.0.0 0 64.1.1.2
R7:
[R7]ip route-static 0.0.0.0 0 74.1.1.2
R8:
[R8]ip route-static 0.0.0.0 0 172.16.96.1
R9:
[R9]ip route-static 0.0.0.0 0 172.16.104.1
R10:
[R10]ip route-static 0.0.0.0 0 172.16.128.1
R11:
[R11]ip route-static 0.0.0.0 0 172.16.64.1
3、NAT的配置
指令如下:
R3:
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R3-acl-basic-2000]int g0/0/0
[R3-GigabitEthernet0/0/0]nat outbound 2000
R5:
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 172.16.8.0 0.0.7.255
[R5-acl-basic-2000]int g0/0/0
[R5-GigabitEthernet0/0/0]nat outbound 2000
R6:
[R6]acl 2000
[R6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R6-acl-basic-2000]int g0/0/0
[R6-GigabitEthernet0/0/0]nat outbound 2000
R7:
[R7]acl 2000
[R7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R7-acl-basic-2000]int g0/0/0
[R7-GigabitEthernet0/0/0]nat outbound 2000
4、MGRE配置
指令如下:
R3:
[R3]int tu 0/0/0
[R3-Tunnel0/0/0]ip add 172.16.0.1 21
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source 34.1.1.1
[R3-Tunnel0/0/0]nhrp entry multicast dynamic
[R3-Tunnel0/0/0]nhrp network-id 100
R5:
[R5]int tu 0/0/0
[R5-Tunnel0/0/0]ip add 172.16.0.2 21
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]source g0/0/0
[R5-Tunnel0/0/0]nhrp entry 172.16.0.1 34.1.1.1 register
[R5-Tunnel0/0/0]nhrp network-id 100
R6:
[R6]int tu 0/0/0
[R6-Tunnel0/0/0]ip add 172.16.0.3 21
[R6-Tunnel0/0/0]tunnel-protocol gre p2mp
[R6-Tunnel0/0/0]source g0/0/0
[R6-Tunnel0/0/0]nhrp entry 172.16.0.1 34.1.1.1 register
[R6-Tunnel0/0/0]nhrp network-id 100
R7:
[R7]int tu 0/0/0
[R7-Tunnel0/0/0]ip add 172.16.0.4 21
[R7-Tunnel0/0/0]tunnel-protocol gre p2mp
[R7-Tunnel0/0/0]source g0/0/0
[R7-Tunnel0/0/0]nhrp entry 172.16.0.1 34.1.1.1 register
[R7-Tunnel0/0/0]nhrp network-id 100
5、OSPF的配置
指令如下:
R1:
[R1]ip route-static 0.0.0.0 0 172.16.32.1
[R1]ospf 1 router-id 5.5.5.5
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.255
[R1-ospf-1-area-0.0.0.1]network 172.16.48.0 0.0.7.255
R2:
[R2]ospf 1 router-id 6.6.6.6
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.255
[R2-ospf-1-area-0.0.0.1]network 172.16.56.0 0.0.7.255
R3:
[R3]ospf 1 router-id 1.1.1.1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.7.255
[R3-ospf-1-area-0.0.0.0]q
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 172.16.40.0 0.0.7.255
[R3-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.255
R5:
[R5]ospf 1 router-id 2.2.2.2
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.7.255
[R5-ospf-1-area-0.0.0.0]network 172.16.8.0 0.0.7.255
[R5-ospf-1-area-0.0.0.0]int tu 0/0/0
[R5-Tunnel0/0/0]ospf network-type broadcast
[R5-Tunnel0/0/0]ospf dr-priority 0
R6:
[R6]ospf 1 router-id 3.3.3.3
[R6-ospf-1]area 0
[R6-ospf-1-area-0.0.0.0]network 172.16.24.0 0.0.3.255
[R6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.7.255
[R6-ospf-1-area-0.0.0.0]q
[R6-ospf-1]area 2
[R6-ospf-1-area-0.0.0.2]network 172.16.64.0 0.0.7.255
[R6-ospf-1-area-0.0.0.2]int tu 0/0/0
[R6-Tunnel0/0/0]ospf network-type broadcast
[R6-Tunnel0/0/0]ospf dr-priority 0
R7:
[R7]ospf 1 router-id 4.4.4.4
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]network 172.16.28.0 0.0.3.255
[R7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.7.255
[R7-ospf-1-area-0.0.0.0]q
[R7-ospf-1]area 3
[R7-ospf-1-area-0.0.0.3]network 172.16.96.0 0.0.7.255
[R7-ospf-1-area-0.0.0.3]int tu 0/0/0
[R7-Tunnel0/0/0]ospf network-type broadcast
[R7-Tunnel0/0/0]ospf dr-priority 0
R8:
[R8]ospf 1 router-id 9.9.9.9
[R8-ospf-1]area 3
[R8-ospf-1-area-0.0.0.3]network 172.16.112.0 0.0.7.255
[R8-ospf-1-area-0.0.0.3]network 172.16.104.0 0.0.7.255
[R8-ospf-1-area-0.0.0.3]network 172.16.96.0 0.0.7.255
R9:
[R9]ospf 1 router-id 10.10.10.10
[R9-ospf-1]area 3
[R9-ospf-1-area-0.0.0.3]network 172.16.104.0 0.0.7.255
[R9-ospf-1-area-0.0.0.3]q
[R9-ospf-1]q
[R9]ospf 2 router-id 11.11.11.11
[R9-ospf-2]area 4
[R9-ospf-2-area-0.0.0.4]network 172.16.128.0 0.0.7.255
[R9-ospf-2-area-0.0.0.4]network 172.16.136.0 0.0.7.255
R10:
[R10]ospf 2 router-id 12.12.12.12
[R10-ospf-2]area 4
[R10-ospf-2-area-0.0.0.4]network 172.16.144.0 0.0.7.255
[R10-ospf-2-area-0.0.0.4]network 172.16.128.0 0.0.7.255
R11:
[R11]ospf 1 router-id 7.7.7.7
[R11-ospf-1]area 2
[R11-ospf-1-area-0.0.0.2]network 172.16.80.0 0.0.7.255
[R11-ospf-1-area-0.0.0.2]network 172.16.72.0 0.0.7.255
[R11-ospf-1-area-0.0.0.2]network 172.16.64.0 0.0.7.255
R12:
[R12]ospf 1 router-id 8.8.8.8
[R12-ospf-1]area 2
[R12-ospf-1-area-0.0.0.2]network 172.16.72.0 0.0.7.255
[R12]rip 1
[R12-rip-1]version 2
[R12-rip-1]network 12.0.0.0
[R12-rip-1]import-route ospf 1
6、测试如下:
R1:
R3:
R12:
R9:
R10: