HCIP—OSPF下的MGRE环境实验 2022-4-4

OSPF下的MGER实验

在这里插入图片描述
要求:

1, R6为ISP只能配置Ip地址,R1-R5的环回为私有网段
2, R1/4/5为全连的MGRE结构,R1/2/3为星型的拓扑结构,R1为中心站点
3, 所有私有网段可以互相通讯,私有网段使用OSPF完成。

一,给R1-R5配置IP地址和环回地址。
1,在R1上配置IP
在这里插入图片描述
2,在R2上配置IP
在这里插入图片描述
3,在R3上配置IP
在这里插入图片描述
4,在R4上配置IP
在这里插入图片描述
5,在R5上配置IP
在这里插入图片描述
6,在R6上配置IP
在这里插入图片描述
二,给每个路由器写上缺省路由,使内网都能通信。

[r1]ip route-static 0.0.0.0 0.0.0.0 16.0.0.2
    ip route-static 0.0.0.0 0.0.0.0 61.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
[r4]ip route-static 0.0.0.0 0 56.0.0.2

三,R1/2/3为星型的拓扑结构,R1为中心站点,配置mgre。
1,在R1上配置

interface Tunnel0/0/0    ---创建接口
ip address 192.168.6.1 255.255.255.0  ---配置IP
tunnel-protocol gre p2mp  ---选择封装类型
source 16.0.0.1    
nhrp network-id 100
nhrp entry multicast dynamic  ---开启伪广播

2,在R2上配置

 interface Tunnel0/0/0
 ip address 192.168.6.2 255.255.255.0 
 tunnel-protocol gre p2mp
 source GigabitEthernet0/0/0
 nhrp network-id 100
 nhrp entry 192.168.6.1 16.0.0.1 register  ---找中心注册

3,在R3上配置

 interface Tunnel0/0/0
 ip address 192.168.6.3 255.255.255.0 
 tunnel-protocol gre p2mp
 source GigabitEthernet0/0/0
 nhrp network-id 100
 nhrp entry 192.168.6.1 16.0.0.1 register  ---找中心注册

四,R1/4/5为全连的MGRE结构,互为中心和分支。
1,在R1上配置

 interface Tunnel0/0/1
 ip address 192.168.7.1 255.255.255.0 
 tunnel-protocol gre p2mp
 source 61.0.0.1
 nhrp network-id 200
 nhrp entry 192.168.7.2 46.0.0.1 register ---找r4注册
 nhrp entry 192.168.7.3 56.0.0.1 register ---找r5注册
 nhrp entry multicast dynamic 

2,在R4上配置

 interface Tunnel0/0/1
 ip address 192.168.7.2 255.255.255.0 
 tunnel-protocol gre p2mp
 source 46.0.0.1
 nhrp entry multicast dynamic
 nhrp network-id 100
 nhrp entry 192.168.7.2 56.0.0.1 register --- 找r5注册
        --- 不用找在找r1进行注册,

3,在R5上配置

 interface Tunnel0/0/1
 ip address 192.168.7.3 255.255.255.0 
 tunnel-protocol gre p2mp
 source 56.0.0.1
 ospf network-type broadcast
 nhrp entry multicast dynamic
 nhrp network-id 100
     ---r1和r4已经注册,因为注册是双向的

五,使用osfp协议

r1:

  ospf 1 router-id 1.1.1.1 
  area 0.0.0.0 
  network 192.168.1.0 0.0.0.255 
  network 192.168.6.0 0.0.0.255 
  network 192.168.7.0 0.0.0.255 

r2:

ospf 1 router-id 2.2.2.2
 area 0.0.0.0 
  network 192.168.2.0 0.0.0.255 
  network 192.168.6.0 0.0.0.255 

r3:

  ospf 1 router-id 3.3.3.3
  area 0.0.0.0 
  network 192.168.3.0 0.0.0.255 
  network 192.168.6.0 0.0.0.255 

r4;

ospf 1 router-id 4.4.4.4 
 area 0.0.0.0 
  network 192.168.4.0 0.0.0.255 
  network 192.168.7.0 0.0.0.255 

r5:

ospf 1 router-id 5.5.5.5
 area 0.0.0.0 
  network 192.168.5.0 0.0.0.255 
  network 192.168.7.0 0.0.0.255 

给虚拟接口修改网络类型

 [r1-Tunnel0/0/0]ospf network-type broadcast   
 [r1-Tunnel0/0/1]ospf network-type broadcast
 [r4-Tunnel0/0/1]ospf network-type broadcast
 [r5-Tunnel0/0/1]ospf network-type broadcast
 [r2-Tunnel0/0/0]ospf network-type broadcast
 [r3-Tunnel0/0/0]ospf network-type broadcast 

因为R2和R3的认知不同,所以需要将其放弃选举,将优先级修改为0
[r3-Tunnel0/0/0]ospf dr-priority 0
[r2-Tunnel0/0/0]ospf dr-priority 0
在这里插入图片描述
因为R1 ,R4, R5之间互为分支和中心,会自动选择DR和BDR。
在这里插入图片描述

六,全网可达
在这里插入图片描述
在这里插入图片描述
完毕!

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值