vrrp report finished

This commit is contained in:
2025-10-22 01:30:34 +08:00
parent 727655890f
commit a4e0bfc0f0
23 changed files with 41 additions and 50 deletions

View File

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

View File

@ -1,7 +1,7 @@
#import "labtemplate.typ": *
#show: nudtlabpaper.with(title: "虚拟路由器冗余协议VRRP配置",
author: "程景愉",
id: "202202001046",
id: "202302723005",
training_type: "无军籍",
grade: "2023",
major: "网络工程",
@ -69,7 +69,7 @@
]
=== 工作机理
#para[
主备切换过程Master设备通过发送免费ARP报文将虚拟MAC地址通知给与它连接的设备或者主机从而承担报文转发任务。Master和Backup中会以Advertisement_Interval一般是1秒的时间互相发送通告报文当Backup设备在Master_Down_Interval定时器超时后没有收到对方的通告可认为已经Master设备发生故障。还有一种情况是Master主动弃置地位Master发送优先级为0的通告报文不用等定时器超时经过Skew_Time的时间Backup主动成为Master。注意
主备切换过程Master设备通过发送免费RP报文将虚拟MAC地址通知给与它连接的设备或者主机从而承担报文转发任务。Master和Backup中会以Advertisement_Interval一般是1秒的时间互相发送通告报文当Backup设备在Master_Down_Interval定时器超时后没有收到对方的通告可认为已经Master设备发生故障。还有一种情况是Master主动弃置地位Master发送优先级为0的通告报文不用等定时器超时经过Skew_Time的时间Backup主动成为Master。注意
]
$ "Master_Down_Interval"=3×"Advertisement_Interval" plus "Skew_Time" $ $ "Skew_Time"=(256-"Backup设备的优先级")/256 $P.S. 单位均为秒。
#para[
@ -81,7 +81,7 @@
= 实验环境
== 实验背景
#para[
学校经费充足在网工系学生寝室楼与网安系学生寝室楼之布置了许多路由器。但是这些路由器的供电来自不同线路其中的某几条线路与附近的超算中心相连。超算高负载运行的时候路由器供电电压会受影响导致运行不稳定甚至关机。网工系的学生为了能与网安系学生正常、稳定地开展线上视频学术研讨会议决定在宿舍间路由器集群上配置VRRP协议实现虚拟路由器冗余备份
本实验模拟企业网络场景。公司内员工所用电脑,如 PC-1、PC-2通过交换机LSW1 连接到公司网络LSW1 连接到公司出口网关路由器。为了提高网络的可靠性,公司使用两台路由器 R2 R3 作为双出口连接到外网路由器 RI。RI、R2、R3之间运行 OSPF 协议。在双网关的情况下,如果在 PC 上配置 R2 R3 的真实 IP地址作为网关当其中一台路由器故障时就需要手动更改 PC 的网关 IP若网络中有大量 PC 则需要耗费大量时间和人力去更改配置且会带来一定时间的断网影响。为了能够使故障所造成的断网影响达到最小化增强网络的可靠性网络管理员在R4 R3 之间部署 VRRP 协议,这样当任一网关发生故障时就能自动切换而无需更改 PC 的网关 IP 地址
]
== 实验设备
#align(center)[#table(
@ -92,8 +92,8 @@
table.header(
[*设备名称*], [*设备型号*], [*设备数量*]
),
"交换机", "华为S5735", "2",
"路由器", "华为AR6120-S", "2",
"交换机", "华为S5735", "1",
"路由器", "华为R6120-S", "3",
"PC", "联想启天M410
Windows 10", "2",
)]
@ -105,84 +105,75 @@
#para[
按实验背景,绘制拓扑图如下:
]
#figure(image("实验拓扑.png",format: "png",fit:"stretch",width: 100%),caption: "实验拓扑图")
#figure(image("拓扑.png",format: "png",fit:"stretch",width: 100%),caption: "实验拓扑图")
== 按照拓扑图接线
#para[
按照拓扑图接线。
]
#figure(image("机柜背面连线.jpg",format: "jpg",fit:"stretch",width: 100%),caption: "机柜正面接线图")
#figure(image("机柜正面连线.jpg",format: "jpg",fit:"stretch",width: 100%),caption: "机柜背面接线图")
#figure(image("接线图正面.jpg",format: "jpg",fit:"stretch",width: 100%),caption: "机柜正面接线图")
#figure(image("接线图后面.jpg",format: "jpg",fit:"stretch",width: 100%),caption: "机柜背面接线图")
== 配置PC
#para[
设置网工系寝室楼PC1的IP地址为`192.168.10.10`网关为`192.168.10.111`;设置网安系寝室楼PC2的IP地址为`192.168.20.2`,网关为`192.168.20.111`
设置PC1的IP地址为`172.16.1.1`设置PC2的IP地址为`172.16.1.2`,网关`172.16.1.254`
]
== 配置OSPF协议实现互通
=== 配置路由器IP地址
#para[
配置AR1的G0/0/0口IP地址为`192.168.10.1/24`G0/0/1口IP地址为`192.168.20.1/24`;配置AR2的G0/0/0口IP地址为`192.168.10.3/24`G0/0/1口IP地址为`192.168.20.3/24`
配置R1的G0/0/0口IP地址为`172.18.2.254/24`G0/0/1口IP地址为`172.16.3.254/24`配置R2的G0/0/0口IP地址为`172.16.2.100/24`G0/0/1口IP地址为`172.16.1.100/24`;配置R3的G0/0/0口IP地址为`172.16.3.200/24`G0/0/1口IP地址为`172.16.1.200/24`
]
#figure(image("上_ip.png",format: "png",fit:"stretch",width: 70%),caption: "配置AR1的接口IP地址")
#figure(image("下_ip.png",format: "png",fit:"stretch",width: 70%),caption: "配置AR2的接口IP地址")
#figure(image("step1.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "配置R1的接口IP地址(1)")
#figure(image("step2.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "配置R1的接口IP地址(2)")
#figure(image("step3.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "配置R2的接口IP地址(1)")
#figure(image("step4.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "配置R2的接口IP地址(2)")
#figure(image("step5.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "配置R3的接口IP地址(1)")
#figure(image("step6.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "配置R3的接口IP地址(2)")
=== 配置OSPF协议
#para[
配置AR1的G0/0/0口和G0/0/1口为OSPF区域0的接口配置AR2的G0/0/0口和G0/0/1口为OSPF区域0的接口
为R1R2R3配置OSPF协议实现三台路由器之间的互通
]
#figure(image("上_ospf.png",format: "png",fit:"stretch",width: 70%),caption: "为AR1配置OSPF协议")
#figure(image("下_ospf.png",format: "png",fit:"stretch",width: 100%),caption: "为AR2配置OSPF协议")
#figure(image("step7.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "为R1配置OSPF协议")
#figure(image("step8.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "为R2配置OSPF协议")
#figure(image("step9.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "在R3查看OSPF邻居关系")
== 配置VRRP协议
#para[
配置AR1的G0/0/0口为VRRP组1的Master优先级为120并配置抢占延迟时间为5秒实际推荐20秒配置AR2的G0/0/0口为VRRP组1的Backup优先级缺省为100
在R2和R3的内网接口上配置VRRP
]
#figure(image("上_vrrp.png",format: "png",fit:"stretch",width: 100%),caption: "配置AR1")
#figure(image("下_vrrp.png",format: "png",fit:"stretch",width: 100%),caption: "配置AR2")
#figure(image("step10.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "在 R2 (主网关) 上配置 VRRP (1)")
#figure(image("step11.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "在 R2 (主网关) 上配置 VRRP (2)")
#figure(image("step12.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "在 R3 (备网关) 上配置 VRRP (1)")
== 配置检验
#para[
使用`display vrrp`命令查看VRRP组的状态确认Master和Backup的状态。
AR1上执行`display vrrp`命令,显示如下:
R2上执行`display vrrp`命令,显示如下:
]
#figure(image("上_disp_vrrp_断开接口前.png",format: "png",fit:"stretch",width: 55%),caption: "AR1显示VRRP组状态")
#figure(image("step14.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "R2显示VRRP组状态")
#para[
可以看到AR1的G0/0/0口为Master状态为Master优先级为120。
AR2上执行`display vrrp`命令,显示如下:
可以看到R2的G0/0/1口为Master状态为Master优先级为120。
R3上执行`display vrrp`命令,显示如下:
]
#figure(image("下_disp_vrrp_断开接口前.png",format: "png",fit:"stretch",width: 55%),caption: "AR2显示VRRP组状态")
#figure(image("step13.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "R3显示VRRP组状态")
#para[
AR2的G0/0/0口为Backup状态为Backup优先级为100。
此时使用`traceroute`命令检验网工系寝室楼PC1到网安系寝室楼PC2的连通性,显示如下:
R3的G0/0/1口为Backup状态为Backup优先级为100。
此时使用`traceroute`命令检验PC1到R1的连通性,显示如下:
]
#figure(image("断开前ping.png",format: "png",fit:"stretch",width: 55%),caption: "traceroute命令查看路由")<beforeoff>
#figure(image("step15.jpg",format: "jpg",fit:"stretch",width: 55%),caption: "traceroute命令查看路由")<beforeoff>
#para[
@beforeoff 中显示从PC1到PC2的路径为`192.168.10.2->192.168.10.1->192.168.20.2`,经过的是AR1
现在对AR1的G0/0/0口执行`shutdown`命令关闭该接口:
@beforeoff 中显示从PC1到R1的路径为`172.16.2.1->172.16.1.200->172.18.2.254`,经过的是R2
现在对R2的G0/0/1口执行`shutdown`命令关闭该接口,再次使用`traceroute`命令检验连通性,显示如下
]
#figure(image("上_shutdown.png",format: "png",fit:"stretch",width: 50%),caption: "关闭AR1的G0/0/0口")
#figure(image("step17.jpg",format: "jpg",fit:"stretch",width: 55%),caption: "断开后traceroute命令查看路由")<afteroff>
#para[
再次使用`traceroute`命令检验连通性,显示如下:
@afteroff 中显示从PC1到R1的路径出现变化VRRP协议生效实现了主备切换保证了网络的连通性。
]
#figure(image("断开后ping.png",format: "png",fit:"stretch",width: 55%),caption: "断开后traceroute命令查看路由")<afteroff>
#figure(image("step16.jpg",format: "jpg",fit:"stretch",width: 55%),caption: "断开后ping命令查看连通性")
#para[
@afteroff 中显示从PC1到PC2的路径为`192.168.10.2->192.168.10.3->192.168.20.2`经过的是AR2
这时在AR1上执行`display vrrp`命令,显示如下:
]
#figure(image("上_disp_vrrp_断开接口后.png",format: "png",fit:"stretch",width: 50%),caption: "AR1显示VRRP组状态")
#para[
可以看到AR1的G0/0/0口状态为Backup。
最后再对R2的G0/0/1口添加track功能监控接口状态当接口恢复时自动切换回主路由器
]
#figure(image("step18.jpg",format: "jpg",fit:"stretch",width: 50%),caption: "开启track功能监控接口状态")
#para[
最后再次对AR1的G0/0/0口执行`undo shutdown`命令开启该接口:
]
#figure(image("上_undo_shutdown.png",format: "png",fit:"stretch",width: 50%),caption: "开启AR1的G0/0/0口")
#para[
在AR1上执行`display vrrp`命令,显示如下:
]
#figure(image("上_disp_vrrp_重新打开接口后.png",format: "png",fit:"stretch",width: 50%),caption: "恢复接口状态后AR1显示VRRP组状态")
#para[
可以看到AR1的G0/0/0口状态为Master即主备备份状态恢复。
]
#para[
至此VRRP协议配置完成网工系与网安系之间的通信实现了冗余备份学生们能够通过稳定的线上视频学术研讨会进行学术交流可以不受超算马力全开对路由器电力资源造成的影响。
至此VRRP协议配置完成PC1与PC2之间的通信实现了冗余备份。
]
= 实验总结
#para[

BIN
5_vrrp/拓扑图.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 KiB

BIN
5_vrrp/接线图后面.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 MiB

BIN
5_vrrp/接线图正面.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 MiB