实现vrrp负载均衡 首先
1、给每台交换机改名 配置VLAN 2
<Huawei>system-view
[Huawei]undo info-center enable
[Huawei]sysname sw4
[sw4]vlan 2 #其余三台配置相同
配置trunk
[sw3-Ethernet0/0/1]in e0/0/2
[sw3-Ethernet0/0/2]port link-t
[sw3-Ethernet0/0/2]port link-type trunk
[sw3-Ethernet0/0/2]port trunk allo
[sw3-Ethernet0/0/2]port trunk allow-pass vlan al
配置所有接口为trunk
多接口可以用接口组将接口加入VLAN
[sw4]port-group 1
[sw4-port-group-1]group-member Ethernet 0/0/1 Ethernet 0/0/2
配置完成
如果配错 将接口回复默认
[sw4]clear configuration interface GigabitEthernet 0/0/1
Warning: All configurations of the interface will be cleared, and its state will
be shutdown. Continue? [Y/N] :y
Info: Total execute 2 command(s), 2 successful, 0 failed.
display this #查看当前配置
**********************注意:看清交换机接口三层交换G口,交换机E口
[sw1-Vlanif1]in vlan 2
[sw1-Vlanif2]ip address 192.168.2.252 24 #进入VLAN配IP
配完ping测试
配置VRRP第一个交换机
sw1 vlan1 主 VLAN2 备
sw2 VLAN2 主 VLAN1 备
[sw1]in vlan 1
[sw1-Vlanif1]vrrp vrid 1 virtual-ip 192.168.1.254
[sw1-Vlanif1]vrrp vrid 1 priority 105
[sw1-Vlanif1]in vlan 2
[sw1-Vlanif2]vrrp vrid 2 virtual-ip 192.168.2.254
display vrrp brief 查看
第二个交换机
[sw2]in vlan 1
[sw2-Vlanif1]vrrp vrid 1 virtual-ip 192.168.1.254
[sw2-Vlanif1]in vlan 2
[sw2-Vlanif2]vrrp vrid 2 virtual-ip 192.168.2.254
[sw2-Vlanif2]vrrp vrid 1 priority 105
display vrrp brief 查看