【ensp实验】GRE和MGRE相关实验

news/2024/4/30 8:31:32

要求:

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、配置接口IP

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

 配置结果:

2、公网通路

配置缺省路由:

[R1]ip route-static 0.0.0.0 0 15.1.1.5
[R2]ip route-static 0.0.0.0 0 35.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、配置PAP认证

主认证方:

[R5]aaa
[R5-aaa]local-user  lhl password cipher lhl123456
Info: Add a new user.
[R5-aaa]local-user lhl service-type ppp[R5]int s 4/0/1
[R5-Serial4/0/1]ppp authentication-mode pap

被认证方

[R1]int s 4/0/0
[R1-Serial4/0/0]ppp pap local-user lhl password ci lhl123456

检查认证结果

 4、CHAP认证

主认证方:

[R5]aaa
[R5-aaa]local-user zhangdaye password cipher zdy12345
Info: Add a new user.
[R5-aaa]local-user zhangdaye service-type ppp
[R5-aaa]q[R5]int s3/0/1
[R5-Serial3/0/1]ppp authentication-mode chap

被认证方:

[R2]int s4/0/0
[R2-Serial4/0/0]ppp chap user zhangdaye
[R2-Serial4/0/0]ppp chap password cipher zdy12345

检查认证结果:

5、使用HDLC封装

更改链路协议类型

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

R5与R3同理

 6、构建MGRE环境

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
Mar 30 2024 15:15:31-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 network-id 100

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
Mar 30 2024 15:17:00-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

R3

[R3]int t0/0/0
[R3-Tunnel0/0/0]ip ad 10.1.2.3 24	
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R3-Tunnel0/0/0]source Serial 4/0/0
Mar 30 2024 15:18:18-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 network-id 100

配置R1与R4的点到点GRE隧道

R1

[R1]int t 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
Mar 30 2024 15:20: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]

检查

R4

[R4]int Tunnel 0/0/1
[R4-Tunnel0/0/1]ip add 10.1.1.4 24
[R4-Tunnel0/0/1]tunnel-protocol g
[R4-Tunnel0/0/1]source 45.1.1.4
[R4-Tunnel0/0/1]destination 15.1.1.1
Mar 30 2024 15:23:32-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]

检查

7、在私网配置RIP协议

R1

[R1]rip 1
[R1-rip-1]v 2
[R1-rip-1]undo summary 
[R1-rip-1]netw 192.168.1.0
[R1-rip-1]netw 10.0.0.0    //主类宣告

R2

[R2]rip 1
[R2-rip-1]v 2
[R2-rip-1]undo summary 
[R2-rip-1]netw 192.168.2.0
[R2-rip-1]netw 10.0.0.0[R2]int t0/0/0	
[R2-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register   //R2、R3需要注册

R3

[R3]rip 1
[R3-rip-1]v 2
[R3-rip-1]undo summary 
[R3-rip-1]net 192.168.3.0
[R3-rip-1]ne 10.0.0.0[R2]int t0/0/0	
[R2-Tunnel0/0/0]nhrp entry 10.1.3.1 25.1.1.1 register 

R4

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

检查后,发现中心站点没有学完所有路由 --- 解决办法:

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

关闭R1、R2、R3水平分割

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.cpky.cn/p/11384.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈,一经查实,立即删除!

相关文章

大模型重塑电商,淘宝、百度、京东讲出新故事

配图来自Canva可画 随着AI技术日渐成熟,大模型在各个领域的应用也越来越深入,国内互联网行业也随之进入了大模型竞赛的后半场,开始从“百模大战”转向了实际应用。大模型从通用到细分垂直领域的跨越,也让更多行业迎来了新的商机。…

Clickhouse-表引擎探索之MergeTree

引言 前文曾说过,Clickhouse是一个强大的数据库Clickhouse-一个潜力无限的大数据分析数据库系统 其中一个强大的点就在于支持各类表引擎以用于不同的业务场景。 MergeTree MergeTree系列的引擎被设计用于插入极大量的数据到一张表当中。数据可以以数据片段的形式一…

Flutter 拦截系统键盘,显示自定义键盘

一、这里记录下在开发过程中,下单的时候输入金额需要使用自定义的数字键盘 参考链接: https://juejin.cn/post/7166046328609308685 效果图 二、屏蔽系统键盘 怎样才能够在输入框获取焦点的时候,不让系统键盘弹出呢?同时又显示我们自定义的…

ChatGPTGPT4科研应用、数据分析与机器学习、论文高效写作、AI绘图技术教程

原文链接:ChatGPTGPT4科研应用、数据分析与机器学习、论文高效写作、AI绘图技术教程https://mp.weixin.qq.com/s?__bizMzUzNTczMDMxMg&mid2247598798&idx2&sn014f5ae90306a3b1e8fd87ab58561411&chksmfa820329cdf58a3f72799a43016b223057fd1bd02284…

第N6周:使用Word2vec实现文本分类

import torch import torch.nn as nn import torchvision from torchvision import transforms,datasets import os,PIL,pathlib,warnings #忽略警告信息 warnings.filterwarnings("ignore") # win10系统 device torch.device("cuda"if torch.cuda.is_ava…

Spring Boot 防护 XSS + SQL 注入攻击

XSS跨站脚本攻击 ① XSS漏洞介绍 跨站脚本攻击XSS是指攻击者往Web页面里插入恶意Script代码,当用户浏览该页之时,嵌入其中Web里面的Script代码会被解析执行,从而达到恶意攻击用户的目的。XSS攻击针对的是用户层面的攻击! ② XSS…