网络学习-eNSP配置VRRP

news2024/9/20 1:05:36

虚拟路由冗余协议(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: Public
         Destinations : 8        Routes : 9        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

    192.168.1.0/24  Direct  0    0           D   192.168.1.252   Vlanif1
    192.168.2.0/24  Direct  0    0           D   192.168.2.2     Vlanif2
    192.168.3.0/24  OSPF    10   2           D   192.168.2.1     Vlanif2
    192.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 1

Interface                         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         Interface
    192.168.1.0/24  Direct  0    0           D   192.168.1.253   Vlanif1
    192.168.2.0/24  OSPF    10   2           D   192.168.3.1     Vlanif3
    192.168.3.0/24  Direct  0    0           D   192.168.3.2     Vlanif3
    192.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 1

Interface                         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 0

Interface                         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

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

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

相关文章

什么是数据库回表,又该如何避免

目录 一. 回表的概念二. 回表的影响三. 解决方案1. 使用覆盖索引2. 合理选择索引列3. 避免选择不必要的列4. 分析和优化查询5. 定期更新统计信息6. 避免使用SELECT DISTINCT或GROUP BY7. 使用适当的数据库设计 数据库中的“回表”是指在查询操作中&#xff0c;当数据库需要访问…

时尚穿搭想换就换,各种风格一键完美搭配!亲测在线虚拟试衣换装平台效果超赞!

随着科技的发展&#xff0c;时尚领域也迎来了新的革命。传统的试衣方式逐渐被现代科技所取代&#xff0c;虚拟试衣间的出现使得用户可以在舒适的家中轻松体验不同的服装风格。 先前给大家也介绍过一些虚拟试衣的技术&#xff0c;例如AnyFit或者OutfitAnyone等&#xff0c;今天…

YOLOv8改进 | 模块缝合 | C2f 融合SCConv提升检测性能【CVPR2023】

秋招面试专栏推荐 &#xff1a;深度学习算法工程师面试问题总结【百面算法工程师】——点击即可跳转 &#x1f4a1;&#x1f4a1;&#x1f4a1;本专栏所有程序均经过测试&#xff0c;可成功执行&#x1f4a1;&#x1f4a1;&#x1f4a1; 专栏目录 &#xff1a;《YOLOv8改进有效…

智能负载均衡:分布式缓存的高效能解决方案

在当今快速发展的互联网时代&#xff0c;分布式缓存成为了提升网站性能和用户体验的关键技术。本文将深入探讨负载均衡算法在分布式缓存中的应用&#xff0c;分析各种算法的优缺点&#xff0c;并提供选择最佳算法的指导。通过实际案例&#xff0c;我们将展示如何通过智能的负载…

2024 年塑造 SaaS 安全的 7 大趋势

在过去的几年里&#xff0c;SaaS已经发展成为企业IT的支柱。医疗实践、律师事务所和金融服务公司等服务企业几乎完全基于 SaaS。非服务企业&#xff08;包括制造商和零售商&#xff09;将大约 70% 的软件运行在云中。 这些应用程序包含大量数据&#xff0c;从最低敏感的一般公司…

黑马点评25—原理—Redis网络模型

文章目录 原理篇-Redis网络模型1 用户空间和内核态空间2.网络模型-阻塞IO3 网络模型-非阻塞IO4 网络模型-IO多路复用5 网络模型-IO多路复用-select方式6 网络模型-IO多路复用模型-poll模式7 网络模型-IO多路复用模型-epoll函数8、网络模型-epoll中的ET和LT9 网络模型-基于epoll…

wireshark打开时空白|没有接口,卸载重装可以解决

解决方法&#xff1a;卸载wireshark,全选卸载干净&#xff0c;重新安装旧版的wireshark4.2.7, 甚至cmd下运行net start npf时显示服务名无效&#xff0c;但打开wireshark仍有多个接口 错误描述&#xff1a; 一开始下载的是wireshark的最新版&#xff0c;win11 x64 在安装wir…

JAVA——方法

public static 返回值类型 方法名(参数){//方法体return 数据; } 一、定义与调用 public class demo9_12 {public static void main(String[] args) {// 调用myName();}//定义public static void myName(){System.out.println("Hello World");} } 运行 二、含参数…

STM32G474之CALIB输出

STM32G474之CALIB输出源是1Hz和512Hz的时钟源。通过测试输出波形&#xff0c;计算RTC输入时钟和理论值之间的误差&#xff0c;为“校准”服务的。 1、CALIB输出原理 2、CALIB输出测试程序 #include "RTC.h" #include "stdio.h" //getchar(),putchar(),s…

蓝桥杯4. Fizz Buzz 经典问题

题目描述 给定一个整数 NN&#xff0c;从 1 到 NN 按照下面的规则返回每个数&#xff1a; 如果这个数被 3 整除&#xff0c;返回 Fizz。如果这个数被 5 整除&#xff0c;返回 Buzz如果这个数能同时被 3 和 5 整除&#xff0c;返回 FizzBuzz。如果这个数既不能被 3 也不能被 5…

智能医学(四)——Elsevier特刊推荐

特刊征稿 01 期刊名称&#xff1a; Information Sciences 特刊名称&#xff1a; Open-world Multi-modal Machine Learning for Uncertain Medicine and Healthcare Big Data Analysis 截止时间&#xff1a; 提交开放日期&#xff1a;2024 年 6 月 15 日 最终手稿提交截止…

sass实现文字两侧横线

sass实现文字两侧横线 自我记录 mixin 的基本作用&#xff1a; 代码复用&#xff1a;把常用的样式封装在一起&#xff0c;不需要重复写相同的代码。参数化&#xff1a;可以通过参数动态生成样式&#xff0c;提高灵活性。逻辑处理&#xff1a;结合 Sass 的控制语句&#xff0…

CAD 3dsmax maya等autodesk系列专用卸载修复工具AutoRemove,一键完全彻底卸载删除软件的专用卸载工具

AutoRemove 是一款功能强大的软件卸载工具&#xff0c;专门设计用于彻底清除Autodesk系列软件&#xff0c;如AutoCAD、3ds Max、Revit、Maya、Inventor、Navisworks、civil 3d、sketchbook、Architecture、Electrical、Mechanical、、等&#xff0c;从您的系统中。它通过深度清…

learn C++ NO.13——list

前言 本文将从list的使用&#xff0c;再到根据sgi库对于list实现作为参考模拟实现一下list。通过模拟实现来增加对它的理解。 介绍list list是一个由带头双向循环链表实现的STL容器&#xff0c;它提供常规时间内对数据进行插入和删除操作。 list在内存中存储不连续的空间存储…

Kamailio-超强dispatcher负载均衡模块

Kamailio 负载均衡的功能主要依靠 Dispatcher 模块完成&#xff0c;模块官方文档参看 为什么要引入负载均衡&#xff1f;如何使用&#xff1f; 引入和配置功能路由调用命令行指令 为什么要引入负载均衡&#xff1f; Q: 如果单台VOIP服务的性能不能满足业务需求了&#xff0…

掌握ZooKeeper的二阶段提交及其优缺点

1. ZooKeeper的协议 1.1 ZAB协议 要深入学习ZooKeeper前&#xff0c;胡广认为我们要先学习ZooKeeper的核心理念&#xff0c;所有的ZooKeeper行为都是围绕这个核心来进行的。说了那么多&#xff0c;它就是——ZAB协议。 ZAB协议英文全称叫ZooKeeper Atomic Broadcast&#xf…

TIDB的整体架构和主要功能

1. 基础架构 PD &#xff1a;负责集群管理和调度。TiDB Server &#xff1a;负责 SQL 查询处理。TiKV/TiFlash&#xff1a;负责数据存储和事务处理。 1.1 PD (Placement Driver) Server 1.1.1 基础介绍 整个 TiDB 集群的元信息管理模块&#xff0c;负责存储每个 TiKV 节点实时…

让我们聊一下小团队也可以用的敏捷开发

使用敏捷开发的团队往往需要寻找一个更佳的平衡点&#xff1a; 较少的团队成员&#xff1a;通常更容易沟通和协作&#xff0c;减少了协调成本。小团队&#xff08;如 5 到 9 人&#xff09;能够更灵活地适应变化&#xff0c;且管理和决策过程较为高效。 较多的团队成员&#x…

喜报 | 知从科技荣获 “AutoSec 安全之星 - 优秀汽车软件供应链安全方案奖”

近日&#xff0c;「AutoSec 2024第八届中国汽车网络安全周暨第五届智能汽车数据安全展」在上海盛大举行。本届大会由谈思实验室和谈思汽车主办、上海市车联网协会联合主办&#xff0c;以汽车“网络数据安全、软件安全、功能安全”为主题&#xff0c;设置了“31X”模式&#xff…

Docker学习笔记-部署MySQL-命令解读

部署MySQL 先停掉虚拟机中的MySQL&#xff0c;确保你的虚拟机已经安装Docker&#xff0c;且网络开通的情况下&#xff0c;在MobaXterm中执行下面命令即可安装MySQL。 docker run -d \--name mysql \-p 3306:3306 \-e TZAsia/Shanghai \-e MYSQL_ROOT_PASSWORD123456 \mysql …