网络学习-eNSP配置VRRP

news/2024/9/17 7:21:18/ 标签: 网络, 学习

虚拟路由冗余协议(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

http://www.ppmy.cn/news/1522701.html

相关文章

HTTP 一、基础知识

一、概述 1、概述 HTTP&#xff08;Hyper Text Transfer Protocol&#xff09;&#xff1a; 全称超文本传输协议&#xff0c;是用于从万维网&#xff08;WWW:World Wide Web &#xff09;服务器传输超文本到本地浏览器的传送协议。HTTP 是一种应用层协议&#xff0c;是基于 …

微知-BIOS中的XHCI模式是什么意思?(usb3.0的扩展控制器影响usb3.0速率等选项)

XHCI “eXtensible Host Controller Interface” “可扩展主机控制器接口”。 英特尔公司开发的一个USB主机控制器接口&#xff0c;主要面向USB 3.0&#xff0c;同时也支持USB 2.0及以下版本的设备。 是usb3.0的核心部分。 有他表示主机支持usb3.0 三种模式&#xff1a;Smart …

效率神器Listary,附激活码

相信很多人都在用Everything&#xff0c;但是我更钟情于Listary&#xff0c;双击Ctrl即可实现软件调用&#xff0c;支持命令、文件搜索、网络搜索&#xff0c;妥妥的增效神器&#xff0c; 软件使用 文件查找时&#xff0c;双击Ctrl调用搜索框后再双击Ctrl&#xff0c;可以打开…

全国大学生数学建模竞赛全国奖项评阅工作规范(2023年修订稿)

为了适应新的形势,更好地促进全国大学生数学建模竞赛活动的健康发展,进一步提高全国奖项评阅工作的质量和公正、公平性,根据《全国大学生数学建模竞赛章程》和竞赛活动的现状,特制订本规范。 一、评阅组的组成 第一条 全国评阅专家组(以下简称评阅组)由全国大学生数学建…

达梦数据库管理员常用SQL(一)

达梦数据库管理员常用SQL(一) 数据库基本信息数据库参数信息表空间信息日志文件信息进程和线程信息会话连接信息SQL执行信息等待事件信息事务和锁信息数据库基本信息 --查询数据库内部版本号 select id_code; select build_version from v$instance; select * from v$versi…

【游戏安全】CheatEngine基础使用——如何对不同类型的数值进行搜索?如何破解数值加密找到想修改的数值?

游戏安全 不同数值类型的搜索破解简单数值加密 不同数值类型的搜索 可以在游戏中看到很精确的物品数量&#xff0c;但是在CE中却什么都扫不到。 这是因为他的数值类型可能并不是四字节的&#xff0c;在游戏中这个数值的机制是一个慢慢增长的数值&#xff0c;所以他很有可能是…

使用 docker 部署 kvm 图形化管理工具 WebVirtMgr

文章目录 [toc]前提条件镜像构建启动 webvirtmgr创建其他 superuser配置 nginx 反向代理和域名访问绑定 kvm 宿主机local sockettcp 连接 虚拟机创建创建快照虚拟机克隆删除虚拟机 kvm 官方提供了以下这些图形化管理&#xff0c;license 这块也提示了是商业版&#xff08;Comme…

利士策分享,如何规划多彩的大学生活?

利士策分享&#xff0c;学习规划多彩的大学生活 踏入大学&#xff0c;如同开启一场充满未知与可能的旅程。 为了让这段旅程不仅充满学术的熏陶&#xff0c;还洋溢着生活的多彩与人际的和谐&#xff0c;我们需要精心规划&#xff0c;积极行动。 一、多彩规划&#xff1a;点亮大学…

SpringBoot教程(十五) | SpringBoot集成RabbitMq(消息丢失、消息重复、消息顺序、消息顺序)

SpringBoot教程&#xff08;十五&#xff09; | SpringBoot集成RabbitMq&#xff08;消息丢失、消息重复、消息顺序、消息顺序&#xff09; RabbitMQ常见问题解决方案问题一&#xff1a;消息丢失的解决方案&#xff08;1&#xff09;生成者丢失消息丢失的情景解决方案1&#xf…

点赞收藏功能该如何设计?

这周给一个小伙伴做模拟面试&#xff0c;因为他在公司的项目是一个短视频电商的项目&#xff0c;模仿的是微博。看到他简历里写了做了短视频的收藏功能&#xff0c;于是让他讲讲具体的做法是什么样子的。 结果回答的并不理想&#xff0c;答案里有不少硬伤&#xff0c;今天松哥…

【Python】CSV文件的简单使用

1.读取CSV文件 import csvpath "123.csv"with open(path) as f: # 打开csv文件csvReader csv.reader(f) # 读文件建立Reader对象listReader list(csvReader) # 将数据转换成列表print(listReader)2.写入CSV文件 import csvpath "123.csv"with ope…

uniapp小程序下载缓存服务器上的图片

1. 使用uni.downloadFile,但是注意下载图片的地址里的域名&#xff0c;需要在微信公众平台里面的downloadFile合法域名进行配置。 export default function downloadAndCacheImage(imageUrl, name) {return new Promise((resolve, reject) > {console.log("imageUrl&q…

【消息中间件】Kafka从入门到精通

1 Kafka入门 概念 架构 1.1 概述 1.1.1 初始Kafka Kafka是一个由Scala和Java语言开发的&#xff0c;经典高吞吐量的分布式消息发布和订阅系统&#xff0c;也是大数据技术领域中用作数据交换的核心组件之一。以高吞吐&#xff0c;低延迟&#xff0c;高伸缩&#xff0c;高可靠…

DDD的实现流程

领域驱动设计&#xff08;DDD&#xff09;是一种面向领域的软件设计方法。它强调将业务知识和业务逻辑集成到软件设计中&#xff0c;从而提高软件系统的可维护性、可扩展性和可测试性。DDD 的实现流程主要包括以下几个步骤&#xff1a; 确定业务领域 首先&#xff0c;需要明确…

有temp表包含A,B两列,使用SQL,对B列进行处理,形成C列,按A列顺序,B列值不变,则C列累计技术,B列值变化,则C列重新开始计数

有temp表&#xff0c;使用SQL&#xff0c;对B列进行处理&#xff0c;形成C列&#xff0c;按A列顺序&#xff0c;B列值不变&#xff0c;则C列累计技术&#xff0c;B列值变化&#xff0c;则C列重新开始计数 建表语句如下 CREATE TABLE temp(A STRING ,B STRING );INSERT INTO …

C语言 - 预处理详解(一)#预定义符号 ##define #undef

文章目录 前言 一、预定义符号 二、#define (一)、#define 定义的标识符 (二)、#define 定义的宏 (三)、#define 替换规则 (四)、# 和 ## 1、 # 的作用 2、## 的作用 (五)、带副作用的宏参数 (六)、宏和函数的对比 (七)、命名约定 三、#undef 总结 前言 路漫漫其修远兮&#…

【双指针】N数之和

N数之和 两数之和题目题目解析暴力思路双指针优化 三数之和题目题目解析暴力思路双指针优化 四数之和题目题目解析暴力思路双指针优化 两数之和 题目 题目链接: 查找总价格为目标值的两个商品 虽然题目名字不是两数之和, 但是由于和后面的三数之和, 四数之和是连起来的, 于是…

【持续更新】Adobe Audition 2024 (v24.4.1.003)最新免费修改版

Adobe Audition是一款专为录音、编辑和掌握音频素材设计的专业解决方案。此编辑器支持从MP3、AAC到AIFF等多种重要格式&#xff0c;并能从CD中导入音轨。 其多轨编辑功能使您可以在任意数量的轨道上混合音乐、语音和声音片段&#xff0c;运用丰富的工作室动态效果&#xff0c;如…

nginx配置中的服务器名称

通常&#xff0c;在nginx的配置节中&#xff1a; server {listen 80;server_name example.org www.example.org;... } server_name(服务器名称) 指令定义确定哪个服务器块用于给定请求。可以使用确切名称、通配符名称、ip地址或正则表达式来定义它们&#xff1a; se…

如何在 AWS S3 中设置跨区域复制

如何在 AWS S3 中设置跨区域复制 概述 欢迎来到雲闪世界。 Amazon Simple Storage Service (S3) 是一种可扩展的对象存储服务&#xff0c;广泛用于存储和检索数据。其主要功能之一是跨区域复制 (CRR)&#xff0c;允许跨不同的 AWS 区域自动异步复制对象。此功能对于灾难恢复、…