基于ENSP的VRRP配置

实验拓扑:

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了

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值