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

HCLP--MGER综合实验

一、拓扑图

二、需求

 1、R5为ISP,只能进行IP地址配置,其所有地址均配为公有I地址;
2、R1和R5间使用PPP的PAP认证,R5为主认证方,
R2与R5之间使用ppp的CHAP认证,R5为主认证方;
R3与R5之间使用HDLc封装;
3、R1、R2、R3构建一个MGRE环境,R1为中心站点,
R1、R4间为点到点的GRE;
4、整个私有网络基本RIP全网可达;
5.所有Pc设置私有IP为源IP,可以访问R5环回。

三、分析

1、配置IP地址

2、配置静态路由使得公网全网通。

3、配置PPP的PAP 认证,R5为主认证方。

步骤1:在R5上,开启aaa模式,创建用户名、密码,设置权限

步骤2:在R5上,设置为PPP协议,进入物理接口设置PPP的认证模式为PAP

步骤3:在R1上,进入物理接口,配置相同的用户名及密码。

4、配置PPP的CHAP 认证,R5为主认证方。

步骤1:在R5上,开启aaa模式,创建用户名、密码,设置权限

步骤2:在R5上,设置为PPP协议,进入物理接口设置PPP的认证模式为CHAP

步骤3:在R1上,进入物理接口,配置相同的用户名及密码。

5、配置HDLC封装

两边都进入接口,修改接口类型为 hdlc

6、配置MGRE,R1为中心站点

步骤1:创建隧道接口,配置IP地址,封装方式设置为MGRE(gre p2mp),配置隧道对应物理接口的源IP地址。

步骤2:在R1上配置中心站点,宣告NHRP域,在R2、R3上配置分支站点,并向中心站点注册自身的隧道接口信息。

步骤3:配置RIP动态路由,宣告隧道网段和私网网段,使得可达全网可达。

7、配置GRE,R1为中心站点

步骤1:创建隧道接口,配置IP地址,封装方式设置为GRE(gre),配置隧道对应物理接口的源IP地址和目标隧道封装的物理接口的IP地址。

步骤2:配置RIP动态路由,宣告隧道网段和私网网段,使得可达全网可达。

8、配置EASY  IP使得所有PC都可访问公网,访问ISP的环回。

步骤1:配置缺省路由,全网可达,配置ACL,将私网的信息过滤抓包出来

步骤2:在接口下,同意放行ACL,私网PC可访问公网ISP环回内容。

四、步骤

1、配置IP地址

PC:

 

路由器:

R1:

