实验要求
1、R6为ISP只能配置IP地址,R1-R5的环回为私有网段。
2、R1/4/5为全连的MGRE结构,R1/2/3为星型的拓扑结构,R1为中心站点。
3、所有私有网段可以相互通讯,私有网段使用OSPF完成。
实验步骤
配置IP地址
R1
0/0/0接口:16.0.0.1/24
0/0/1接口:16.0.1.1/24
环回0:192.168.1.1/24
R2
0/0/0接口:26.0.0.1/24
环回0:192.168.2.1/24
R3
0/0/0接口:36.0.0.1/24
环回0:192.168.3.1/24
R4
0/0/0接口:46.0.0.1/24
环回0:192.168.4.1/24
R5
0/0/0接口:56.0.0.1/24
环回0:192.168.5.1/24
R6
0/0/0接口:16.0.0.2/24
0/0/1接口:16.0.1.2/24
0/0/2接口:56.0.0.2/24
2/0/0接口:26.0.0.2/24
3/0/0接口:36.0.0.2/24
4/0/0接口:46.0.0.2/24
配置r1-R5的缺省路由
R1配置:
[r1]ip route-static 0.0.0.0 0 16.0.0.2
[r1]ip route-static 0.0.0.0 0 16.0.1.2
R2配置:
[r2]ip route-static 0.0.0.0 0 26.0.0.2
R3配置:
[r3]ip route-static 0.0.0.0 0 36.0.0.2
R4配置:
[r4]ip route-static 0.0.0.0 0 46.0.0.2
R5配置:
[r5]ip route-static 0.0.0.0 0 56.0.0.2
配置R1/4/5为全连的MGRE结构
R1配置:
[r1]int t 0/0/0
[r1-Tunnel0/0/0]ip add 192.168.6.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 16.0.1.1
[r1-Tunnel0/0/0]nhrp network-id 100 //定义域的大小
[r1-Tunnel0/0/0]nhrp entry 192.168.6.3 56.0.0.1 register
[r1-Tunnel0/0/0]nhrp entry 192.168.6.2 46.0.0.1 register
[r1-Tunnel0/0/0]nhrp entry multicast dynamic //开启伪广播
R4配置:
[r4]int t 0/0/0
[r4-Tunnel0/0/0]ip add 192.168.6.2 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source 46.0.0.1
[r4-Tunnel0/0/0]nhrp network-id 100 //定义域的大小
[r4-Tunnel0/0/0]nhrp entry 192.168.6.1 16.0.1.1 register
[r4-Tunnel0/0/0]nhrp entry 192.168.6.3 56.0.0.1 register
[r4-Tunnel0/0/0]nhrp entry multicast dynamic //开启伪广播
R5配置:
[r5]int t 0/0/0
[r5-Tunnel0/0/0]ip add 192.168.6.3 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source 56.0.0.1
[r5-Tunnel0/0/0]nhrp network-id 100 //定义域的大小
[r5-Tunnel0/0/0]nhrp entry 192.168.6.1 16.0.1.1 register
[r5-Tunnel0/0/0]nhrp entry 192.168.6.2 46.0.0.1 register
[r5-Tunnel0/0/0]nhrp entry multicast dynamic //开启伪广播
配置R1/2/3为星型的拓扑结构
R1配置:
[r1]int t 0/0/1
[r1-Tunnel0/0/1]ip add 192.168.7.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 16.0.0.1
[r1-Tunnel0/0/1]nhrp network-id 101
[r1-Tunnel0/0/1]nhrp entry multicast dynamic //开启伪广播
R2配置:
[r2]int t 0/0/0
[r2-Tunnel0/0/0]ip add 192.168.7.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r2-Tunnel0/0/0]nhrp network-id 101
[r2-Tunnel0/0/0]nhrp entry 192.168.7.1 16.0.0.1 register //找中心站点注册
R3配置:
[r3]int t 0/0/1
[r3-Tunnel0/0/1]ip add 192.168.7.3 24
[r3-Tunnel0/0/1]tunnel-protocol gre p2mp
[r3-Tunnel0/0/1]source GigabitEthernet 0/0/0
[r3-Tunnel0/0/1]nhrp network-id 101
[r3-Tunnel0/0/1]nhrp entry 192.168.7.1 16.0.0.1 register //找中心站点注册
配置OSPF,是私有网段互相通讯
R1配置:
[r1]ospf 1 router-id 1.1.1.1 //开启OSPF进程
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]q
[r1-ospf-1]q
[r1]int t 0/0/0
[r1-Tunnel0/0/0]ospf network-type broadcast //更改Tunnel接口类型
[r1]int t 0/0/1
[r1-Tunnel0/0/1]ospf network-type broadcast //更改Tunnel接口类型
[r1-Tunnel0/0/1]ospf dr-priority 10
R2配置:
[r2]ospf 1 router-id 2.2.2.2 //开启OSPF进程
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]q
[r2-ospf-1]q
[r2]int t 0/0/0
[r2-Tunnel0/0/0]ospf network-type broadcast //更改Tunnel接口类型
R3配置:
[r3]ospf 1 router-id 3.3.3.3 //开启OSPF进程
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]q
[r3-ospf-1]q
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ospf network-type broadcast //更改Tunnel接口类型
R4配置:
[r4]ospf 1 router-id 4.4.4.4 //开启OSPF进程
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]q
[r4-ospf-1]q
[r4]int t 0/0/0
[r4-Tunnel0/0/0]ospf network-type broadcast //更改Tunnel接口类型
R5配置:
[r5]ospf 1 router-id 5.5.5.5 //开启OSPF进程
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]q
[r5-ospf-1]q
[r5]int t 0/0/0
[r5-Tunnel0/0/0]ospf network-type broadcast //更改Tunnel接口类型
实验结果
R1 ping R2环回:
R1 ping R4环回:
R1 ping R5环回:
R2 ping R3环回:
R2 ping R5环回:
R4 ping R5环回: