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

GRE及MGRE应用综合实验

GRE及MGRE应用综合实验

一、实验拓扑

二、实验需求

1、R5为ISP,只能进行IP地址配置,其所有地址均配为公有IP地址; 
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.根据划分的网段,为所有PC机以及路由器接口配置IP地址;

2为R1和R5间配置PPP的PAP认证,R5为主认证方;

3.R2与R5之间配置ppp的CHAP认证,R5为主认证方;

4.配置R3与R5之间使用HDLC封装 ;

5.在R1~R5上配置默认路由使公网互通;

6.建立R1、R4间点到点的GRE;

7.将R1、R2、R3构建一个MGRE环境,R1为中心站点;

8..配置rip来传递私网路由。

四、实验步骤

1.为所有PC机以及路由器接口配置IP地址

(1)PC机

(2)路由器接口

R1:

[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
Jul 25 2025 22:18:48-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]int s4/0/0
[R1-Serial4/0/0]ip add 15.1.1.1 24

R2:

[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.2.254 24
Jul 25 2025 22:24:42-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]int s4/0/0
[R2-Serial4/0/0]ip add 25.1.1.1 24 

R3:

[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.3.254 24
Jul 25 2025 22:35:19-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]int s4/0/0
[R3-Serial4/0/0]ip add 35.1.1.1 24 

R4:

[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 192.168.4.254 24
[R4-GigabitEthernet0/0/1]
Jul 25 2025 22:37:13-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R4-GigabitEthernet0/0/1]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 45.1.1.1 24 

R5:

[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 45.1.1.2 24
[R5-GigabitEthernet0/0/0]
Jul 25 2025 22:41:37-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]int s4/0/1
[R5-Serial4/0/1]ip add 15.1.1.2 24
[R5-Serial4/0/1]
Jul 25 2025 22:42:30-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PPP
IPCP on the interface Serial4/0/1 has entered the UP state. 
[R5-Serial4/0/1]int s3/0/1
[R5-Serial3/0/1]ip add 25.1.1.2 24
[R5-Serial3/0/1]
Jul 25 2025 22:44:07-08:00 R5 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPP
IPCP on the interface Serial3/0/1 has entered the UP state. 
[R5-Serial3/0/1]int s4/0/0
[R5-Serial4/0/0]ip add 35.1.1.2 24 

R5环回口:

[R5]int l0
[R5-LoopBack0]ip add 5.5.5.1 24 

2. 、R1和R5间使用PPP的PAP认证,R5为主认证方

R5:

[R5]aaa
[R5-aaa]local-user wangdaye password cipher wdy12345
Info: Add a new user.
[R5-aaa]local-user wangdaye service-type ppp
[R5-aaa]q
[R5]int s4/0/1
[R5-Serial4/0/1]ppp authentication-mode PAP
[R5-Serial4/0/1]link-protocol ppp

R1:

[R1]int s4/0/0
[R1-Serial4/0/0]ppp pap local-user wangdaye password cipher wdy12345

3.R2与R5之间使用ppp的CHAP认证,R5为主认证方

R5配置如上一步

R2:

[R2]int s4/0/0
[R2-Serial4/0/0]ppp pap local-user wangdaye password cipher wdy12345

4.配置R3与R5之间使用HDLC封装 

R3:

[R3]int s4/0/0
[R3-Serial4/0/0]link-protocol HDLC

R5:

[R5]int s4/0/0
[R5-Serial4/0/0]link-protocol HDLC

5. 在R1~R5上配置默认路由使公网互通

R1:

[R1]ip route-static 0.0.0.0 0 15.1.1.2

R2:

 [R2]ip route-static 0.0.0.0 0 25.1.1.2

R3:

 [R3]ip route-static 0.0.0.0 0 35.1.1.2

R5:

 [R4]ip route-static 0.0.0.0 0 45.1.1.2

6. 建立R1、R4间点到点的GRE

(1)在R1上创建Tunnel口,模式为GRE,源地址和目的地址为本端公网地址和对端公网地址

[R1]int tunnel0/0/0
[R1-Tunnel0/0/0]tunnel-protocol gre
[R1-Tunnel0/0/0]ip add 10.1.1.1 24
[R1-Tunnel0/0/0]source 15.1.1.1
[R1-Tunnel0/0/0]destination 45.1.1.1

(2)在R4上创建Tunnel口,模式为GRE,源地址和目的地址为本端公网地址和对端公网地址 

