一、实验要求
1、R6为ISP只能配置ip地址,R1-5的环回为私有网段
2、R1/4/5为全连的MGRE结构,R1/2/3为星型的拓扑结构,R1为中心站点
3、所有私有网段可以互相通讯,私有网段使用OSPF协议完成
二、拓扑图
三、实验思路
1.配置所有接口及各个私有环回地址
2.在各个路由器上写上其指向r6的缺省路由,使公网路由可以通顺
3.搭建MGRE(R1/4/5全连的MGRE结构-都是中心站点也是分支站点。R1/2/3星型的拓扑结构-R1为中心站点,R2/3被认证方)
4.使用ospf宣告实现全网可达(R1/2/3网络类型设置P2MP,R1/4/5设置为broadcast)
四、用到的指令(1是r1r2r3之间 2是r1r4r5之间)
1.
(1).
r1:
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 16.1.1.1
[r1]interface t0/0/0
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
r2:
interface Tunnel 0/0/0
[r2-Tunnel0/0/0]ip address 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 16.1.1.1 register
r3:
interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 10.1.1.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 16.1.1.1 register
(2).
r1:
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[r1]int t0/0/0
[r1-Tunnel0/0/0]ospf network-type broadcast
r2:
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.2.1 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 10.1.1.2 0.0.0.0
[r2]int t0/0/0
[r2-Tunnel0/0/0]ospf network-type broadcast
[r2-Tunnel0/0/0]ospf dr-priority 0
r3:
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 192.168.3.1 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 10.1.1.3 0.0.0.0
[r3]int t0/0/0
[r3-Tunnel0/0/0]ospf network-type broadcast
[r3-Tunnel0/0/0]ospf dr-priority 0
2.
(1)
r1:
[r1]interface t0/0/1
[r1-Tunnel0/0/1]ip address 10.1.2.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 61.1.1.1
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
r4:
[r4]interface t0/0/1
[r4-Tunnel0/0/1]ip address 10.1.2.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre p2mp
[r4-Tunnel0/0/1]source 46.1.1.1
[r4-Tunnel0/0/1]nhrp entry 10.1.2.1 61.1.1.1 register
[r4-Tunnel0/0/1]nhrp entry 10.1.2.3 56.1.1.1 register
r5:
[r5]interface t0/0/1
[r5-Tunnel0/0/1]ip address 10.1.2.3 24
[r5-Tunnel0/0/1]tunnel-protocol gre p2mp
[r5-Tunnel0/0/1]source 56.1.1.1
[r5-Tunnel0/0/1]nhrp entry 10.1.2.1 61.1.1.1 register
[r5-Tunnel0/0/1]nhrp entry multicast dynamic
(2)
r1:
[r1]ospf 1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 10.1.2.1 0.0.0.0
[r1]interface t0/0/1
[r1-Tunnel0/0/1]ospf network-type broadcast
r4:
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]network 10.1.2.2 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 192.168.4.1 0.0.0.0
[r4]interface t0/0/1
[r4-Tunnel0/0/1]ospf network-type broadcast
r5:
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 10.1.2.3 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 192.168.5.1 0.0.0.0
[r5]interface t0/0/1
[r5-Tunnel0/0/1]ospf network-type broadcast
五、各个路由器配置汇总
r1:
r2:
r3:
r4:
r5:
r6:
六、结果