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

hcip mgre与rip实验

要求:

 1.toop搭建

 2.IP地址规划

R1g 0/0/1 192.168.1.1 24       s 4/0/0 188.0.0.2 24        t:10.0.0.1 24
R2

s 4/0/0 188.0.0.1 24       s 4/0/1 188.0.1.1 24

s 3/0/0 188.0.2.1 24        loop0 8.8.8.8 24        t:10.0.0.2 24

R3g 0/0/1 192.168.2.1   24     s 4/0/0 188.0.1.2 24        t:10.0.0.3 24

R4

g 0/0/1 192.168.3.1  24      s 4/0/0 188.0.2.2 24
pc1192.168.1.2 24
pc2192.168.2.2 24
pc3192.168.3.2 24

 3.配置ip及接口类型

R1

修改serial4/0/0类型为hdlc,配置IP地址

[R1]int g 0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.1.1 24
[R1]int Serial 4/0/0
[R1-Serial4/0/0]link-protocol hdlc //修改类型
[R1-Serial4/0/0]ip add 188.0.0.2 24

R2

修改serial 4/0/0类型为hdlc, 配置ip ,配置环回

[R2]int s4/0/0
[R2-Serial4/0/0]link-protocol hdlc 
[R2-Serial4/0/0]ip address 188.0.0.1 24[R2]int Serial 4/0/1
[R2-Serial4/0/1]ip address 188.0.1.1 24[R2]int Serial 3/0/0
[R2-Serial3/0/0]ip address 188.0.2.1 24[R2]interface LoopBack 0
[R2-LoopBack0]ip address 8.8.8.8 24

R3

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

R4

[R4]int Serial 4/0/0
[R4-Serial4/0/0]ip address 188.0.2.2 24[R4]interface GigabitEthernet 0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.3.1 24

pc1

 pc2, pc3, 同上

4.接口认证

R2-R3之间为PPP封装,pap认证,R2为主认证方

R2

[R2]aaa
[R2-aaa]local-user huawei password cipher 123456
[R2-aaa]local-user huawei service-type ppp[R2]interface Serial 4/0/1
[R2-Serial4/0/1]ppp authentication-mode pap 

R3

[R3]int Serial 4/0/0
[R3-Serial4/0/0]ppp pap local-user huawei password cipher 123456

R2-R4之间为PPP封装,chap认证,R2为主认证方

R2

[R2]interface Serial 3/0/0
[R2-Serial3/0/0]ppp authentication-mode chap 

R3

[R4]int Serial 4/0/0
[R4-Serial4/0/0]ppp chap user huawei 
[R4-Serial4/0/0]ppp chap password cipher 123456

5.配置nat及缺省路由

R1

[R1]ip route-static 0.0.0.0 0 188.0.0.1
[R1]acl 2000
[R1-acl-basic-2000]rule permit source any [R1]interface Serial 4/0/0	
[R1-Serial4/0/0]nat outbound 2000

R3

[R3]ip route-static 0.0.0.0 0 188.0.1.1[R3]acl 2000
[R3-acl-basic-2000]rule permit source any [R3]interface Serial 4/0/0
[R3-Serial4/0/0]nat outbound 2000

R4

[R4]ip route-static 0.0.0.0 0 188.0.2.1 [R4]acl 2000
[R4-acl-basic-2000]rule permit source any [R4]interface Serial 4/0/0
[R4-Serial4/0/0]nat outbound 2000

6.配置MGRE

R1、R2 、R3构建MGRE环境,仅R1IP地址固定, 则令R1为中心站点

R1

[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R1-Tunnel0/0/0]ip add 10.0.0.1 24
[R1-Tunnel0/0/0]source 188.0.0.2 
[R1-Tunnel0/0/0]nhrp network-id 10

R2

[R2]interface Tunnel 0/0/0
[R2-Tunnel0/0/0]  tunnel-protocol gre p2mp[R2-Tunnel0/0/0] source Serial4/0/0
[R2-Tunnel0/0/0] ip address 10.0.0.2 255.255.255.0 
[R2-Tunnel0/0/0]nhrp network-id 10
[R2-Tunnel0/0/0]nhrp entry 10.0.0.1 188.0.0.2 register 

 R3