[R4]int tunnel0/0/0
[R4-Tunnel0/0/0]tunnel-protocol gre
[R4-Tunnel0/0/0]ip add 10.1.1.2 24
[R4-Tunnel0/0/0]source 45.1.1.1
[R4-Tunnel0/0/0]destination 15.1.1.1 

7.将R1、R2、R3构建一个MGRE环境,R1为中心站点 

(1)配置总部与分部之间的隧道-MGRE VPN

R1: 

[R1]int tunnel0/0/1
[R1-Tunnel0/0/1]tunnel-protocol gre p2mp
[R1-Tunnel0/0/1]ip add 10.1.2.1 24
[R1-Tunnel0/0/1]source 15.1.1.1

R2:

[R2]int tunnel0/0/1
[R2-Tunnel0/0/1]tunnel-protocol gre ?
p2mp  Point to multi-point GRE mode
<cr>  Please press ENTER to execute command 
[R2-Tunnel0/0/1]tunnel-protocol gre p2mp
[R2-Tunnel0/0/1]ip add 10.1.2.2 24
[R2-Tunnel0/0/1]source 25.1.1.1 

R3:

[R3]int tunnel0/0/1
[R3-Tunnel0/0/1]tunnel-protocol gre p2mp
[R3-Tunnel0/0/1]ip add 10.1.2.3 24
[R3-Tunnel0/0/1]source 35.1.1.1 

(2)NHRP的配置

中心站点配置:

R1:

[R1]int tunnel0/0/1
[R1-Tunnel0/0/1]nhrp network-id 100 

分支站点配置:

R2:

[R2]int tunnel 0/0/1
[R2-Tunnel0/0/1]nhrp network-id 100
[R2-Tunnel0/0/1]nhrp entry 10.1.2.1 15.1.1.1 register 

R3:

[R3]int tunnel0/0/1
[R3-Tunnel0/0/1]nhrp network-id 100
[R3-Tunnel0/0/1]nhrp entry 10.1.2.1 15.1.1.1 

8.配置rip来传递私网路由

R1:

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

R2:

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

R3:

[R3]rip 1
[R3-rip-1]undo summary
[R3-rip-1]version 2
[R3-rip-1]network 192.168.4.0
[R3-rip-1]network 10.0.0.0 

R4:

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

在 中心上开启伪广播:

[R1]int tunnel0/0/1
[R1-Tunnel0/0/1]nhrp entry multicast dynamic 

关闭RIP的水平分割机制:

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

五、实验结果

 实验成功

 

http://www.lryc.cn/news/600300.html

相关文章:

  • Spring AI 项目实战(二十):基于Spring Boot + AI + DeepSeek的智能环境监测与分析平台(附完整源码)
  • SpringMVC——请求
  • 常见代码八股
  • 0基础法考随手笔记 03(刑诉05 刑事证据与证明+06 强制措施)
  • Kafka MQ 消费者应用场景
  • 【web应用】基于Vue3和Spring Boot的课程管理前后端数据交互过程
  • DAY31 整数矩阵及其运算
  • 【C++】位运算符
  • 解锁反向海淘独立站:国内电商平台 API 接口全解析
  • LeetCode 1074:元素和为目标值的子矩阵数量
  • OGG同步Oracle到Kafka不停库,全量加增量
  • 【愚公系列】《MIoT.VC》003-构建基本仿真工作站(组件的属性、行为、视频展示)
  • Javaweb————什么是超文本传输协议?
  • HiggsAudio-V2: 融合语言与声音的下一代音频大模型
  • 详解力扣高频SQL50题之550. 游戏玩法分析 IV【中等】
  • 原理篇..
  • 2025年入局苹果Vision Pro开发:从零到发布的完整路线图
  • 路由选择工具——IP-Prefix
  • Triton Server部署Embedding模型
  • 谷粒商城170缓存序列化报错
  • 如何查看电脑后门IP和流量?
  • 图论:Dijkstra算法
  • CPU 为什么需要缓存?揭开速度与效率的底层逻辑
  • 大模型应用班-第2课 DeepSeek使用与提示词工程课程重点 学习ollama 安装 用deepseek-r1:1.5b 分析PDF 内容
  • 机器学习——随机森林算法分类问题案例解析(sklearn)
  • Linux系统架构核心全景详解
  • HAProxy 实验指南:从零开始搭建高可用负载均衡系统
  • sssss
  • mybatis-plus从入门到入土(三):持久层接口之IService
  • 嵌入式硬件篇---有线串口通信问题解决