LSW1配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW1
[SW1]vlan batch 10 20 13
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]int vlanif 10
[SW1-Vlanif10]ip address 192.168.10.251 24
[SW1-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.254
[SW1-Vlanif10]vrrp vrid 10 priority 130
[SW1-Vlanif10]int vlanif 20
[SW1-Vlanif20]ip address 192.168.20.251 24
[SW1]int vlanif 20
[SW1-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.254
[SW1-Vlanif20]int vlanif 13
[SW1-Vlanif13]ip address 192.168.13.1 24
[SW1-Vlanif13]q
[SW1]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 13
[SW1-GigabitEthernet0/0/2]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]q
Enter system view, return user view with Ctrl+Z.
[SW1]ip route-static 192.168.30.0 24 192.168.13.3
[SW1]int vlanif 10
[SW1-Vlanif10]vrrp vrid 10 track int g0/0/2 reduced 50
LSW2配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW2
[SW2]vlan batch 10 20 23
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2]int vlanif 10
[SW2-Vlanif10]ip address 192.168.10.252 24
[SW2-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.254
[SW2-Vlanif10]int vlanif 20
[SW2-Vlanif20]ip address 192.168.20.252 24
[SW2-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.254
[SW2-Vlanif20]vrrp vrid 20 priority 130
[SW2-Vlanif20]int vlanif 23
[SW2-Vlanif23]ip address 192.168.23.1 24
[SW2-Vlanif23]q
[SW2]int g0/0/2
[SW2-GigabitEthernet0/0/2]port link-type access
[SW2-GigabitEthernet0/0/2]port default vlan 23
[SW2-GigabitEthernet0/0/2]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]q
[SW2]ip route-static 192.168.30.0 24 192.168.23.3
[SW2]int vlanif 20
[SW2-Vlanif20]vrrp vrid 20 track int g0/0/2 reduced 50
LSW3配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW3
[SW3]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3]port-group group-member g0/0/1 g0/0/2
[SW3-port-group]port link-type access
[SW3-GigabitEthernet0/0/1]port link-type access
[SW3-GigabitEthernet0/0/2]port link-type access
[SW3-port-group]port default vlan 10
[SW3-GigabitEthernet0/0/1]port default vlan 10
[SW3-GigabitEthernet0/0/2]port default vlan 10
[SW3-port-group]q
[SW3]port-group group-member g0/0/3 g0/0/4
[SW3-port-group]port link-type access
[SW3-GigabitEthernet0/0/3]port link-type access
[SW3-GigabitEthernet0/0/4]port link-type access
[SW3-port-group]port default vlan 20
[SW3-GigabitEthernet0/0/3]port default vlan 20
[SW3-GigabitEthernet0/0/4]port default vlan 20
[SW3-port-group]q
[SW3]port-group group-member g0/0/5 g0/0/6
[SW3-port-group]port link-type trunk
[SW3-GigabitEthernet0/0/5]port link-type trunk
[SW3-GigabitEthernet0/0/6]port link-type trunk
[SW3-port-group]port trunk allow-pass vlan all
[SW3-GigabitEthernet0/0/5]port trunk allow-pass vlan all
[SW3-GigabitEthernet0/0/6]port trunk allow-pass vlan all
AR1配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.13.3 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.23.3 24
[R1-GigabitEthernet0/0/1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip address 192.168.30.254 24
[R1-GigabitEthernet0/0/2]q
[R1]ip route-static 192.168.10.0 24 192.168.13.1
[R1]ip route-static 192.168.20.0 24 192.168.13.1
[R1]ip route-static 192.168.10.0 24 192.168.23.1
[R1]ip route-static 192.168.20.0 24 192.168.23.1
测试
VRRP密码认证
BFD多跳检测
AR1配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.12.1 24
[R1-GigabitEthernet0/0/0]q
[R1]ip route-static 192.168.23.0 24 192.168.12.2
[R1]ping -a 192.168.12.1 192.168.23.3
PING 192.168.23.3: 56 data bytes, press CTRL_C to break
Request time out
Reply from 192.168.23.3: bytes=56 Sequence=2 ttl=254 time=60 ms
Reply from 192.168.23.3: bytes=56 Sequence=3 ttl=254 time=40 ms
Reply from 192.168.23.3: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 192.168.23.3: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 192.168.23.3 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 30/40/60 ms
[R1]bfd
[R1-bfd]q
[R1]bfd ntd2305 bind peer-ip 192.168.23.3
[R1-bfd-session-ntd2305]discriminator local 1
[R1-bfd-session-ntd2305]discriminator remote 3
[R1-bfd-session-ntd2305]commit
[R1-bfd-session-ntd2305]q
[R1]display bfd session all
--------------------------------------------------------------------------------
Local Remote PeerIpAddr State Type InterfaceName
--------------------------------------------------------------------------------
1 3 192.168.23.3 Up S_IP_PEER -
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 1/0
[R1]bfd ntd2305
[R1-bfd-session-ntd2305]min-rx-interval 10
[R1-bfd-session-ntd2305]min-tx-interval 10
[R1-bfd-session-ntd2305]commit
AR2配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.12.2 24
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.23.2 24
[R2-GigabitEthernet0/0/1]q
AR3配置
<Huawei>sys
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.23.3 24
[R3-GigabitEthernet0/0/0]q
[R3]ip route-static 192.168.12.0 24 192.168.23.2
[R3]bfd
[R3-bfd]q
[R3]bfd ntd2305 bind peer-ip 192.168.12.1
[R3-bfd-session-ntd2305]discriminator local 3
[R3-bfd-session-ntd2305]discriminator remote 1
[R3-bfd-session-ntd2305]commit
[R3]bfd ntd2305
[R3-bfd-session-ntd2305]min-rx-interval 10
[R3-bfd-session-ntd2305]min-tx-interval 10
[R3-bfd-session-ntd2305]commit