# VRRP ![image-20240827112252447](https://picgo-noriu.oss-cn-beijing.aliyuncs.com/Images/image-20240827112252447.png) ### 一、配PC的IP、子网掩码、网关 ### 二、配路由交换机接口的IP、VLAN、VRRP - **SW1** ``` u t m sys [Huawei]sys SW1 [SW1]vlan 10 [SW1-vlan10]quit [SW1]port-group group-member g0/0/1 to g0/0/4 [SW1-port-group]port link-type access [SW1-port-group]port default vlan 10 [SW1-port-group]return save ``` - **AR1** ``` u t m sys [Huawei]sys AR1 [AR1]int g0/0/0 [AR1-GigabitEthernet0/0/0]ip a 192.168.1.251 24 [AR1-GigabitEthernet0/0/0]int g0/0/1 [AR1-GigabitEthernet0/0/1]ip a 192.168.13.1 24 [AR1-GigabitEthernet0/0/1]quit [AR1]int g0/0/0 [AR1-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254 [AR1-GigabitEthernet0/0/0]vrrp vrid 1 priority 130 [AR1-GigabitEthernet0/0/0]quit [AR1]ip route-static 192.168.2.0 24 192.168.13.3 [AR1]quit save ``` - **AR2** ``` u t m sys [Huawei]sys AR2 [AR2]int g0/0/0 [AR2-GigabitEthernet0/0/0]ip a 192.168.1.252 24 [AR2-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254 [AR2-GigabitEthernet0/0/0]int g0/0/1 [AR2-GigabitEthernet0/0/1]ip a 192.168.23.1 24 [AR2-GigabitEthernet0/0/1]quit [AR2]ip route-static 192.168.2.0 24 192.168.23.3 [AR2]quit save ``` - **AR3** ``` u t m sys [Huawei]sys AR3 [AR3]int g 0/0/0 [AR3-GigabitEthernet0/0/0]ip a 192.168.13.3 24 [AR3-GigabitEthernet0/0/0]int g0/0/1 [AR3-GigabitEthernet0/0/1]ip a 192.168.23.3 24 [AR3-GigabitEthernet0/0/1]int g0/0/2 [AR3-GigabitEthernet0/0/2]ip a 192.168.2.254 24 [AR3-GigabitEthernet0/0/2]quit [AR3]ip route-static 192.168.1.0 24 192.168.23.1 preference 70 [AR3]quit save ``` ### 三、拓展:上行接口监控(上行链路跟踪) - **AR1** ``` [R1]int g0/0/0 [AR1-GigabitEthernet0/0/0]vrrp vrid 10 track int g0/0/1 reduced 50 ``` > 配置 VRRP 跟踪功能,监视接口 g0/0/1 的状态。如果该接口故障,VRRP 的优先级将减少 50 ![批注 2024-08-27 113731](https://picgo-noriu.oss-cn-beijing.aliyuncs.com/Images/%E6%89%B9%E6%B3%A8%202024-08-27%20113731.png)