当前位置: 首页 > article >正文

OSPF-MGRE综合实验

 拓扑结构:

 要求:

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

2、R1/4/5为全连的MGRE结构,R1/2/3为星型的拓扑结构,R1为中心站点

3、所有私有网段可以互相通讯,私有网段使用OSPF协议完成

 使用的设备:6台路由器

解决网络拓扑:

1、确定广播域的个数

2、分配网段

3、配置IP地址 (优先配置路由器)

确定广播域的个数

根据拓扑结构图以及要求可知,本拓扑结构一共拥有9个网段,包括4个给定网段,一个环回网段和四个内网网段

分配网段

自主分配网段

192.168.0.0/24和10.1.1.0/8和15.1.1.0/24网段

 配置路由器IP地址

AR1:

<Huawei>system
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r1
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 16.1.1.1 24
[r1-GigabitEthernet0/0/0]
Apr 29 2023 20:17:37-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r1-GigabitEthernet0/0/0]q
[r1]interface GigabitEthernet 0/0/1
[r1-GigabitEthernet0/0/1]ip address 15.1.1.1 24
Apr 29 2023 20:17:52-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r1-GigabitEthernet0/0/1]q
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 192.168.1.1 24
[r1-LoopBack0]q
[r1]

AR2:

<Huawei>system
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r2
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip address 17.1.1.1 24
[r2-GigabitEthernet0/0/0]
Apr 29 2023 20:18:34-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r2-GigabitEthernet0/0/0]q
[r2]interface LoopBack 0
[r2-LoopBack0]ip address 192.168.2.1 24
[r2-LoopBack0]q
[r2]

AR3:

<Huawei>system
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r3
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 18.1.1.1 24
[r3-GigabitEthernet0/0/0]
Apr 29 2023 20:19:15-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r3-GigabitEthernet0/0/0]q
[r3]interface LoopBack 0
[r3-LoopBack0]ip address 192.168.3.1 24
[r3-LoopBack0]q
[r3]

AR4:

<Huawei>system
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r4
[r4]interface GigabitEthernet 0/0/0
[r4-GigabitEthernet0/0/0]ip address 19.1.1.1 24
[r4-GigabitEthernet0/0/0]
Apr 29 2023 20:19:56-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r4-GigabitEthernet0/0/0]q         
[r4]interface LoopBack 0
[r4-LoopBack0]ip address 192.168.4.1 24
[r4-LoopBack0]q
[r4]

AR5:

<Huawei>system
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r5
[r5]interface GigabitEthernet 0/0/0
[r5-GigabitEthernet0/0/0]ip address 20.1.1.1 24
[r5-GigabitEthernet0/0/0]
Apr 29 2023 20:20:49-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r5-GigabitEthernet0/0/0]q
[r5]interface LoopBack 0
[r5-LoopBack0]ip address 192.168.5.1 24
[r5-LoopBack0]q
[r5]

AR6:

<Huawei>system
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname isp
[isp]interface GigabitEthernet 0/0/0
[isp-GigabitEthernet0/0/0]ip address 16.1.1.2 24
[isp-GigabitEthernet0/0/0]
Apr 29 2023 20:21:33-08:00 isp %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[isp-GigabitEthernet0/0/0]q
[isp]interface GigabitEthernet 0/0/1
[isp-GigabitEthernet0/0/1]ip address 17.1.1.2 24
Apr 29 2023 20:21:48-08:00 isp %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[isp-GigabitEthernet0/0/1]q
[isp]interface GigabitEthernet 0/0/2
[isp-GigabitEthernet0/0/2]ip address 15.1.1.2 24
Apr 29 2023 20:22:05-08:00 isp %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP on the interface GigabitEthernet0/0/2 has entered the UP state. 
[isp-GigabitEthernet0/0/2]q
[isp]interface GigabitEthernet 1/0/0
[isp-GigabitEthernet1/0/0]ip address 18.1.1.2 24
Apr 29 2023 20:22:22-08:00 isp %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP on the interface GigabitEthernet1/0/0 has entered the UP state. 
[isp-GigabitEthernet1/0/0]q
[isp]interface GigabitEthernet 2/0/0
[isp-GigabitEthernet2/0/0]ip address 19.1.1.2 24
Apr 29 2023 20:22:38-08:00 isp %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP on the interface GigabitEthernet2/0/0 has entered the UP state. 
[isp-GigabitEthernet2/0/0]q
[isp]interface GigabitEthernet 3/0/0
[isp-GigabitEthernet3/0/0]ip address 20.1.1.2 24
Apr 29 2023 20:22:53-08:00 isp %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP on the interface GigabitEthernet3/0/0 has entered the UP state. 
[isp-GigabitEthernet3/0/0]q
[isp]interface LoopBack 0
[isp-LoopBack0]ip address 3.3.3.3 24
[isp-LoopBack0]q
[isp]

配置MGRE部分

AR1:中心站点

[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 
Apr 29 2023 20:31:32-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 entry multicast dynamic 
[r1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]q
[r1]

AR2:

[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]source GigabitEthernet 0/0/0
Apr 29 2023 20:34:49-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
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 16.1.1.1 register
[r2-Tunnel0/0/0]q
[r2]

AR3:

[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]source GigabitEthernet 0/0/0
Apr 29 2023 20:35:57-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 entry 10.1.1.1 16.1.1.1 register
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]q
[r3]

配置全连网状的MGRE,没有中心站点,双向注册

AR1:

