赞
踩
VRRP 是一种网关用于网关冗余的协议,通过多个设备虚拟出一个虚拟的IP地址,作为终端设备的网关,当网关设备故障时,则会切换至其他设备担任虚拟网关的载体。从而提高网络的可靠性。
SW1:
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
interface GigabitEthernet0/0/4
port link-type access
port default vlan 20
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20
SW2:
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
interface Vlanif10
ip address 192.168.1.254 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.1.252 #为VLAN10 配置VID 为 10 的虚拟IP地址
vrrp vrid 10 priority 150 #设置优先级 为 150 使其SW2成为Master
interface Vlanif20
ip address 192.168.2.254 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.2.252 #为VLAN20 配置VID 为 20 的虚拟IP地址
vrrp vrid 20 priority 150 #设置优先级 为 150 使其SW2成为Master
SW3:
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
interface Vlanif10
ip address 192.168.1.253 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.1.252 #为VLAN10 配置VID 为 10 的虚拟IP地址
vrrp vrid 10 priority 120 #设置优先级 为 120 使其SW3成为Slave
interface Vlanif20
ip address 192.168.2.253 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.2.252 #为VLAN20 配置VID 为 20 的虚拟IP地址vrrp vrid 20 priority 120 #设置优先级 为 120 使其SW3成为Slave
PC>tracert 192.168.2.1
traceroute to 192.168.2.1, 8 hops max
(ICMP), press Ctrl+C to stop
1 192.168.1.254 47 ms 47 ms 31 ms
2 192.168.2.1 94 ms 78 ms 94 ms
PC>
默认走的是Master SW2的链路, 当我们将SW2关闭掉
PC>tracert 192.168.2.1
traceroute to 192.168.2.1, 8 hops max
(ICMP), press Ctrl+C to stop
1 192.168.1.253 125 ms 31 ms 47 ms
2 192.168.2.1 125 ms 94 ms 78 ms
PC>
链路切换至SW3了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。