VRRP协议原理与配置

为什么要有VRRP?

VRRP的概念

VRRP实现方式

为什么要有VRRP?

VRRP的概念

VRRP实现方式

VRRP报文

VRRP配置

前言

局域网终端如何访问外网? 通常要通过默认网关来访问外网,但是这里就有个问题,如果默认网关设备出问题的话,那么用户就上不了外网了,这就不说要造成什么损失了吧,这里就想到了多配几个网关来解决这个单点问题,但是的话多个网关的话又会造成冲突,于是VRRP应运而生,VRRP可以实现网关备份,又能解决网关冲突。

为什么要有VRRP?

为了防止单点故障,而且它有冗余,就是说当网关出现问题的时候,能够让终端(手机,电脑等)换到另一个网关,就能够继续上网了

VRRP的概念

通过VRRP将俩台路由器虚拟构成一台路由器,俩台路由器的浮动地址,即是路由器的虚拟地址,浮动地址也是下行地址的网关IP
通俗的讲:VRRP实现了一个组中的路由器,哪个路由器工作,哪个路由器作为备份。
实际上:如果一个组中有俩个路由,其可以理解为三个路由,第三个路由为虚拟路由,它的虚拟IP做为局域网内所有主机的网关,而master路由负责转发数据到这个虚拟路由,备份路由主要监听master路由,当这个路由出现问题,开始替换.

VRRP(虚拟路由冗余协议)
利用VRRP,一 组 路由器(同一个LAN中的接口)协同工作,但只有一个处于MASTER状态,处于该状态的路由器,承载实际承担的数据流量转发任务,在一个VRRP组中,多个路由器共用一个虚拟IP地址,该地址被作为局域网内的所有主机的缺省网关地址

VRRP决定了这个VRRP组中哪个为master路由,
master路由负责接收发送至网关(这个网关就是虚拟路由的虚拟IP)的数据包进行转发,以及响应PC对于其网关的ARP请求.

Backup路由侦听MASTER路由器的状态,并准备随时接替master路由器的工作.
VRRP路由器
运行VRRP路由器,一台VRPP路由器可以参与多个VRPP组中,在不同的组中,一台VRRP路由器可以充当不同的路由器.
VRPP组
一个VRRP组中由多个VRRP路由器构成,使用group ip进行标识组,使用同一VRRP组的VRRP路由器互相交换信息,每个VRRP组只能有一个MASTER.

虚拟路由器
对于每一个VRRP组,抽象出来的一一个逻辑路由器,该路由器充当网络用户的网关,该路由器并非真实存在,事实上对于用户而言,只需知道虚拟路由器的IP ,至于具体的虚拟路由器的角色由谁来承担、数据转发任务由谁来承担、Master挂掉之后谁来接替,这是VRRP的工作

VRRP实现方式

1.要通过vrrp 虚拟一台路由器
2.用户把虚拟路由器的IP地址作为网关
3.两台路由器进行PK,谁胜出,谁胜出(master),谁就来充当虚拟路由器。 #备份路由器:backup

VRRP报文

  • Version:2
  • Type:1   ADVERTISEMENT
  • Virtual Rtr ID(VRID):配置的VRRP备份组号,1-255
  • Priority:优先级,0-255(越大越优先)
  • Count IP Addrs:配置的备份组虚拟地址个数

VRRP配置

拓扑图模拟:

PC的IP,子网掩码,和网关就不说了要配的,

先配置二层交换机LSW1

[Huawei]sys	
[Huawei]sysname SW1

[SW1]vlan b	
[SW1]vlan batch 10 20


[SW1]interface g0/0/1
[SW1-GigabitEthernet0/0/1]p l t
[SW1-GigabitEthernet0/0/1]p t a

[SW1-GigabitEthernet0/0/1]p t a v 10 20
[SW1-GigabitEthernet0/0/1]un sh

[SW1-GigabitEthernet0/0/1]

[SW1-GigabitEthernet0/0/1]int e0/0/1
[SW1-Ethernet0/0/1]p l a
[SW1-Ethernet0/0/1]p l

[SW1-Ethernet0/0/1]p d v 10
[SW1-Ethernet0/0/1]un sh
Info: Interface Ethernet0/0/1 is not shutdown.
[SW1-Ethernet0/0/1]int

[SW1-Ethernet0/0/1]int g0/0/2
[SW1-GigabitEthernet0/0/2]p l t
[SW1-GigabitEthernet0/0/2]p t 

