1个VRRP备份组可以对应多个虚拟IP,虚拟IP可以是不同子网的
前提:
1、华为ensp模拟器
2、三层交换机
一、拓扑
二、配置
sw2:
vlan batch 10 20
interface Vlanif10
ip address 192.168.0.252 255.255.255.0
vrrp vrid
1 virtual-ip 192.168.0.254
#
interface Vlanif20
ip address 192.168.1.252 255.255.255.0
vrrp vrid
1 virtual-ip 192.168.1.254
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20
sw3:
vlan batch 10 20
interface Vlanif10
ip address 192.168.0.253 255.255.255.0
vrrp vrid
1 virtual-ip 192.168.0.254
#
interface Vlanif20
ip address 192.168.1.253 255.255.255.0
vrrp vrid
1 virtual-ip 192.168.1.254
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20
sw1:
vlan batch 10 20
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/4
port link-type access
port default vlan 20
PC1:
PC2:
三、验证
一、 PC1和PC2都可以ping通这2个虚拟ip: 192.168.0.254和192.168.1.254