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

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.xdnf.cn/news/16276.html

相关文章:

  • Day32| 509. 斐波那契数、70. 爬楼梯、746. 使用最小花费爬楼梯
  • 复杂产品系统集成协同研发平台的研究与实现
  • 【MySQL】MySQL 缓存方案
  • haproxy原理及实战部署
  • Vue3组件通信方法清单
  • CPU 为什么需要缓存?揭开速度与效率的底层逻辑
  • ICMPv6报文类型详解表
  • 如何检查服务器数据盘是否挂载成功?
  • 【Spring AI】大模型服务平台-阿里云百炼
  • 创建 Vue 项目的 4 种主流方式
  • Spark-TTS 使用
  • Caffeine 缓存库的常用功能使用介绍
  • 秋招Day19 - 分布式 - 分布式设计
  • Qt 网络编程进阶:RESTful API 调用
  • setsockopt函数概念和使用案例
  • 以实时语音转文字项目为例,介绍一下如何手动部署python应用到Linux服务器(附脚本)
  • C++:STL中vector的使用和模拟实现
  • 【机器学习-1】特征工程与KNN分类算法
  • CPU(中央处理器)和GPU(图形处理器)的区别
  • 如何理解泊松分布
  • adb 下载并安装
  • 第七章 愿景11 琦琦复盘测试
  • 线段树学习笔记 - 练习题(3)
  • Effective C++ 条款02:尽量以 const, enum, inline 替换 #define
  • 【PyTorch】图像多分类项目部署
  • epoll_event数据结构及使用案例详解
  • 解密负载均衡:如何轻松提升业务性能
  • Qt:qRegisterMetaType函数使用介绍
  • iOS —— 天气预报仿写总结
  • 【日志】unity俄罗斯方块——边界限制检测