专业认证

关注公众号 jb51net

关闭
IT专业知识 > 专业认证 >

华为HCIP认证无线技术——VRRP配置实验案例分析

坏坏-5

本文讲述了华为HCIP认证无线技术——VRRP配置实验案例。分享给大家供大家参考,具体如下:

文章目录


实验拓扑

在这里插入图片描述

基础配置

# 创建vlan,配置链路聚合
[SW1]vlan batch 10 20 
[SW1]int Eth-Trunk 1
[SW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/10 0/0/11
[SW1-Eth-Trunk1]port link-type trunk 
[SW1-Eth-Trunk1]port trunk allow-pass vlan all 
[SW1-Eth-Trunk1]q
# 配置接口类型
[SW1]int g0/0/1 
[SW1-GigabitEthernet0/0/1]port link-type trunk 
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all 
[SW1-GigabitEthernet0/0/1]int g0/0/2
[SW1-GigabitEthernet0/0/2] port link-type trunk
[SW1-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094
[SW1-GigabitEthernet0/0/2]q
# SW2创建vlan,配置链路聚合
[SW2]vlan batch 10 20 
[SW2]int Eth-Trunk 1
[SW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/10 0/0/11
[SW2-Eth-Trunk1]port link-type trunk 
[SW2-Eth-Trunk1]port trunk allow-pass vlan all 
[SW2-Eth-Trunk1]q
# SW2配置接口类型
[SW2]int g0/0/1 
[SW2-GigabitEthernet0/0/1]port link-type trunk 
[SW2-GigabitEthernet0/0/1]port trunk allow-pass vlan all 
[SW2-GigabitEthernet0/0/1]int g0/0/2
[SW2-GigabitEthernet0/0/2] port link-type trunk
[SW2-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094
[SW2-GigabitEthernet0/0/2]q
# SW3配置
[SW3]vlan ba 10 20
[SW3]int g0/0/2
[SW3-GigabitEthernet0/0/2]port link-type trunk
[SW3-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094
[SW3-GigabitEthernet0/0/2]int g0/0/
[SW3-GigabitEthernet0/0/3]port link-type trunk
[SW3-GigabitEthernet0/0/3] port trunk allow-pass vlan 2 to 4094
[SW3-GigabitEthernet0/0/3]q
[SW3]int g0/0/1
[SW3-GigabitEthernet0/0/1]port link-type access 
[SW3-GigabitEthernet0/0/1]port default vlan 10

# SW4配置
[SW4]vlan ba 10 20
[SW4]int g0/0/2
[SW4-GigabitEthernet0/0/2]port link-type trunk
[SW4-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094
[SW4-GigabitEthernet0/0/2]int g0/0/3
[SW4-GigabitEthernet0/0/3]port link-type trunk
[SW4-GigabitEthernet0/0/3] port trunk allow-pass vlan 2 to 409
[SW4]int g0/0/1
[SW4-GigabitEthernet0/0/1]port link-type access 
[SW4-GigabitEthernet0/0/1]port default vlan 20
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]ip ad 10.1.1.1 24
[AR1-GigabitEthernet0/0/0]q
[AR1]ip route-static 0.0.0.0 0 10.1.1.254  //配置静态路由,否则无法互通

配置VRRP

# 配置vlanif的IP地址,配置VRRP
[SW1]int Vlanif 10
[SW1-Vlanif10]ip ad 10.1.1.2 24
[SW1-Vlanif10]vrrp vrid 1 virtual-ip 10.1.1.254  //配置VRID 1的虚拟网关为10.1.1.254
[SW1-Vlanif10]vrrp vrid 1 priority 120  //配置VRID 1的优先级
[SW1-Vlanif10]q
[SW1]int Vlanif 20
[SW1-Vlanif20]ip ad 20.1.1.2 24
[SW1-Vlanif20]vrrp vrid 2 virtual-ip 20.1.1.254  //配置VRID 2的虚拟网关为20.1.1.254
[SW2]int Vlanif 10
[SW2-Vlanif10]ip ad 10.1.1.3 24
[SW2-Vlanif10]vrrp vrid 1 virtual-ip 10.1.1.254
[SW2-Vlanif10]q
[SW2]int Vlanif 20
[SW2-Vlanif20]ip ad 20.1.1.3 24
[SW2-Vlanif20]vrrp vrid 2 virtual-ip 20.1.1.254
[SW2-Vlanif20]vrrp vrid  2 priority 120  //配置VRID 2的优先级为120

实验结果

在这里插入图片描述
拓展

  • vrrp vrid 1 preempt-mode timer delay 20修改抢占时延
  • vrrp vrid 1 track interface GigabitEthernet0/0/1 reduced 20配置上行接口down后,自身优先级降20