[SW1-GigabitEthernet0/0/2]p t a v 10 20
[SW1-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[SW1-GigabitEthernet0/0/2]

[SW1-GigabitEthernet0/0/2]int e0/0/2
[SW1-Ethernet0/0/2]p l a
[SW1-Ethernet0/0/2]

[SW1-Ethernet0/0/2]p d v 20
[SW1-Ethernet0/0/2]u

[SW1-Ethernet0/0/2]un sh

[SW1-Ethernet0/0/2] User interface con0 is available

Please Press ENTER.

接着配置三层交换机LSW2

[SW2-Vlanif10]int Vlanif 20
[SW2-Vlanif20]
[SW2-Vlanif20]ip add 192.168.20.10 24
[SW2-Vlanif20]
[SW2-Vlanif20]v	
[SW2-Vlanif20]vrrp v	
[SW2-Vlanif20]vrrp vrid v	
[SW2-Vlanif20]vrrp vrid 2 V	
[SW2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1


[SW2-Vlanif20]v	
[SW2-Vlanif20]vrrp v	
[SW2-Vlanif20]vrrp vrid 2 p	
[SW2-Vlanif20]vrrp vrid 2 pri	
[SW2-Vlanif20]vrrp vrid 2 priority 115
[SW2-Vlanif20]
May 26 2021 16:41:01-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 19, the 
change loop count is 0, and the maximum number of records is 4095.	
[SW2-Vlanif20]int vl	
[SW2-Vlanif20]int vlanif 100
[SW2-Vlanif100]
May 26 2021 16:41:34-08:00 SW2 %%01IFNET/4/IF_STATE(l)[6]:Interface Vlanif100 ha
s turned into UP state.	
[SW2-Vlanif100]ip add11.0.0.2 30
                  ^
Error: Unrecognized command found at '^' position.
[SW2-Vlanif100]ip add 11.0.0.2 30
[SW2-Vlanif100]
May 26 2021 16:42:35-08:00 SW2 %%01IFNET/4/LINK_STATE(l)[7]:The line protocol IP
 on the interface Vlanif100 has entered the UP state.
May 26 2021 16:42:41-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 20, the 
change loop count is 0, and the maximum number of records is 4095.
[SW2-Vlanif100]ip r	
[SW2-Vlanif100]ip rou	
[SW2-Vlanif100]ip rout	
[SW2-Vlanif100]ip route	
[SW2-Vlanif100]ip route-	
[SW2-Vlanif100]ip route-s	
[SW2-Vlanif100]q
[SW2]ip r	
[SW2]ip rou	
[SW2]ip route-s	
[SW2]ip route-static 0.0.0.0 0.0.0.0 11.0.0.1
[SW2]
May 26 2021 16:45:31-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 21, the 
change loop count is 0, and the maximum number of records is 4095.	
[SW2]un sh
     ^
Error:Ambiguous command found at '^' position.
[SW2]dis th
#
sysname SW2
#
vlan batch 10 20 100
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
ip route-static 0.0.0.0 0.0.0.0 11.0.0.1
#
return
[SW2]undo ip rou	
[SW2]undo ip route-st	
[SW2]undo ip route-static 
                          ^
Error:Incomplete command found at '^' position.
[SW2]undo ip route-static 0.0.0.0 0.0.0.0 11.0.0.1
[SW2]
May 26 2021 16:46:38-08:00 SW2 %%01RM/4/IPV4_DEFT_RT_CHG(l)[8]:IPV4 default Rout
e is changed. (ChangeType=Delete,InstanceId=0,Protocol=Static,ExitIf=Vlanif100,N
exthop=11.0.0.1,Neighbour=0.0.0.0,Preference=60,Label=NULL,Metric=0)
May 26 2021 16:46:41-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 22, the 
change loop count is 0, and the maximum number of records is 4095.y
     ^
Error: Unrecognized command found at '^' position.
[SW2]	
[SW2]y
     ^
Error: Unrecognized command found at '^' position.
[SW2]dis th
#
sysname SW2
#
vlan batch 10 20 100
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
return
[SW2]int vlanif100
[SW2-Vlanif100]ip add 11.0.0.2 30
Error: The address already exists.
[SW2-Vlanif100]ip rout	
[SW2-Vlanif100]ip route	
[SW2-Vlanif100]ip route	
[SW2-Vlanif100]ip route	
[SW2-Vlanif100]ip route	
[SW2-Vlanif100]ip route	
[SW2-Vlanif100]ip route	
[SW2-Vlanif100]ip route-sta	
[SW2-Vlanif100]q
[SW2]ip route-static 0.0.0.0 0.0.0.0 11.0.0.1
[SW2]
May 26 2021 16:49:11-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 23, the 
change loop count is 0, and the maximum number of records is 4095.
May 26 2021 16:51:40-08:00 SW2 %%01PHY/1/PHY(l)[9]:    GigabitEthernet0/0/2: cha
nge status to down
May 26 2021 16:51:40-08:00 SW2 %%01IFNET/4/IF_STATE(l)[10]:Interface Vlanif1 has
 turned into DOWN state.
May 26 2021 16:51:40-08:00 SW2 %%01IFNET/4/IF_STATE(l)[11]:Interface Vlanif10 ha
s turned into DOWN state.
May 26 2021 16:51:40-08:00 SW2 %%01IFNET/4/LINK_STATE(l)[12]:The line protocol I
P on the interface Vlanif10 has entered the DOWN state.
May 26 2021 16:51:40-08:00 SW2 %%01VRRP/4/STATEWARNINGEXTEND(l)[13]:Virtual Rout
er state MASTER changed to INITIALIZE, because of interface down. (Interface=Vla
nif10, VrId=1, InetType=IPv4)
May 26 2021 16:51:40-08:00 SW2 %%01IFNET/4/IF_STATE(l)[14]:Interface Vlanif20 ha
s turned into DOWN state.
May 26 2021 16:51:40-08:00 SW2 %%01IFNET/4/LINK_STATE(l)[15]:The line protocol I
P on the interface Vlanif20 has entered the DOWN state.
May 26 2021 16:51:40-08:00 SW2 %%01VRRP/4/STATEWARNINGEXTEND(l)[16]:Virtual Rout
er state MASTER changed to INITIALIZE, because of interface down. (Interface=Vla
nif20, VrId=2, InetType=IPv4)
May 26 2021 16:51:41-08:00 SW2 %%01PHY/1/PHY(l)[17]:    GigabitEthernet0/0/2: ch
ange status to up
May 26 2021 16:51:41-08:00 SW2 %%01IFNET/4/IF_STATE(l)[18]:Interface Vlanif1 has
 turned into UP state.
May 26 2021 16:51:41-08:00 SW2 %%01IFNET/4/IF_STATE(l)[19]:Interface Vlanif10 ha
s turned into UP state.
May 26 2021 16:51:41-08:00 SW2 %%01IFNET/4/LINK_STATE(l)[20]:The line protocol I
P on the interface Vlanif10 has entered the UP state.
May 26 2021 16:51:41-08:00 SW2 %%01IFNET/4/IF_STATE(l)[21]:Interface Vlanif20 ha
s turned into UP state.
May 26 2021 16:51:41-08:00 SW2 %%01IFNET/4/LINK_STATE(l)[22]:The line protocol I
P on the interface Vlanif20 has entered the UP state.
May 26 2021 16:51:49-08:00 SW2 %%01VRRP/4/STATEWARNINGEXTEND(l)[23]:Virtual Rout
er state BACKUP changed to MASTER, because of protocol timer expired. (Interface
=Vlanif10, VrId=1, InetType=IPv4)
May 26 2021 16:51:49-08:00 SW2 %%01VRRP/4/STATEWARNINGEXTEND(l)[24]:Virtual Rout
er state BACKUP changed to MASTER, because of protocol timer expired. (Interface
=Vlanif20, VrId=2, InetType=IPv4)
May 26 2021 16:57:35-08:00 SW2 %%01VRRP/4/STATEWARNINGEXTEND(l)[25]:Virtual Rout
er state MASTER changed to BACKUP, because of priority calculation. (Interface=V
lanif20, VrId=2, InetType=IPv4) User interface con0 is available



Please Press ENTER.

<SW2>	
<SW2>sys	
<SW2>system-view 
Enter system view, return user view with Ctrl+Z.
[SW2]int g0/0/1
[SW2-GigabitEthernet0/0/1]shut d	
[SW2-GigabitEthernet0/0/1]shut d
                               ^
Error:Too many parameters found at '^' position.
[SW2-GigabitEthernet0/0/1]shutd	
[SW2-GigabitEthernet0/0/1]shutdown 
[SW2-GigabitEthernet0/0/1]
May 26 2021 17:36:55-08:00 SW2 %%01PHY/1/PHY(l)[0]:    GigabitEthernet0/0/1: cha
nge status to down
May 26 2021 17:36:55-08:00 SW2 %%01IFNET/4/IF_STATE(l)[1]:Interface Vlanif100 ha
s turned into DOWN state.
May 26 2021 17:36:55-08:00 SW2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
 on the interface Vlanif100 has entered the DOWN state.
May 26 2021 17:36:55-08:00 SW2 %%01VRRP/4/STATEWARNINGEXTEND(l)[3]:Virtual Route
r state MASTER changed to BACKUP, because of priority calculation. (Interface=Vl
anif10, VrId=1, InetType=IPv4)
May 26 2021 17:36:55-08:00 SW2 %%01RM/4/IPV4_DEFT_RT_CHG(l)[4]:IPV4 default Rout
e is changed. (ChangeType=Delete,InstanceId=0,Protocol=Static,ExitIf=Unknown,Nex
thop=11.0.0.1,Neighbour=0.0.0.0,Preference=60,Label=NULL,Metric=0)
May 26 2021 17:36:56-08:00 SW2 %%01PHY/1/PHY(l)[5]:    GigabitEthernet0/0/1: cha
nge status to down
May 26 2021 17:37:03-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 24, the 
change loop count is 0, and the maximum number of records is 4095.	
[SW2-GigabitEthernet0/0/1]un sh
[SW2-GigabitEthernet0/0/1]
May 26 2021 17:37:47-08:00 SW2 %%01PHY/1/PHY(l)[6]:    GigabitEthernet0/0/1: cha
nge status to up
May 26 2021 17:37:47-08:00 SW2 %%01IFNET/4/IF_STATE(l)[7]:Interface Vlanif100 ha
s turned into UP state.
May 26 2021 17:37:47-08:00 SW2 %%01IFNET/4/LINK_STATE(l)[8]:The line protocol IP
 on the interface Vlanif100 has entered the UP state.
May 26 2021 17:37:52-08:00 SW2 %%01VRRP/4/STATEWARNINGEXTEND(l)[9]:Virtual Route
r state BACKUP changed to MASTER, because of priority calculation. (Interface=Vl
anif10, VrId=1, InetType=IPv4)
May 26 2021 17:37:53-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 25, the 
change loop count is 0, and the maximum number of records is 4095.

接着配置SW3

<Huawei>sys	
<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sys	
[Huawei]sysname SW3
[SW3]
May 26 2021 16:49:41-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 4, the c
hange loop count is 0, and the maximum number of records is 4095.	
[SW3]int go/0/1
         ^
Error: Wrong parameter found at '^' position.
[SW3]p l a
     ^
Error:Ambiguous command found at '^' position.
[SW3]vlan b	
[SW3]vlan batch 10 20 100
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3]p l a
May 26 2021 16:51:21-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 5, the c
hange loop count is 0, and the maximum number of records is 4095.
     ^
Error:Ambiguous command found at '^' position.
[SW3]	
[SW3]p l a
     ^
Error:Ambiguous command found at '^' position.
[SW3]int g0/0/1
[SW3-GigabitEthernet0/0/1]p l a
[SW3-GigabitEthernet0/0/1]p d v 
May 26 2021 16:51:41-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 6, the c
hange loop count is 0, and the maximum number of records is 4095.	
[SW3-GigabitEthernet0/0/1]p d v 100
[SW3-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[SW3-GigabitEthernet0/0/1]
May 26 2021 16:51:51-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.int f	
[SW3-GigabitEthernet0/0/1]int g0/0/2
[SW3-GigabitEthernet0/0/2]p l t
[SW3-GigabitEthernet0/0/2]p t av 
May 26 2021 16:52:21-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 8, the c
hange loop count is 0, and the maximum number of records is 4095	
[SW3-GigabitEthernet0/0/2]p t a v 10 20
[SW3-GigabitEthernet0/0/2]
May 26 2021 16:52:31-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095.unsh	
[SW3-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[SW3-GigabitEthernet0/0/2]int vlanif 10
[SW3-Vlanif10]
May 26 2021 16:52:54-08:00 SW3 %%01IFNET/4/IF_STATE(l)[0]:Interface Vlanif10 has
 turned into UP state.	
[SW3-Vlanif10]ip add 192.168.10.20 24
[SW3-Vlanif10]
May 26 2021 16:53:23-08:00 SW3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface Vlanif10 has entered the UP state.	
[SW3-Vlanif10]v	
[SW3-Vlanif10]vrrp 	
[SW3-Vlanif10]vrrpv	
[SW3-Vlanif10]vrrp v
May 26 2021 16:53:32-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 10, the 
change loop count is 0, and the maximum number of records is 4095.	
[SW3-Vlanif10]vrrp vrid 1 v	
[SW3-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1
[SW3-Vlanif10]
May 26 2021 16:53:52-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 11, the 
change loop count is 0, and the maximum number of records is 4095.
[SW3-Vlanif10]v	
[SW3-Vlanif10]vrrp v	
[SW3-Vlanif10]vrrp vrid 1 p	
[SW3-Vlanif10]vrrp vrid 1 pr	
[SW3-Vlanif10]vrrp vrid 1 priority 115
[SW3-Vlanif10]
May 26 2021 16:55:32-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 12, the 
change loop count is 0, and the maximum number of records is 4095.int	
[SW3-Vlanif10]in t	
[SW3-Vlanif10]int	
[SW3-Vlanif10]int vlan20
[SW3-Vlanif20]
May 26 2021 16:55:51-08:00 SW3 %%01IFNET/4/IF_STATE(l)[2]:Interface Vlanif20 has
 turned into UP state.	
[SW3-Vlanif20]ip add 192.168.20.20 24
[SW3-Vlanif20]
May 26 2021 16:56:18-08:00 SW3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
 on the interface Vlanif20 has entered the UP state.v	
[SW3-Vlanif20]vrrp v	
[SW3-Vlanif20]vrrp vrid 
May 26 2021 16:56:22-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 13, the 
change loop count is 0, and the maximum number of records is 4095.	
[SW3-Vlanif20]vrrp vrid 2 pr	
[SW3-Vlanif20]vrrp vrid 2 v	
[SW3-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
[SW3-Vlanif20]v 	
[SW3-Vlanif20]vrrp v	
[SW3-Vlanif20]vrrp vrid 2
May 26 2021 16:57:22-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 14, the 
change loop count is 0, and the maximum number of records is 4095.	
[SW3-Vlanif20]vrrp vrid 2 pr	
[SW3-Vlanif20]vrrp vrid 2 priority 120
[SW3-Vlanif20]
May 26 2021 16:57:35-08:00 SW3 %%01VRRP/4/STATEWARNINGEXTEND(l)[4]:Virtual Route
r state BACKUP changed to MASTER, because of priority calculation. (Interface=Vl
anif20, VrId=2, InetType=IPv4)	
[SW3-Vlanif20]v	
[SW3-Vlanif20]vrrp 2
May 26 2021 16:57:42-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 15, the 
change loop count is 0, and the maximum number of records is 4095. 	
[SW3-Vlanif20]vrrp 2 t	
[SW3-Vlanif20]vrrp 2 tr	
[SW3-Vlanif20]vrrp 2 tra	
[SW3-Vlanif20]vrrp v	
[SW3-Vlanif20]vrrp vrid 2 t	
[SW3-Vlanif20]vrrp vrid 2 tr	
[SW3-Vlanif20]vrrp vrid 2 track  in	
[SW3-Vlanif20]vrrp vrid 2 track  interface  g0/0/1
[SW3-Vlanif20]
May 26 2021 16:58:22-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 16, the 
change loop count is 0, and the maximum number of records is 4095.	
[SW3-Vlanif20]vrrp vrid 2 track interface g0/0/2
[SW3-Vlanif20]int v
May 26 2021 16:58:32-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 17, the 
change loop count is 0, and the maximum number of records is 4095.la	
[SW3-Vlanif20]int vlan100
[SW3-Vlanif100]
May 26 2021 16:58:38-08:00 SW3 %%01IFNET/4/IF_STATE(l)[5]:Interface Vlanif100 ha
s turned into UP state.	
[SW3-Vlanif100]ip add 12.0.0.2 	
[SW3-Vlanif100]ip add 12.0.0.2 30
[SW3-Vlanif100]
May 26 2021 16:58:53-08:00 SW3 %%01IFNET/4/LINK_STATE(l)[6]:The line protocol IP
 on the interface Vlanif100 has entered the UP state.	
[SW3-Vlanif100]q
[SW3]ip 
May 26 2021 16:59:02-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 18, the 
change loop count is 0, and the maximum number of records is 4095.rou	
[SW3]ip route	
[SW3]ip route-static 0.0.0.0 0.0.0.0 12.0.0.1
[SW3]
May 26 2021 17:00:12-08:00 SW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 19, the 
change loop count is 0, and the maximum number of records is 4095. User interface con0 is available



Please Press ENTER.

<SW3>
May 26 2021 17:36:55-08:00 SW3 %%01VRRP/4/STATEWARNINGEXTEND(l)[0]:Virtual Route
r state BACKUP changed to MASTER, because of priority calculation. (Interface=Vl
anif10, VrId=1, InetType=IPv4)
May 26 2021 17:37:52-08:00 SW3 %%01VRRP/4/STATEWARNINGEXTEND(l)[1]:Virtual Route
r state MASTER changed to BACKUP, because of priority calculation. (Interface=Vl
anif10, VrId=1, InetType=IPv4)

最后配置路由器

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sy	
[Huawei]sysname R1
[R1]
May 26 2021 17:00:45-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 1, the ch
ange loop count is 0, and the maximum number of records is 4095.	
[R1]	
[R1]	
[R1]	
[R1]	
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 11.0.0.1 30
[R1-GigabitEthernet0/0/0]
May 26 2021 17:01:54-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state.
May 26 2021 17:01:55-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 2, the ch
ange loop count is 0, and the maximum number of records is 4095.	
[R1-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R1-GigabitEthernet0/0/0]q
[R1]ip rou	
[R1]ip route-s	
[R1]int l	
[R1]int Loo	
[R1]int LoopBack0
[R1-LoopBack0]
May 26 2021 17:03:36-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 3, the ch
ange loop count is 0, and the maximum number of records is 4095.ip	
[R1-LoopBack0]ip rou	
[R1-LoopBack0]ip rou	
[R1-LoopBack0]ip add 1.1.1.1 24
[R1-LoopBack0]q
[R1]i
May 26 2021 17:04:06-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 4, the ch
ange loop count is 0, and the maximum number of records is 4095.p	
[R1]ip rou	
[R1]ip route-s	
[R1]ip route-static 192.168.10.0 24 11.0.0.2
[R1]
May 26 2021 17:05:16-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 5, the ch
ange loop count is 0, and the maximum number of records is 4095.	
[R1]dis th
#
sysname R1
#
ip route-static 192.168.10.0 255.255.255.0 11.0.0.2
#
return
[R1]ip rou	
[R1]ip route-	
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 12.0.0.1 30
[R1-GigabitEthernet0/0/1]
May 26 2021 17:09:22-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R1-GigabitEthernet0/0/1]un sh
May 26 2021 17:09:26-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 6, the ch
ange loop count is 0, and the maximum number of records is 4095.
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R1-GigabitEthernet0/0/1]q
[R1]ip route-static 192.168.10.0 24 12.0.0.2 p	
[R1]ip route-static 192.168.10.0 24 12.0.0.2 preference 70
[R1]ip route-static 192.168.10.0 24 12.0.0.2 preference 70
May 26 2021 17:10:06-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 7, the ch
ange loop count is 0, and the maximum number of records is 4095.`	
[R1]dis th
#
sysname R1
#
ip route-static 192.168.10.0 255.255.255.0 11.0.0.2
ip route-static 192.168.10.0 255.255.255.0 12.0.0.2 preference 70
#
return
[R1]undo ip rpu	
[R1]undo ip rou	
[R1]undo ip route-	
[R1]ip route-static 192.168.20.0 24 12.0.0.2
[R1]ip route-static 192.168.20.0 24 12.0.0.2
May 26 2021 17:12:06-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 8, the ch
ange loop count is 0, and the maximum nu	
[R1]ip route-static 192.168.20.0 24 11.0.0.2 p	
[R1]ip route-static 192.168.20.0 24 11.0.0.2 preference 70
[R1]un
May 26 2021 17:12:36-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 9, the ch
ange loop count is 0, and the maximum number of records is 4095. sh	
[R1]un sh
       ^
Error: Unrecognized command found at '^' position.
[R1]
<R1>
May 26 2021 17:36:57-08:00 R1 %%01PHY/1/PHY(l)[0]:    GigabitEthernet0/0/0: chan
ge status to down
May 26 2021 17:36:57-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the DOWN state.
May 26 2021 17:37:46-08:00 R1 %%01PHY/1/PHY(l)[2]:    GigabitEthernet0/0/0: chan
ge status to up
May 26 2021 17:37:46-08:00 R1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state.

最后的话ping一下路由上的地址,然后down掉LSW2上行链路的接口测试备用路由的功能

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不得不说的运维故事

你的赞是我的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值