MGRE,OSPF综合实验

本文档详细介绍了如何配置路由器R1、R4和R5的GRE隧道,以实现全连接MGRE结构,并通过OSPF确保所有私有网段间的互通。R1作为中心节点,R2和R3作为支点,利用NHRP进行动态注册。所有路由器配置了默认路由指向ISP路由器R6,并关闭并重新启用Tunnel接口以确保正常运行。

1.R6为ISP只能配置IP地址,R1-R5环回私有网段

2.R1/4/5为全连 的MGRE结构,R1/2/3为星形拓扑,R1为中心

3.所有私网网段可以互相通讯,基于OSPF完成 

1.各个接口配置

2.所有路由器写缺省指向R6

[r1]ip route-static 0.0.0.0 0 11.0.0.2

[r1]ip route-static 0.0.0.0 0 12.0.0.2

[r3]ip route-static 0.0.0.0 0 13.0.0.2

[r3]ip route-static 0.0.0.0 0 14.0.0.2

[r4]ip route-static 0.0.0.0 0 15.0.0.2

[r5]ip route-static 0.0.0.0 0 16.0.0.2

3.创建MGRE隧道,但是要关闭接口,否则无法进行站点相互寻找

[r1-Tunnel0/0/1]shutdown

[r1-Tunnel0/0/1]ip address 192.168.6.1 24  

[r1-Tunnel0/0/1]tunnel-protocol gre p2mp

[r1-Tunnel0/0/1]source 11.0.0.1

[r1-Tunnel0/0/1]nhrp network-id 100

[r1-Tunnel0/0/1]nhrp entry 192.168.6.2 15.0.0.1 register

[r1-Tunnel0/0/1]nhrp entry 192.168.6.3 16.0.0.1 register

[r4-Tunnel0/0/1]shutdown

[r4-Tunnel0/0/1]ip address 192.168.6.2 24

[r4-Tunnel0/0/1]tunnel-protocol gre p2mp

[r4-Tunnel0/0/1]source 15.0.0.1

[r4-Tunnel0/0/1]nhrp network-id 100

[r4-Tunnel0/0/1]nhrp entry 192.168.6.1 11.0.0.1 register

[r4-Tunnel0/0/1]nhrp entry 192.168.6.3 16.0.0.1 register

[r5-Tunnel0/0/1]shutdown 

[r5-Tunnel0/0/1]ip address 192.168.6.3 24

[r5-Tunnel0/0/1]tunnel-protocol gre p2mp

[r5-Tunnel0/0/1]shutdown

[r5-Tunnel0/0/1]source 16.0.0.1

[r5-Tunnel0/0/1]nhrp entry 192.168.6.1 11.0.0.1 register

[r5-Tunnel0/0/1]nhrp entry 192.168.6.2 15.0.0.1 register

打开T接口

[r1]display nhrp peer interface tunnel 0/0/1

[r4]display nhrp peer interface tunnel 0/0/1

[r5]display nhrp peer interface tunnel 0/0/1

4.R1为中心,R2/R3作支点

[r1-Tunnel0/0/0]ip address 192.168.7.1 24

[r1-Tunnel0/0/0]tunnel-protocol gre p2mp

[r1-Tunnel0/0/0]nhrp network-id 101

[r1-Tunnel0/0/0]nhrp entry multicast dynamic

[r1-Tunnel0/0/0]source 12.0.0.1

[r3-Tunnel0/0/0]ip address 192.168.7.2 24

[r3-Tunnel0/0/0]tunnel-protocol gre p2mp

[r3-Tunnel0/0/0]nhr

[r3-Tunnel0/0/0]nhrp nr

[r3-Tunnel0/0/0]nhrp ne

[r3-Tunnel0/0/0]nhrp network-id 101

[r3-Tunnel0/0/0]nhrp entry 192.168.7.1 12.0.0.1 register

[r3-Tunnel0/0/0]ospf dr-priority 0

[r3-Tunnel0/0/0]source g0/0/0

[r3-Tunnel0/0/0]ip address 192.168.7.3 24

[r3-Tunnel0/0/0]tunnel-protocol gre p2mp

[r3-Tunnel0/0/0]source g0/0/0

[r3-Tunnel0/0/0]nhrp network-id 101

[r3-Tunnel0/0/0]nhrp entry 192.168.7.1 12.0.0.1 register

[r3-Tunnel0/0/0]ospf dr-priority 0

各个路由器使用OSPF进行宣告

[r1-ospf-1-area-0.0.0.0]network 11.0.0.1 0.0.0.255

[r1-ospf-1-area-0.0.0.0]network 12.0.0.1 0.0.0.255

[r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.255

[r1-ospf-1-area-0.0.0.0]network 192.168.6.1 0.0.0.255

[r1-ospf-1-area-0.0.0.0]network 192.168.7.1 0.0.0.255

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值