vrrp report initialized

This commit is contained in:
2025-10-21 01:05:11 +08:00
parent 8775de51ab
commit 59045e9f9a
39 changed files with 362 additions and 0 deletions

153
5_vrrp/labtemplate.typ Normal file
View File

@ -0,0 +1,153 @@
#let times = "Times LT Pro"
#let times = "Times New Roman"
#let song = (times, "Noto Serif CJK SC")
#let hei = (times, "Noto Sans CJK SC")
#let kai = (times, "Noto Serif CJK SC")
#let xbsong = (times, "Noto Serif CJK SC")
#let fsong = (times, "Noto Serif CJK SC")
#let code = (times, "JetBrains Mono")
#let nudtlabpaper(title: "",
author: "",
id: "",
training_type:"",
grade: "",
major: "",
department: "",
advisor: "",
jobtitle: "",
lab: "",
date: "",
header_str: "",
body) = {
// Set the document's basic properties.
set document(author: author, title: title)
set page(
margin: (left: 30mm, right: 30mm, top: 30mm, bottom: 30mm),
)
// Title row.
v(158pt)
align(center)[
#block(text(weight: 700, size: 30pt, font: hei, tracking: 15pt, "网络工程"))
]
align(center)[
#block(text(weight: 700, size: 30pt, font: song, tracking: 15pt, "本科实验报告"))
]
v(103pt)
pad(
left: 1em,
right: 1em,
grid(
columns: (80pt, 1fr),
rows: (17pt, auto),
text(weight: 700, size: 16pt, font: song, "实验名称:"),
align(center, text(weight: "regular", size: 16pt, font: song, title)),
text(""),
line(length: 100%)
)
// #block(text(weight: 700, 1.75em, title))
// underline(text(weight: 700, size: 16pt, font: song, title))
)
// Author information.
v(82.5pt)
grid(
columns: (0.25fr, 0.25fr, 0.25fr, 0.25fr),
rows: (15pt, 8pt, 15pt, 8pt, 15pt, 8pt, 15pt, 8pt, 15pt),
text(size: 14pt, font: song, tracking: 10pt, "学员姓名"),
align(center, text(size: 14pt, font: song, author)),
text(size: 14pt, font: song, tracking: 54pt, "学号"),
align(center, text(size: 14pt, font: times, id)),
text(""),
line(length: 100%),
text(""),
line(length: 100%),
text(size: 14pt, font: song, tracking: 9pt, "培养类型"),
align(center, text(size: 14pt, font: song, training_type)),
text(size: 14pt, font: song, tracking: 54pt, "年级"),
align(center, text(size: 14pt, font: times, grade)),
text(""),
line(length: 100%),
text(""),
line(length: 100%),
text(size: 14pt, font: song, tracking: 54pt, "专业"),
align(center, text(size: 14pt, font: song, major)),
text(size: 14pt, font: song, tracking: 9pt, "所属学院"),
align(center, text(size: 14pt, font: song, department)),
text(""),
line(length: 100%),
text(""),
line(length: 100%),
text(size: 14pt, font: song, tracking: 9pt, "指导教员"),
align(center, text(size: 14pt, font: song, advisor)),
text(size: 14pt, font: song, tracking: 54pt, "职称"),
align(center, text(size: 14pt, font: song, jobtitle)),
text(""),
line(length: 100%),
text(""),
line(length: 100%),
text(size: 14pt, font: song, tracking: 20pt, "实验室"),
align(center, text(size: 14pt, font: song, lab)),
text(size: 14pt, font: song, tracking: 9pt, "实验时间"),
align(center, text(size: 14pt, font: song, date)),
text(""),
line(length: 100%),
text(""),
line(length: 100%),
)
v(50.5pt)
align(center, text(font: hei, size: 15pt, "国防科技大学教育训练部制"))
pagebreak()
set page(
margin: (left: 30mm, right: 30mm, top: 30mm, bottom: 30mm),
numbering: "i",
number-align: center,
)
v(14pt)
align(center)[
#block(text(font: hei, size: 14pt, "《本科实验报告》填写说明"))
]
v(14pt)
text("")
par(first-line-indent: 2em, text(font: song, size: 12pt, "实验报告内容编排应符合以下要求:"))
par(first-line-indent: 2em, text(font: fsong, size: 12pt, "1采用A421cm×29.7cm白色复印纸单面黑字。上下左右各侧的页边距均为3cm缺省文档网格字号为小4号中文为宋体英文和阿拉伯数字为Times New Roman每页30行每行36字页脚距边界为2.5cm页码置于页脚、居中采用小5号阿拉伯数字从1开始连续编排封面不编页码。"))
par(first-line-indent: 2em, text(font: fsong, size: 12pt, "2报告正文最多可设四级标题字体均为黑体第一级标题字号为4号其余各级标题为小4号标题序号第一级用“一、”、“二、”……第二级用“”、“” ……第三级用“1.”、“2.” ……第四级用“1”、“2” ……,分别按序连续编排。"))
par(first-line-indent: 2em, text(font: fsong, size: 12pt, "3正文插图、表格中的文字字号均为5号。"))
pagebreak()
set page(
margin: (left: 30mm, right: 30mm, top: 30mm, bottom: 30mm),
numbering: "1",
number-align: center,
)
set heading(numbering: "1.1")
// set text(font: hei, lang: "zh")
show heading: it => box(width: 100%)[
#v(0.50em)
#set text(font: hei)
#counter(heading).display()
// #h(0.5em)
#it.body
]
// Main body.
set par(justify: true)
body
}
#let para(t) = par(first-line-indent: 2em, text(font: song, size: 10.5pt, t))