[R3]interface Tunnel 0/0/0
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source Serial4/0/0
[R3-Tunnel0/0/0]ip address 10.0.0.2 255.255.255.0 
[R3-Tunnel0/0/0]nhrp network-id 10
[R3-Tunnel0/0/0]nhrp entry 10.0.0.1 188.0.0.2 register 

7.在MGRE中起RIP

R1

[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 10.0.0.0[R1-Tunnel0/0/0]nhrp entry multicast dynamic 
[R1-Tunnel0/0/0]undo rip split-horizon 

R2

[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]network 10.0.0.0[R2-Tunnel0/0/0]nhrp entry multicast dynamic 

R3

[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]network 192.168.2.0
[R3-rip-1]network 10.0.0.0[R3-Tunnel0/0/0]nhrp entry multicast dynamic 

关于R4的全网通问题

在r1 r3 r4 之间打一条隧道

R1

[R1]interface Tunnel 0/0/1
[R1-Tunnel0/0/1]tunnel-protocol gre 
[R1-Tunnel0/0/1]ip address 20.0.0.1 24
[R1-Tunnel0/0/1]source 188.0.0.2
[R1-Tunnel0/0/1]destination 188.0.2.2[R1]ip route-static 192.168.3.0 24 20.0.0.4

R3

[R3]interface Tunnel 0/0/1
[R3-Tunnel0/0/1]ip address 30.0.0.3 24
[R3-Tunnel0/0/1]tunnel-protocol gre 	
[R3-Tunnel0/0/1]source Serial 4/0/0
[R3-Tunnel0/0/1]destination 188.0.2.2[R3]ip route-static 192.168.3.0 24 30.0.0.4

R4

[R4]interface Tunnel 0/0/1
[R4-Tunnel0/0/1]tunnel-protocol gre 
[R4-Tunnel0/0/1]ip add 20.0.0.4 24
[R4-Tunnel0/0/1]source Serial 4/0/0
[R4-Tunnel0/0/1]destination 188.0.0.1[R4]interface Tunnel 0/0/2	
[R4-Tunnel0/0/2]tunnel-protocol gre
[R4-Tunnel0/0/2]ip add 30.0.0.4 24 	
[R4-Tunnel0/0/2]source Serial 4/0/0
[R4-Tunnel0/0/2]destination 188.0.1.2 [R4]ip route-static 192.168.1.0 24 Tunnel 0/0/1
[R4]ip route-static 192.168.2.0 24 Tunnel 0/0/2

测试

pc1

 

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

相关文章:

  • 骨传导耳机对身体有没有别的危害?骨传导耳机有什么好处?
  • c++11/c++98动态规划入门第5课,经典DP问题 --- 区间
  • vue中重新获取数据导致页面加长,要求在页面更新之后浏览器滚动条滚动到之前浏览记录的位置。以及获取当前页面中是哪个元素产生滚动条的方法。
  • 【深度学习】日常笔记14
  • [JAVAee]synchronized关键字
  • Unity游戏源码分享-3d机器人推箱子游戏
  • SAAS部署模式
  • 11、PHP面向对象1
  • 实训笔记7.25
  • 全方位对比 Postgres 和 MongoDB (2023 版)
  • 本地部署中文LLaMA模型实战教程,民间羊驼模型
  • 全志F1C200S嵌入式驱动开发(spi-nor image制作)
  • JSON格式Python,Java,PHP等封装图片识别商品数据API方法
  • Vue应用案例
  • GPT-3.5:ChatGPT的奇妙之处和革命性进步
  • 【Hadoop 01】简介
  • 【C++】开源:跨平台轻量日志库easyloggingpp
  • spring-websocket在SpringBoot(包含SpringSecurity)项目中的导入
  • SpringBoot + Vue前后端分离项目实战 || 六:Jwt加密整合配置
  • WPF 如何设置全局的订阅发布事件
  • STM32 USB使用记录:HID类设备(前篇)
  • 探索AI图像安全,助力可信AI发展
  • vue 学习笔记 【ElementPlus】el-menu 折叠后图标不见了
  • 【JavaEE初阶】HTTP协议
  • 基于SaaS模式的Java基层卫生健康云HIS系统源码【运维管理+运营管理+综合监管】
  • effective c++ 条款2
  • Python爬虫之Scrapy框架系列(23)——分布式爬虫scrapy_redis浅实战【XXTop250部分爬取】
  • html基于onmouse事件让元素变颜色
  • Linux环境PostgreSQL安装
  • Rust 数据类型 之 结构体(Struct)