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

HCIP----MGRE实验

实验要求:

第一步,基本的IP地址配置

R1:

[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.1.1 24      #配置PC的网关
[R1]int Serial 4/0/0
[R1-Serial4/0/0]link-protocol hdlc                  #R1和R2之间采用hdlc封装
[R1-Serial4/0/0]ip add 12.1.1.1 24

R2:

[ISP]int Serial 4/0/1	
[ISP-Serial4/0/1]link-protocol hdlc      R1和R2之间采用hdlc
[ISP-Serial4/0/1]ip add 12.1.1.2 24[ISP]int Serial 3/0/0
[ISP-Serial3/0/0]ip add 23.1.1.1 24       #这里R2和R3、R4之间采用PPP,由于这接口本来就是PPP,所以不用设置
[ISP]int Serial 3/0/1
[ISP-Serial3/0/1]ip add 24.1.1.1 24
[ISP]int lo 0                             #创建环回
[ISP-LoopBack0]ip  add 2.2.2.2 24

R3:

[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip  add 192.168.2.1 24
[R3]int Serial 4/0/1
[R3-Serial4/0/1]ip add 23.1.1.2 24

R4:

[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 192.168.3.1 24
[R4]int Serial 4/0/1
[R4-Serial4/0/1]ip add 24.1.1.2 24

第二步,写上对应的认证:

R2

[ISP]aaa
[ISP-aaa]local-user tmg password cipher 123      #创建认证用户
Info: Add a new user.
[ISP-aaa]local-user tmg service-type ppp          #设置服务类型为PPP
[ISP-aaa]q
[ISP]int Serial 3/0/0
[ISP-Serial3/0/0]ppp authentication-mode pap      #R2和R3之间用PAP
[ISP-Serial3/0/0]q
[ISP]int Serial 3/0/1
[ISP-Serial3/0/1]ppp  authentication-mode chap     #R2和R4之间使用CHAP

R3

[R3]int Serial 4/0/1
[R3-Serial4/0/1]ppp pap local-user tmg password cipher 123

R4

[R4]int Serial 4/0/1
[R4-Serial4/0/1]ppp chap user tmg
[R4-Serial4/0/1]ppp chap password cipher 123

第三步,所有PC都可以访问R2的环回

R1

[R1]ip route-static 0.0.0.0 0 12.1.1.2
[R1]acl 2000
[R1-acl-basic-2000]rule permit source any     #这时的PC相当于私网,通过NAT技术访问R2
[R1-acl-basic-2000]q	
[R1]int Serial 4/0/0
[R1-Serial4/0/0]nat outbound 2000             #NAT接口调用

R3

[R3]ip route-static 0.0.0.0 0 23.1.1.1
[R3]acl 2000
[R3-acl-basic-2000]rule permit source any 
[R3-acl-basic-2000]q	
[R3]int Serial 4/0/1
[R3-Serial4/0/1]nat outbound 2000

R4

[R4]ip route-static 0.0.0.0 0 24.1.1.1
[R4]acl 2000	
[R4-acl-basic-2000]rule permit source any 
[R4-acl-basic-2000]q
[R4]int Serial 4/0/1
[R4-Serial4/0/1]nat outbound 2000

这时PC就可以访问2.2.2.2R2的环回。

第四步,建立MGRE

R1

[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip add 10.1.1.1 24	
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R1-Tunnel0/0/0]source 12.1.1.1
Jan 22 2024 21:36:00-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

R3

[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]ip add 10.1.1.2 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp 	
[R3-Tunnel0/0/0]source Serial 4/0/1
Jan 22 2024 21:38:20-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 12.1.1.1 register 
[R3-Tunnel0/0/0]nhrp network-id 100

R4

[R4]int Tunnel 0/0/0
[R4-Tunnel0/0/0]ip add 10.1.1.3 24	
[R4-Tunnel0/0/0]tunnel-protocol gre p2mp 	
[R4-Tunnel0/0/0]source Serial 4/0/1
Jan 22 2024 21:40:26-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 entry 10.1.1.1 12.1.1.1 register 
[R4-Tunnel0/0/0]nhrp network-id 100

在R1上查看连个节点都注册成功

第五步,通过RIP达到私网的互通

R1

[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]net 192.168.1.0
[R1-rip-1]net 10.0.0.0

R3

[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]net 192.168.2.0
[R3-rip-1]net 10.0.0.0

R4

[R4]rip 1
[R4-rip-1]version 2
[R4-rip-1]net 192.168.3.0
[R4-rip-1]net 10.0.0.0

关闭中心接口上的水平分割机制R1

[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]undo rip split-horizon 

实验完成

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

相关文章:

  • STM32标准库开发——PWM驱动代码
  • postman导入https证书
  • Spark UI中 Shuffle Exchange 和 BroadcastExchange 中的 dataSize 值为什么不一样
  • 阿里云优惠券领取入口、使用方法和限制条件,2024最新
  • 自己构建webpack+vue3+ts
  • 【AI】小白入门笔记
  • GPT应用开发:编写插件获取实时天气信息
  • 揭开Spring MVC的真面目
  • AI大模型开发架构设计(3)——如何打造自己的大模型
  • Linux C语言开发(三)运算符和表达式
  • Spring-AOP入门案例
  • 中仕教育:国考调剂和补录的区别是什么?
  • ESP32-TCP服务端(Arduino)
  • HCIA-HarmonyOS设备开发认证-序
  • Med-YOLO:3D + 医学影像 + 检测框架
  • Docker部署Golang服务
  • C#,字符串匹配(模式搜索)Sunday算法的源代码
  • makefile 编译动态链接库使用(.so库文件)
  • Hive 数仓及数仓设计方案
  • Ubuntu使用docker-compose安装redis
  • 大数据安全 | 期末复习(上)| 补档
  • Kylin 安装novnc 远程访问
  • 神经网络算法与逻辑回归:优势与差异
  • 【蓝桥杯冲冲冲】动态规划初步[USACO2006 OPEN] 县集市
  • C#,入门教程(30)——扎好程序的笼子,错误处理 try catch
  • 操作教程|JumpServer堡垒机结合Ansible进行批量系统初始化
  • 序列化VS反序列化
  • 新数智空间:阿里云边缘云持续保持中国公有云市场第一
  • 【开源】基于JAVA语言的陕西非物质文化遗产网站
  • C++(Qt)软件调试---静态分析工具clang-tidy(18)