MGRE环境下的OSPF实验:

 

一、完成问题1,对接口进行IP地址的配置:

 

 

 

 

 

 

 二、所有公有网段可以互通:

[r1] ip route-static 0.0.0.0 0 116.0.0.2
[r1] ip route-static 0.0.0.0 0 16.0.0.2
[r2] ip route-static 0.0.0.0 0 26.0.0.2
[r3] ip route-static 0.0.0.0 0 36.0.0.2
[r4] ip route-static 0.0.0.0 0 46.0.0.2
[r5] ip route-static 0.0.0.0 0 56.0.0.2

三、R1/2/3配置MGRE结构,R1为中心站点: 

中心的配置:
[r1] interface Tunnel 0/0/0                       ---配置隧道接口
[r1-Tunnel0/0/0] ip address 192.168.7.1 24        ---接口配置IP地址
[r1-Tunnel0/0/0] tunnel-protocol gre p2mp         ---定义封装方式
[r1-Tunnel0/0/0] source 16.0.0.1                  ---定义封装内容
Jul 15 2022 14:55:24-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r1-Tunnel0/0/0] nhrp network-id 100              ---创建NHRP域
[r1-Tunnel0/0/0] nhrp entry multicast dynamic     ---在中心开启伪广播
分支的配置:
[r2] interface Tunnel 0/0/0                                 ---创建隧道接口
[r2-Tunnel0/0/0] ip address 192.168.7.2 24                  ---接口配置IP地址
[r2-Tunnel0/0/0] tunnel-protocol gre p2mp                   ---定义封装方式
[r2-Tunnel0/0/0] source GigabitEthernet 0/0/0               ---定义封装内容
Jul 15 2022 14:58:02-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r2-Tunnel0/0/0] nhrp network-id 100                        ---加入到中心创建的NHRP中
[r2-Tunnel0/0/0] nhrp entry 192.168.7.1 16.0.0.1 register   ---上报信息到中心
分支的配置:
[r3] interface Tunnel 0/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 GigabitEthernet 0/0/0
Jul 15 2022 15:00:50-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r3-Tunnel0/0/0] nhrp network-id 100
[r3-Tunnel0/0/0] nhrp entry 192.168.7.1 16.0.0.1 register 

四、R1/4/5为全连的MGRE结构: 

[r1] interface Tunnel 0/0/1	                               ---创建隧道接口
[r1-Tunnel0/0/1] ip address 192.168.6.1 24                  ---接口配置IP地址
[r1-Tunnel0/0/1] tunnel-protocol gre p2mp                   ---定义封装方式
[r1-Tunnel0/0/1] source 116.0.0.1                           ---定义封装内容
Jul 15 2022 15:05:13-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/1 has entered the UP state. 
[r1-Tunnel0/0/1] nhrp network-id 110                        ---创建NHRP域
[r1-Tunnel0/0/1] nhrp entry multicast dynamic               ---开启伪广播
[r1-Tunnel0/0/1] nhrp entry 192.168.6.2 46.0.0.1 register   ---上报信息到中心
[r1-Tunnel0/0/1] nhrp entry 192.168.6.3 56.0.0.1 register 
[r4] interface Tunnel 0/0/0
[r4-Tunnel0/0/0] ip address 192.168.6.2 24
[r4-Tunnel0/0/0] tunnel-protocol gre p2mp
[r4-Tunnel0/0/0] source 46.0.0.1
Jul 15 2022 15:07:46-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r4-Tunnel0/0/0] nhrp network-id 110
[r4-Tunnel0/0/0] nhrp entry multicast dynamic 
[r4-Tunnel0/0/0] nhrp entry 192.168.6.1 116.0.0.1 register 
Info: This peer protocol address conflicts with hub register peer protocol addre
ss. 
[r4-Tunnel0/0/0] nhrp entry 192.168.6.3 56.0.0.1 register 
[r5] interface Tunnel 0/0/0
[r5-Tunnel0/0/0] ip address 192.168.6.3 24
[r5-Tunnel0/0/0] tunnel-protocol gre p2mp
[r5-Tunnel0/0/0] source 56.0.0.1
Jul 15 2022 15:09:53-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r5-Tunnel0/0/0] nhrp network-id 110
[r5-Tunnel0/0/0] nhrp entry multicast dynamic 
[r5-Tunnel0/0/0] nhrp entry 192.168.6.1 116.0.0.1 register 
Info: This peer protocol address conflicts with hub register peer protocol addre
ss. 
[r5-Tunnel0/0/0] nhrp entry 192.168.6.2 46.0.0.1 register 
Info: This peer protocol address conflicts with hub register peer protocol addre
ss. 

五、完成问题3,使用ospf使所有的私有网段可以互相通讯: 

[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
[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.0 0.0.0.255	
[r2-ospf-1-area-0.0.0.0] network 192.168.7.0 0.0.0.255
[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.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0] network 192.168.7.0 0.0.0.255
[r4] ospf 1 router-id 4.4.4.4
[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
[r5] ospf 1 router-id 5.5.5.5
[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
[r1] interface Tunnel 0/0/0
[r1-Tunnel0/0/0] ospf network-type p2mp         ---修改接口网络类型
[r1] interface Tunnel 0/0/1	
[r1-Tunnel0/0/1] ospf network-type broadcast    ---修改接口网络类型
[r2] interface Tunnel 0/0/0
[r2-Tunnel0/0/0] ospf network-type p2mp
[r3] interface Tunnel 0/0/0
[r3-Tunnel0/0/0] ospf network-type p2mp
[r4] interface Tunnel 0/0/0
[r4-Tunnel0/0/0] ospf network-type broadcast 
[r5] interface Tunnel 0/0/0
[r5-Tunnel0/0/0] ospf network-type broadcast 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值