[r1]interface Tunnel 0/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 15.1.1.1
Apr 29 2023 21:31:25-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface Tunnel0/0/1 has entered the UP state. 
[r1-Tunnel0/0/1]nhrp entry multicast dynamic 
[r1-Tunnel0/0/1]nhrp network-id 101
[r1-Tunnel0/0/1]q
[r1]

AR4:

[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip address 10.1.2.2 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r4-Tunnel0/0/0]source GigabitEthernet 0/0/0
Apr 29 2023 21:36:39-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 101
[r4-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register 
[r4-Tunnel0/0/0]nhrp entry 10.1.2.3 20.1.1.1 register
[r4-Tunnel0/0/0]q
[r4]

AR5:R4可以和R5进行通信,但是R5并不能向R4进行注册,所以需要在5上也开启伪广播

[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ip address 10.1.2.3 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r5-Tunnel0/0/0]source GigabitEthernet 0/0/0
Apr 29 2023 21:38:10-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 101
[r5-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register
[r5-Tunnel0/0/0]nhrp entry 10.1.2.2 19.1.1.1 register
Info: This peer protocol address conflicts with hub register peer protocol address.
[r5-Tunnel0/0/0]nhrp entry multicast dynamic
[r5-Tunnel0/0/0]q
[r5] 

配置了MGRE之后,真实的拓扑结构

然后R1~R5的每一个路由器上都写上一条指向R6的静态缺省路由

[r1]ip route-static 0.0.0.0 0 16.1.1.2
[r1]ip route-static 0.0.0.0 0 15.1.1.2
[r2]ip route-static 0.0.0.0 0 17.1.1.2
[r3]ip route-static 0.0.0.0 0 18.1.1.2
[r4]ip route-static 0.0.0.0 0 19.1.1.2
[r5]ip route-static 0.0.0.0 0 20.1.1.2

此时配置了MGRE的设备之间可以相互通信,但是两个MGRE之间不能通信,还得运行OSPF协议

配置OSPF动态路由协议

AR1:

[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.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]q
[r1-ospf-1]q
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ospf network-type broadcast 
[r1-Tunnel0/0/0]q
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ospf network-type broadcast 
[r1-Tunnel0/0/1]q
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ospf authentication-mode md5 1 cipher 123456
[r1-Tunnel0/0/0]q
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ospf authentication-mode md5 1 cipher 123456
[r1-Tunnel0/0/1]q
[r1]

AR2:不进行DR/BDR选举

[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 10.1.1.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]q
[r2-ospf-1]q
[r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0]ospf network-type broadcast 
[r2-Tunnel0/0/0]ospf dr-priority 0
[r2-Tunnel0/0/0]q
[r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0]ospf authentication-mode md5 1 cipher 123456
[r2-Tunnel0/0/0]q
[r2]

AR3:不进行DR/BDR选举

[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.2.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]q
[r3-ospf-1]q
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ospf network-type broadcast 
[r3-Tunnel0/0/0]ospf dr-priority 0
[r3-Tunnel0/0/0]q
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ospf authentication-mode md5 1 cipher 123456
[r3-Tunnel0/0/0]q
[r3]

AR4:

[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 10.1.1.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]q
[r4-ospf-1]q
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ospf network-type broadcast
[r4-Tunnel0/0/0]q
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ospf authentication-mode md5 1 cipher 123456
[r4-Tunnel0/0/0]q
[r4]

AR5:

[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 10.1.1.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]q
[r5-ospf-1]q
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ospf network-type broadcast
[r5-Tunnel0/0/0]q
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ospf authentication-mode md5 1 cipher 123456
[r5-Tunnel0/0/0]q
[r5]

配置OSPF动态路由协议,配置认证,保证更新安全

配置之后,全网可以正常相互访问

 

 并且都可以访问R6(isp)的环回,但是以ping -a 的命令指定他们访问R6环回的地址却访问不到R6的环回,这个问题暂时得不到解决。

 实验到此为止,就完成了 ,要求也是全部完成。


http://www.kler.cn/a/15702.html

相关文章:

  • Elasticsearch 8.16.0:革新大数据搜索的新利器
  • T265相机双目鱼眼+imu联合标定(全记录)
  • 解决部署RKE2或K3S-“docker.io/rancher/mirrored-pause:3.6\“: -无法拉取镜像办法
  • Odoo :一款免费开源的日化行业ERP管理系统
  • 民事诉讼中,火灾事故认定书并非不可推翻,其证明力弱于鉴定意见
  • SOC Boot学习(三)——boot流程
  • Microsoft Forms的應用(文行版)
  • 【VM服务管家】VM4.x算子SDK开发_3.3 模块工具类
  • 揭秘!我用AI写了一部精彩小说;搭建AI视频创作工作流;一键生成摘要工具清单;大模型创业生死5问 | ShowMeAI日报
  • 〔金融帝国实验室〕(Capitalism Lab)v9.0.00官方重大版本更新!
  • 如何保障网络安全
  • 【计算机网络】网络命令的使用
  • Mysql在大表中删除大量数据的优化
  • C++内存管理之拷贝memcpy、分配malloc 与释放free
  • 人工智能课程笔记(7)强化学习(基本概念 Q学习 深度强化学习 附有大量例题)
  • Ficus: 一款 markdown 编辑管理软件
  • 生成式AI火爆全球,你是否已经做好了准备?
  • Android | View.post 到底是在什么时候执行的
  • Linux网络——Shell编程规范与变量
  • 英语基础-介词
  • 深入浅出Java中参数传递的原理
  • 这4种情况,请直接跳槽!程序员跳槽指南
  • LED子系统
  • C. Multiplicity(DP + 分解因数)
  • Java多线程中Lock的使用
  • 9.pytorch lightning之数据模块LightningDataModule