[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.254 24 
[R1-GigabitEthernet0/0/0]q	
[R1]int Serial 4/0/0
[R1-Serial4/0/0]ip add 15.1.1.1 24
[R1-Serial4/0/0]q

R2:

[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.2.254 24 
[R2-GigabitEthernet0/0/0]q
[R2]int Serial 4/0/0
[R2-Serial4/0/0]ip add 25.1.1.2 24
[R2-Serial4/0/0]q

R3:

[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.3.254 24 
[R3-GigabitEthernet0/0/0]q
[R3]int Serial 4/0/0
[R3-Serial4/0/0]ip add 35.1.1.3 24
[R3-Serial4/0/0]q

R4:

[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 192.168.4.254 24
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 45.1.1.4 24 
[R4-GigabitEthernet0/0/1]q
[R4]

ISP:

[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 45.1.1.5 24
[ISP-GigabitEthernet0/0/0]q
[ISP]int Serial 4/0/0
[ISP-Serial4/0/0]ip add 35.1.1.5 24
[ISP-Serial4/0/0] 
[ISP-Serial4/0/0]int Serial 3/0/0
[ISP-Serial3/0/0]ip add 25.1.1.5 24
[ISP-Serial3/0/0]
[ISP-Serial3/0/0]int Serial 4/0/1
[ISP-Serial4/0/1]ip add 15.1.1.5 24
[ISP-Serial4/0/1] 
[ISP-Serial4/0/1]q
[ISP]int l0
[ISP-LoopBack0]ip add 5.5.5.5 24
[ISP-LoopBack0]q

 配置结果:

 

2、配置静态路由,使得公网通。

[R1]ip route-static 0.0.0.0 0 15.1.1.5
[R2]ip route-static 0.0.0.0 0 25.1.1.5
[R3]ip route-static 0.0.0.0 0 35.1.1.5
[R4]ip route-static 0.0.0.0 0 45.1.1.5

测试:

 3、在R1、R5上配置PPP的PAP 认证,R5为主认证方。

 主认证方R5:在aaa模式下,创建用户,说明协议为ppp协议,在接口下说明pap验证。

[ISP]aaa	
[ISP-aaa]local-user xixi password cipher xixi123 privilege level 15
Info: Add a new user.
[ISP-aaa]local-user xixi service-type ppp
[ISP-aaa]q
[ISP]int Serial 4/0/1	
[ISP-Serial4/0/1]ppp authentication-mode pap
[ISP-Serial4/0/1]q
[ISP]

 被认证方R1:在接口下,配置相同的认证用户名和密码

[R1]int Serial 4/0/0
[R1-Serial4/0/0]ppp pa local-user xixi password cipher xixi123 

 4、在R2、R5上配置PPP的CHAP认证,R5为主认证方

 主认证方R5:在aaa模式下,创建用户,说明协议为ppp协议,在接口下说明chap验证。

[ISP]aaa	
[ISP-aaa]local-user haha password cipher haha123 privilege level 15
Info: Add a new user.
[ISP-aaa]local-user haha service-type ppp
[ISP-aaa]q	
[ISP]int Serial 3/0/0	
[ISP-Serial3/0/0]ppp authentication-mode chap
[ISP-Serial3/0/0]q
[ISP]

被认证方R2:在接口下,配置相同的认证用户名和密码

[R2]int Serial 4/0/0	
[R2-Serial4/0/0]ppp chap user haha	
[R2-Serial4/0/0]ppp chap password cipher haha123
[R2-Serial4/0/0]q
[R2]

5、 在R3、R5上配置HDLC封装

[ISP]int Serial 4/0/0
[ISP-Serial4/0/0]link-protocol hdlc 
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[ISP-Serial4/0/0][R3]int Serial 4/0/0
[R3-Serial4/0/0]link-protocol hdlc 
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[R3-Serial4/0/0]

 配置结果;

R3:

ISP:

 6、在R1~R3上配置MGRE,R1为中心站点

步骤1:创建隧道接口,配置IP地址,选择封装类型MGRP,配置源IP地址(隧道口对应的真实的物理口IP地址)

 R1:

[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip add 10.1.2.1 24	
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R1-Tunnel0/0/0]source 15.1.1.1
Jul 26 2025 15:10:12-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state.

R2:

[R2]int Tunnel 0/0/0
[R2-Tunnel0/0/0]ip add 10.1.2.2 24	
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp 	
[R2-Tunnel0/0/0]source Serial 4/0/0
Jul 26 2025 15:15:31-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]

R3:

[R3]int Tunnel 0/0/0	
[R3-Tunnel0/0/0]ip add 10.1.2.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp 	
[R3-Tunnel0/0/0]source Serial 4/0/0
Jul 26 2025 15:17:30-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]

步骤2:配置nhrp域,在R2、R3上将自身信息注册到中心站点R1上(中心隧道IP地址,中心隧道对应的物理口IP地址)

[R1-Tunnel0/0/0]nhrp network-id 100[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register 

查看配置结果:

测试:

步骤3:配置RIP,选择v2版本,关闭自动汇总,宣告网段(主网段,不是子网段)

 R1:

[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 192.168.1.0 
[R1-rip-1]undo summary 
[R1-rip-1]network 10.0.0.0

R2:

[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]undo summary 
[R2-rip-1]network 192.168.2.0
[R2-rip-1]network 10.0.0.0
[R2-rip-1]

R3:

[R3]rip 1
[R3-rip-1]v 2
[R3-rip-1]undo summary 	
[R3-rip-1]network 192.168.3.0
[R3-rip-1]network 10.0.0.0
[R3-rip-1]

 查询RIP配置结果:

R1

R2

R3:

 

在R1接口上关闭RIP水平分割,在中心上开启伪广播。

[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]nhrp entry multicast dynamic 
[R1-Tunnel0/0/0]undo rip split-horizon 
[R1-Tunnel0/0/0]q
[R1]

R2、R3上关闭RIP水平分割

[R2-Tunnel0/0/0]undo rip split-horizon
[R3-Tunnel0/0/0]undo rip split-horizon

测试R1~R3可达

 

 关闭RIP水平分割后R1路由表信息:

 7、配置GRE,R1为中心站点

步骤1:创建隧道接口,配置IP地址,选择封装类型GRP,配置源目IP地址(隧道口对应的真实的物理口IP地址)

R1:

[R1]int Tunnel 0/0/1
[R1-Tunnel0/0/1]ip add 10.1.1.1 24
[R1-Tunnel0/0/1]tunnel-protocol gre
[R1-Tunnel0/0/1]source 15.1.1.1
[R1-Tunnel0/0/1]destination 45.1.1.4
Jul 26 2025 16:12:31-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]

R4:

[R4]int Tunnel 0/0/1
[R4-Tunnel0/0/1]ip add 10.1.1.2 24
[R4-Tunnel0/0/1]tunnel-protocol gre
[R4-Tunnel0/0/1]source 45.1.1.4
[R4-Tunnel0/0/1]destination 15.1.1.1
Jul 26 2025 16:19:27-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/1 has entered the UP state. 
[R4-Tunnel0/0/1]

测试配置:

步骤2:配置RIP,选择v2版本,关闭自动汇总,宣告网段(主网段,不是子网段)

R1配置MGRE时已经配置了RIP。

R4:

[R4]rip 1
[R4-rip-1]v 2	
[R4-rip-1]undo summary 	
[R4-rip-1]network 192.168.4.0
[R4-rip-1]network 10.0.0.0
[R4-rip-1]

 配置结果:

 9、配置EASY IP ,使得PC可以访问公网ISP的环回

步骤1:配置ACL

公网已全网可达。

[R1]acl 2000
[R1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255[R2]acl 2000	
[R2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255[R3]acl 2000	
[R3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255[R4]acl 2000	
[R4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255

 步骤2:在接口nat下发ACL

[R1]int Serial 4/0/0	
[R1-Serial4/0/0]nat outbound 2000[R2]int Serial 4/0/0	
[R2-Serial4/0/0]nat outbound 2000[R3]int Serial 4/0/0	
[R3-Serial4/0/0]nat outbound 2000[R4]int g0/0/1	
[R4-GigabitEthernet0/0/1]nat outbound 2000

测试:

 

 

 

 

http://www.xdnf.cn/news/16277.html

相关文章:

  • 数据结构习题--删除排序数组中的重复项
  • 详解力扣高频SQL50题之1084. 销售分析 III【简单】
  • Python点阵字生成与优化:从基础实现到高级渲染技术
  • 数据恢复与备份
  • 快速入门Linux操作系统(一)
  • 立式加工中心X-Y轴传动机械结构设“cad【6张】三维图+设计说明书
  • 进阶数据结构:用红黑树实现封装map和set
  • 学习嵌入式的第三十一天-数据结构-(2025.7.23)网络协议封装
  • 数据中心-时序数据库InfluxDB
  • 掌握Gemini-2.5:现代AI开发中实用应用的综合指南
  • 二次函数图像动画展示
  • 在Power Automate Desktop中执行PowerShell获取SharePoint online某个文件夹的用户权限列表
  • excel删除重复项场景
  • 算法竞赛阶段二-数据结构(35)数据结构单链表模拟实现
  • Node.js 模拟 Linux 环境
  • 【每天一个知识点】GAN(生成对抗网络,Generative Adversarial Network)
  • Whisper语音转文字
  • 【洛谷】单向链表、队列安排、约瑟夫问题(list相关算法题)
  • 互联网应用主流框架整合 Spring Boot开发
  • Linux DNS 服务器正反向解析
  • 【IMMCKF】基于容积卡尔曼滤波(CKF)的多模型交互的定位程序,模型为CV和CT,三维环境,matlab代码|附下载链接
  • Nestjs框架: 基于Mongodb的多租户功能集成和优化
  • 算子推理是什么
  • 电脑开机后网络连接慢?
  • (Python)文件储存的认识,文件路径(文件储存基础教程)(Windows系统文件路径)(基础教程)
  • 【17】C# 窗体应用WinForm ——【文本框TextBox、富文本框RichTextBox 】属性、方法、实例应用
  • C++:list(2)list的模拟实现
  • Java中配置两个r2db连接不同的数据库
  • JavaScript:现代Web开发的核心动力
  • Mistral AI开源 Magistral-Small-2507