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

网络学习-eNSP配置VRRP

虚拟路由冗余协议(Virtual Router Redundancy Protocol,简称VRRP)

VRRP广泛应用在边缘网络中,是一种路由冗余协议,它的设计目标是支持特定情况下IP数据流量失败转移不会引起混乱,允许主机使用单路由器,以及即使在实际第一跳路由器使用失败的情形下仍能够维护路由器间的连通性。

在这里插入图片描述

#配置三层交换机和路由器IP,实现PC1与PC2的通信
#---------------------1.LSW1配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname sw1
#配置vlan1的地址,作为网关
[sw1]interface vlanif 1
[sw1-Vlanif1]ip address 192.168.1.252 24
[sw1-Vlanif1]quit
[sw1]vlan 2
[sw1-vlan2]quit        
#设置接入链路,配置vlan2地址,作为向外传输出口            
[sw1]interface gigabitethernet 0/0/2
[sw1-GigabitEthernet0/0/2]port link-type access
[sw1-GigabitEthernet0/0/2]port default vlan 2
[sw1-GigabitEthernet0/0/2]quit
[sw1]interface vlanif 2
[sw1-Vlanif2]ip address 192.168.2.2 24
[sw1-Vlanif2]quit
#通过配置动态路由实现网段互通
[sw1]ospf
[sw1-ospf-1]area 0
[sw1-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[sw1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[sw1-ospf-1-area-0.0.0.0]display ip routing-table | include /24
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 8        Routes : 9        Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface192.168.1.0/24  Direct  0    0           D   192.168.1.252   Vlanif1192.168.2.0/24  Direct  0    0           D   192.168.2.2     Vlanif2192.168.3.0/24  OSPF    10   2           D   192.168.2.1     Vlanif2192.168.4.0/24  OSPF    10   2           D   192.168.2.1     Vlanif2
[sw1-ospf-1-area-0.0.0.0]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1Interface                         IP Address/Mask      Physical   Protocol  
MEth0/0/1                         unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Vlanif1                           192.168.1.252/24     up         up        
Vlanif2                           192.168.2.2/24       up         up 
#---------------------2.LSW2配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw2
[sw2]undo info-center enable
Info: Information center is disabled.
[sw2]interface vlanif 1
[sw2-Vlanif1]ip address 192.168.1.253 24
[sw2-Vlanif1]quit
[sw2]vlan 3
[sw2-vlan3]quit
[sw2]interface gigabitethernet 0/0/2
[sw2-GigabitEthernet0/0/2]port link-type access
[sw2-GigabitEthernet0/0/2]port default vlan 3
[sw2-GigabitEthernet0/0/2]quit
[sw2]interface vlanif 3
[sw2-Vlanif3]ip address 192.168.3.2 24
[sw2-Vlanif3]quit
#配置动态路由
[sw2]ospf 
[sw2-ospf-1]area 0
[sw2-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[sw2-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[sw2-ospf-1-area-0.0.0.0]display ip routing-table | include /24
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public         Destinations : 8        Routes : 9        
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface192.168.1.0/24  Direct  0    0           D   192.168.1.253   Vlanif1192.168.2.0/24  OSPF    10   2           D   192.168.3.1     Vlanif3192.168.3.0/24  Direct  0    0           D   192.168.3.2     Vlanif3192.168.4.0/24  OSPF    10   2           D   192.168.3.1     Vlanif3
[sw2-ospf-1-area-0.0.0.0]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1Interface                         IP Address/Mask      Physical   Protocol  
MEth0/0/1                         unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Vlanif1                           192.168.1.253/24     up         up        
Vlanif3                           192.168.3.2/24       up         up  
#---------------------3.AR1配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]interface gigabitethernet 0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]interface gigabitethernet 0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 192.168.3.1 24
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]interface gigabitethernet 0/0/2
[Huawei-GigabitEthernet0/0/2]ip address 192.168.4.254 24
[Huawei-GigabitEthernet0/0/2]quit
[Huawei]ospf
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255 
[Huawei-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255[Huawei]display ip routing-table | include /24
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public         Destinations : 14       Routes : 15       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
192.168.1.0/24  OSPF    10   2           D   192.168.2.2     GigabitEthernet0/0/0
192.168.2.0/24  Direct  0    0           D   192.168.2.1     GigabitEthernet0/0/0
192.168.3.0/24  Direct  0    0           D   192.168.3.1     GigabitEthernet0/0/1
192.168.4.0/24  Direct  0    0           D   192.168.4.254   GigabitEthernet0/0/2
[Huawei]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 0Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.2.1/24       up         up        
GigabitEthernet0/0/1              192.168.3.1/24       up         up        
GigabitEthernet0/0/2              192.168.4.254/24     up         up        
NULL0                             unassigned           up         up(s)  
VRRP组成员
  • 主路由器
  • 备份路由器
  • 虚拟路由器
VRRP配置
#---------配置LSW1
[sw1]interface vlanif 1
[sw1-Vlanif1]vrrp vrid 1 virtual-ip 192.168.1.254
#查询VRRP状态
[sw1-Vlanif1]display vrrp brief
VRID  State        Interface                Type     Virtual IP     
----------------------------------------------------------------
1     Master       Vlanif1                  Normal   192.168.1.254  
----------------------------------------------------------------
Total:1     Master:1     Backup:0     Non-active:0 
#---------配置LSW2
[sw2]interface vlanif 1
[sw2-Vlanif1]vrrp vrid 1 virtual-ip 192.168.1.254
[sw2-Vlanif1]display vrrp brief
VRID  State        Interface                Type     Virtual IP     
----------------------------------------------------------------
1     Backup       Vlanif1                  Normal   192.168.1.254  
----------------------------------------------------------------
Total:1     Master:0     Backup:1     Non-active:0 
#--------VRRP定义优先级,默认100,数值越大,优先给越高
[sw1]interface vlanif1
[sw1-Vlanif1]vrrp vrid 1 priority 199
[sw1-Vlanif1]display vrrp brief
VRID  State        Interface                Type     Virtual IP     
----------------------------------------------------------------
1     Master       Vlanif1                  Normal   192.168.1.254  
----------------------------------------------------------------
Total:1     Master:1     Backup:0     Non-active:0

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 第15-02章:理解Class类并获取Class实例
  • 食品加工废水处理设备工作原理
  • C51单片机-单按键输入识别,键盘消抖
  • 极狐GitLab CI/CD 作业一直处于等待状态,如何解决?
  • 用Qt 对接‌百度语音识别接口
  • Altium designer布线技巧
  • 在字节跳动干了3年网络安全工程师,网络工程师30岁以后还有企业要吗
  • 机器学习和深度学习存在显著区别
  • CentOS Stream 8 通过 Packstack 安装开源 OpenStack(V版)
  • 60. n 个骰子的点数【难】
  • 裸金属服务器怎么实现算力共享,裸金属服务器提供者怎么做,租户怎样使用,共享平台需要搭建什么
  • 深入理解Appium定位策略与元素交互
  • FISC安全対策基準
  • 网络工程师考试真题及解析
  • 代码随想录算法训练营第28天 | 第九章动态规划 part01
  • JS 中的深拷贝与浅拷贝
  • 【每日笔记】【Go学习笔记】2019-01-10 codis proxy处理流程
  • 0基础学习移动端适配
  • AHK 中 = 和 == 等比较运算符的用法
  • CSS3 变换
  • JavaScript 一些 DOM 的知识点
  • JS题目及答案整理
  • PHP面试之三:MySQL数据库
  • React+TypeScript入门
  • 读懂package.json -- 依赖管理
  • 函数式编程与面向对象编程[4]:Scala的类型关联Type Alias
  • 汉诺塔算法
  • 聚簇索引和非聚簇索引
  • 如何设计一个微型分布式架构?
  • 微信小程序实战练习(仿五洲到家微信版)
  • 学习笔记DL002:AI、机器学习、表示学习、深度学习,第一次大衰退
  • 中文输入法与React文本输入框的问题与解决方案
  • 最简单的无缝轮播
  • d²y/dx²; 偏导数问题 请问f1 f2是什么意思
  • 如何在 Intellij IDEA 更高效地将应用部署到容器服务 Kubernetes ...
  • ​无人机石油管道巡检方案新亮点:灵活准确又高效
  • #我与Java虚拟机的故事#连载14:挑战高薪面试必看
  • #我与Java虚拟机的故事#连载18:JAVA成长之路
  • $.ajax()方法详解
  • $redis-setphp_redis Set命令,php操作Redis Set函数介绍
  • (20)docke容器
  • (4)(4.6) Triducer
  • (52)只出现一次的数字III
  • (不用互三)AI绘画工具应该如何选择
  • (动手学习深度学习)第13章 计算机视觉---微调
  • (附源码)ssm失物招领系统 毕业设计 182317
  • (规划)24届春招和25届暑假实习路线准备规划
  • (十六)Flask之蓝图
  • (转)Groupon前传:从10个月的失败作品修改,1个月找到成功
  • (转)Linux NTP配置详解 (Network Time Protocol)
  • (转)机器学习的数学基础(1)--Dirichlet分布
  • .gitignore文件忽略的内容不生效问题解决
  • .NET LINQ 通常分 Syntax Query 和Syntax Method
  • .Net Redis的秒杀Dome和异步执行
  • .net 发送邮件