[huawei] vlan 2 [Huawei-Vlanif2] ip address 192.168.20.1 30 [Huawei-Vlanif1] ip address 192.168.10.1 255.255.255.0 [Huawei-Vlanif1] vrrp vrid 1 virtual-ip 192.168.10.254 [Huawei-Vlanif1] vrrp vrid 1 priority 200 [Huawei-Vlanif1] vrrp vrid 1 preempt-mode timer delay 20 [Huawei-Vlanif1] vrrp vrid 1 track interface GigabitEthernet0/0/2 reduced 100 [Huawei-Vlanif1] interface GigabitEthernet0/0/1 [Huawei-GigabitEthernet0/0/1] port link-type trunk [Huawei-GigabitEthernet0/0/1] port trunk allow-pass vlan all [Huawei-GigabitEthernet0/0/1] interface GigabitEthernet0/0/2 [Huawei-GigabitEthernet0/0/2] port link-type access [Huawei-GigabitEthernet0/0/2] port default vlan 2 [Huawei-GigabitEthernet0/0/2] ip route-static 0.0.0.0 0.0.0.0 192.168.20.2
sw2的配置
1 2 3 4 5 6 7 8 9 10 11 12
[huawei] vlan 2 [Huawei-Vlanif2] ip address 192.168.30.1 30 [Huawei-Vlanif1] ip address 192.168.10.253 255.255.255.0 [Huawei-Vlanif1] vrrp vrid 1 virtual-ip 192.168.10.254 [Huawei-Vlanif1] vrrp vrid 1 priority 150 [Huawei-Vlanif1] interface GigabitEthernet0/0/1 [Huawei-GigabitEthernet0/0/1] port link-type trunk [Huawei-GigabitEthernet0/0/1] port trunk allow-pass vlan all [Huawei-GigabitEthernet0/0/1] interface GigabitEthernet0/0/2 [Huawei-GigabitEthernet0/0/2] port link-type access [Huawei-GigabitEthernet0/0/2] port default vlan 2 [Huawei-GigabitEthernet0/0/2] ip route-static 0.0.0.0 0.0.0.0 192.168.30.2
r1的配置
1 2 3 4 5 6 7 8
[huawei] interface GigabitEthernet0/0/0 [Huawei-GigabitEthernet0/0/0] ip address 192.168.20.2 255.255.255.252 [Huawei-GigabitEthernet0/0/0] interface GigabitEthernet0/0/1 [Huawei-GigabitEthernet0/0/1] ip address 192.168.30.2 255.255.255.252 [Huawei-GigabitEthernet0/0/1] interface LoopBack0 [Huawei-LoopBack0] ip address 10.10.10.200 255.255.255.0 [huawei] ip route-static 192.168.10.0 255.255.255.0 192.168.20.1 [huawei] ip route-static 192.168.10.0 255.255.255.0 192.168.30.1 preference 100
查看vrrp信息
sw1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[Huawei]dis vrrp Vlanif1 Virtual Router 1 State : Master Virtual IP : 192.168.10.254 Master IP : 192.168.10.1 PriorityRun : 200 PriorityConfig : 200 MasterPriority : 200 Preempt : YES Delay Time : 20 s TimerRun : 1 s TimerConfig : 1 s Auth type : NONE Virtual MAC : 0000-5e00-0101 Check TTL : YES Config type : normal-vrrp Track IF : GigabitEthernet0/0/2 Priority reduced : 100 IF state : UP Create time : 2019-08-12 11:20:09 UTC-08:00 Last change time : 2019-08-12 18:33:42 UTC-08:00
sw2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
[Huawei]dis vrrp Vlanif1 Virtual Router 1 State : Backup Virtual IP : 192.168.10.254 Master IP : 192.168.10.1 PriorityRun : 150 PriorityConfig : 150 MasterPriority : 200 Preempt : YES Delay Time : 0 s TimerRun : 1 s TimerConfig : 1 s Auth type : NONE Virtual MAC : 0000-5e00-0101 Check TTL : YES Config type : normal-vrrp Create time : 2019-08-12 11:30:17 UTC-08:00 Last change time : 2019-08-12 18:33:43 UTC-08:00
[Huawei]dis ip routing-table Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.10.10.0/24 Direct 0 0 D 10.10.10.200 LoopBack0 10.10.10.200/32 Direct 0 0 D 127.0.0.1 LoopBack0 10.10.10.255/32 Direct 0 0 D 127.0.0.1 LoopBack0 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 192.168.10.0/24 Static 60 0 RD 192.168.20.1 GigabitEthernet 0/0/0 192.168.20.0/30 Direct 0 0 D 192.168.20.2 GigabitEthernet 0/0/0 192.168.20.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 192.168.20.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 192.168.30.0/30 Direct 0 0 D 192.168.30.2 GigabitEthernet 0/0/1 192.168.30.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 192.168.30.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0