l 202.38.160.0/24网段内部分主机的缺省网关为202.38.160.111/24,部分主机的缺省网 关为202.38.160.112/24;
l 利用VRRP备份组实现缺省网关间的负载分担和相互备份。
图1 VRRP多备份组配置组网图
<RouterA>
system-view
[RouterA]
interface GigabitEthernet4/1/1
[RouterA-GigabitEthernet4/1/1]
ip address 202.38.160.1 255.255.255.0
#
创建备份组1,并配置备份组1的虚拟IP地址为202.38.160.111。
[RouterA-GigabitEthernet4/1/1]
vrrp vrid 1 virtual-ip 202.38.160.111
#
设置Router A在备份组1中的优先级为110。
[RouterA-GigabitEthernet4/1/1]
vrrp vrid 1 priority 110
#
创建备份组2,并配置备份组2的虚拟IP地址为202.38.160.112。
[RouterA-GigabitEthernet4/1/1]
vrrp vrid 2 virtual-ip 202.38.160.112
<RouterB>
system-view
[RouterB]
interface GigabitEthernet 4/1/1
[RouterB-GigabitEthernet4/1/1]
ip address 202.38.160.2 255.255.255.0
#
创建备份组1,并配置备份组1的虚拟IP地址为202.38.160.111。
[RouterB-GigabitEthernet4/1/1]
vrrp vrid 1 virtual-ip 202.38.160.111
#
创建备份组2,并配置备份组2的虚拟IP地址为202.38.160.112。
[RouterB-GigabitEthernet4/1/1]
vrrp vrid 2 virtual-ip 202.38.160.112
#
设置Router B在备份组2中的优先级为110。
[RouterB-GigabitEthernet4/1/1]
vrrp vrid 2 priority 110
可以通过display vrrp verbose命令查看配置后的结果。
# 显示Router A上备份组的详细信息。
[RouterA-GigabitEthernet4/1/1]
display vrrp verbose
IPv4
Standby Information:
Run Method :
REAL-MAC
Virtual IP Ping :
Enable
Interface :
GigabitEthernet4/1/1
VRID
: 1
Adver. Timer :
1
Admin Status : UP
State
: Master
Config Pri : 110
Run Pri
: 110
Preempt Mode : YES
Delay Time
: 0
Auth
Type
: NONE
Virtual IP :
202.38.160.111
Virtual MAC :
00e0-fc62-709f
Master IP :
202.38.160.1
Interface :
GigabitEthernet4/1/1
VRID
: 2
Adver. Timer :
1
Admin Status : UP
State
:
Backup
Config Pri : 100
Run Pri
: 100
Preempt Mode : YES
Delay Time
: 0
Auth Type :
NONE
Virtual IP :
202.38.160.112
Master IP :
202.38.160.2
# 显示Router B上备份组的详细信息。
[RouterB-GigabitEthernet4/1/1]
display vrrp verbose
IPv4
Standby Information:
Run Method :
REAL-MAC
Virtual IP Ping :
Enable
Interface :
GigabitEthernet4/1/1
VRID
: 1
Adver. Timer :
1
Admin Status : UP
State
: Backup
Config Pri : 100
Run Pri
: 100
Preempt Mode : YES
Delay Time
: 0
Auth Type :
NONE
Virtual IP :
202.38.160.111
Master IP :
202.38.160.1
Interface :
GigabitEthernet4/1/1
VRID
: 2
Adver. Timer :
1
Admin Status : UP
State
: Master
Config Pri : 110
Run Pri
: 110
Preempt Mode : YES
Delay Time
: 0
Auth Type :
NONE
Virtual IP :
202.38.160.112
Virtual MAC :
00e0-fc61-508f
Master IP : 202.38.160.2
以上显示信息表示在备份组1中Router A为Master路由器,Router B为Backup路由器,缺省网关为202.38.160.111/24的主机通过Router A访问Internet;备份组2中Router A为Backup路由器,Router B为Master路由器,缺省网关为202.38.160.112/24的主机通过Router B访问Internet。
RouterA
#
interface
GigabitEthernet4/1/1
port link-mode
route
ip address 202.38.160.1
255.255.255.0
vrrp vrid 1 virtual-ip
202.38.160.111
vrrp vrid 1 priority 110
vrrp vrid 2 virtual-ip
202.38.160.112
#
RouterB
#
interface
GigabitEthernet4/1/1
port link-mode
route
ip address 202.38.160.2
255.255.255.0
vrrp vrid 1 virtual-ip
202.38.160.111
vrrp
vrid 2 virtual-ip 202.38.160.112
vrrp vrid 2 priority
110
#