9
5_vrrp/ref.yml Normal file
View File

@ -0,0 +1,9 @@
huaweiInterfaceManagementConfigurationGuide:
type: Web
title: NetEngine AR5700, AR6700, AR8000 V600R024C00配置指南
author: 华为
date: 2023-11-21
url:
value: https://support.huawei.com/enterprise/zh/doc/EDOC1100412130
abstract: 本文档为华为NetEngine AR5700, AR6700, AR8000系列设备V600R024C00版本配置指南主要介绍接口管理配置相关内容。
language: zh-Hans

BIN
5_vrrp/vrrp.pdf Normal file

Binary file not shown.

200
5_vrrp/vrrp.typ Normal file
View File

@ -0,0 +1,200 @@
#import "labtemplate.typ": *
#show: nudtlabpaper.with(title: "虚拟路由器冗余协议VRRP配置",
author: "程景愉",
id: "202202001046",
training_type: "无军籍",
grade: "2023",
major: "网络工程",
department: "计算机学院",
advisor: "张军",
jobtitle: "工程师",
lab: "306-707",
date: "2025.09.26",
header_str: "《网络工程》实验报告",
)
#set page(header: [
#set par(spacing: 6pt)
#align(center)[#text(size: 11pt)[《网络工程》实验报告]]
#v(-0.3em)
#line(length: 100%, stroke: (thickness: 1pt))
],)
#show heading: it => box(width: 100%)[
#v(0.50em)
#set text(font: hei)
#it.body
]
#outline(title: "目录",depth: 3, indent: 1em)
// #pagebreak()
#outline(
title: [图目录],
target: figure.where(kind: image),
)
#show heading: it => box(width: 100%)[
#v(0.50em)
#set text(font: hei)
#counter(heading).display()
// #h(0.5em)
#it.body
]
#set enum(indent: 0.5em,body-indent: 0.5em,)
#pagebreak()
= 实验目的
1. 了解虚拟路由器冗余协议VRRP的基本概念
2. 掌握VRRP协议的工作原理
3. 掌握VRRP协议的配置方法。
#para[
通过本实验我将学习虚拟路由器冗余协议VRRP的基本概念理解其在提高网络可靠性和可用性方面的重要作用并熟悉其工作机制包括虚拟路由器角色的划分、主备切换的触发条件及优先级的配置影响。同时通过实际配置VRRP协议我将掌握相关命令和参数的设置方法了解如何根据网络需求优化配置以确保高效稳定的运行。实验还将通过模拟网络故障场景验证VRRP在主路由器失效情况下的自动切换能力和高可用特性帮助深入理解冗余技术的应用价值。此外实验还将增强对冗余协议如HSRP、GLBP与负载均衡技术异同点的认识为在实际网络环境中应用和维护相关技术奠定基础。
]
= 实验原理
== VRRP概述
#para[
单网关、多网关这两种设计方案都要有各自的缺点。单网关缺陷当路由器的网关接口发生故障时会导致无法与本网段下的所有主机正常通信。多网关缺陷主机的网关只可以有一个如果存在多个网关会导致IP地址冲突无法正常寻址。
]
#para[
而虚拟路由器冗余协议Virtual Router Redundancy Protocol简称VRRP能够在不改变组网的情况下将多台路由器虚拟成一个虚拟路由器通过配置虚拟路由器的IP地址为默认网关实现网关的冗余备份提高网络的可靠性和可用性。
]
== VRRP术语
- 虚拟路由器Virtual Router由多台路由器组成的一个虚拟路由器提供默认网关服务。
- 主路由器Master Router虚拟路由器中的主要路由器提供默认网关服务。
- 备份路由器Backup Router虚拟路由器中的备用路由器当主路由器失效时备份路由器接管主路由器的工作。
- 路由器IDRouter ID路由器的唯一标识用于VRRP协议中的路由器选举。
== VRRP工作原理
=== 路由器选举
#para[
VRRP路由器选举是指在一个VRRP组中多台路由器通过VRRP协议选举出主路由器。VRRP备份组中的设备根据优先级选举出Master。选举规则比较优先级的大小优先级高者当选为Master设备。当两台设备优先级相同时如果已经存在Master则其保持Master身份无需继续选举如果不存在Master则继续比较接口IP地址大小接口IP地址较大的设备当选为Master设备。
]
=== 工作机理
#para[
主备切换过程Master设备通过发送免费ARP报文将虚拟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[
恢复过程当原Master的故障已经恢复会触发抢占机制抢占时间为0即现Master地位变为Backup。
]
#para[
此外如果虚拟路由器都在互发通告时由于网络拥塞使得Master没有在规定时间内接受到对端报文变成BackupBackup变为Master但是此时原Master又接受到了原Backup的通告这样会使他们的地位不断地发生变化导致网络震荡。我们可以配置抢占时间在Backup等待了定时器超时在等待delay超时仍然没有对方的通告时则宣告自己为Master。
]
= 实验环境
== 实验背景
#para[
学校经费充足在网工系学生寝室楼与网安系学生寝室楼之布置了许多路由器。但是这些路由器的供电来自不同线路其中的某几条线路与附近的超算中心相连。超算高负载运行的时候路由器供电电压会受影响导致运行不稳定甚至关机。网工系的学生为了能与网安系学生正常、稳定地开展线上视频学术研讨会议决定在宿舍间路由器集群上配置VRRP协议实现虚拟路由器冗余备份。
]
== 实验设备
#align(center)[#table(
columns: (auto, auto,auto),
rows:(1.5em,1.5em,2.5em),
inset: 10pt,
align: horizon+center,
table.header(
[*设备名称*], [*设备型号*], [*设备数量*]
),
"交换机", "华为S5735", "2",
"路由器", "华为AR6120-S", "2",
"PC", "联想启天M410
Windows 10", "2",
)]
#para[
另有网线若干控制线2条。
]
= 实验步骤及结果
== 实验拓扑
#para[
按实验背景,绘制拓扑图如下:
]
#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: "机柜背面接线图")
== 配置PC
#para[
设置网工系寝室楼PC1的IP地址为`192.168.10.10`,网关为`192.168.10.111`设置网安系寝室楼PC2的IP地址为`192.168.20.2`,网关为`192.168.20.111`
]
== 配置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`
]
#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地址")
=== 配置OSPF协议
#para[
配置AR1的G0/0/0口和G0/0/1口为OSPF区域0的接口配置AR2的G0/0/0口和G0/0/1口为OSPF区域0的接口。
]
#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协议")
== 配置VRRP协议
#para[
配置AR1的G0/0/0口为VRRP组1的Master优先级为120并配置抢占延迟时间为5秒实际推荐20秒配置AR2的G0/0/0口为VRRP组1的Backup优先级缺省为100。
]
#figure(image("上_vrrp.png",format: "png",fit:"stretch",width: 100%),caption: "配置AR1")
#figure(image("下_vrrp.png",format: "png",fit:"stretch",width: 100%),caption: "配置AR2")
== 配置检验
#para[
使用`display vrrp`命令查看VRRP组的状态确认Master和Backup的状态。
在AR1上执行`display vrrp`命令,显示如下:
]
#figure(image("上_disp_vrrp_断开接口前.png",format: "png",fit:"stretch",width: 55%),caption: "AR1显示VRRP组状态")
#para[
可以看到AR1的G0/0/0口为Master状态为Master优先级为120。
在AR2上执行`display vrrp`命令,显示如下:
]
#figure(image("下_disp_vrrp_断开接口前.png",format: "png",fit:"stretch",width: 55%),caption: "AR2显示VRRP组状态")
#para[
AR2的G0/0/0口为Backup状态为Backup优先级为100。
此时使用`traceroute`命令检验网工系寝室楼PC1到网安系寝室楼PC2的连通性显示如下
]
#figure(image("断开前ping.png",format: "png",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`命令关闭该接口:
]
#figure(image("上_shutdown.png",format: "png",fit:"stretch",width: 50%),caption: "关闭AR1的G0/0/0口")
#para[
再次使用`traceroute`命令检验连通性,显示如下:
]
#figure(image("断开后ping.png",format: "png",fit:"stretch",width: 55%),caption: "断开后traceroute命令查看路由")<afteroff>
#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。
]
#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协议配置完成网工系与网安系之间的通信实现了冗余备份学生们能够通过稳定的线上视频学术研讨会进行学术交流可以不受超算马力全开对路由器电力资源造成的影响。
]
= 实验总结
#para[
通过本次实验我了解了虚拟路由器冗余协议VRRP的基本概念和工作原理掌握了VRRP协议的配置方法。VRRP协议通过将多台路由器虚拟成一个虚拟路由器提供默认网关服务实现了网关的冗余备份提高了网络的可靠性和可用性。在实验中我按照实验步骤配置了VRRP协议通过检验确认了Master和Backup的状态验证了主备切换的过程实现了网络的冗余备份。通过本次实验我不仅掌握了VRRP协议的配置方法还加深了对冗余技术的应用价值的理解为今后在实际网络环境中应用和维护相关技术打下了基础。
]
#show heading: it => box(width: 100%)[
#v(0.50em)
#set text(font: hei)
// #counter(heading).display()
// #h(0.5em)
#it.body
]
#pagebreak()
#bibliography("ref.yml",full: true,title: "参考文献",style:"gb-7714-2015-numeric")

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

BIN
5_vrrp/上_ip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

BIN
5_vrrp/上_ospf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

BIN
5_vrrp/上_shutdown.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
5_vrrp/上_vrrp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
5_vrrp/下_ip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
5_vrrp/下_ospf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

BIN
5_vrrp/下_vrrp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
5_vrrp/实验拓扑.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

BIN
5_vrrp/断开前ping.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

BIN
5_vrrp/断开后ping.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB