華為vrrp配置
實驗目的:為了實現路由器的冗余即備份,當其中一個三層交換機壞了,PC還能正常上網
實驗拓撲:
SW3 配置步驟
思路:創建vlan10 20 30 40 ,01、02、03、04端口分別加入vlan10到40.
05、06端口配置trunk模式允許所有vlan通過
[Huawei]sysname sw1
創建vlan
[sw1]vlan batch 10 20 30 40
加入vlan10
[sw1]inter GigabitEthernet 0/0/1
[sw1-GigabitEthernet0/0/1]port link-type access
[sw1-GigabitEthernet0/0/1]port default vlan 10
加入vlan20
[sw1-GigabitEthernet0/0/1]inter gi 0/0/2
[sw1-GigabitEthernet0/0/2]port link-type access
[sw1-GigabitEthernet0/0/2]port default vlan 20
加入vlan30
[sw1-GigabitEthernet0/0/2]inter gi 0/0/3
[sw1-GigabitEthernet0/0/3]port link-type access
[sw1-GigabitEthernet0/0/3]port default vlan 30
加入vlan40
[sw1-GigabitEthernet0/0/3]inter gi0/0/4
[sw1-GigabitEthernet0/0/4]port link-type access
[sw1-GigabitEthernet0/0/4]port default vlan 40
[sw1-GigabitEthernet0/0/4]q
配置trunk模式
[sw1]inter GigabitEthernet 0/0/6
[sw1-GigabitEthernet0/0/6]port link-type trunk
[sw1-GigabitEthernet0/0/6]port trunk allow-pass vlan all
[sw1]inter gi 0/0/5
[sw1-GigabitEthernet0/0/5]port link-type trunk
[sw1-GigabitEthernet0/0/5]port trunk allow-pass vlan a
配置sw2
<Huawei>sys
創建vlan
[Huawei]vlan batch 10 20 30 40
每個vlan配置ip地址
[Huawei]inter vlan 10
[Huawei-Vlanif10]ip address 192.168.10.253 255.255.255.0
[Huawei-Vlanif10]inter vlan 20
[Huawei-Vlanif20]ip address 192.168.20.253 255.255.255.0
[Huawei-Vlanif20]inter vlan 30
[Huawei-Vlanif30]ip address 192.168.30.253 255.255.255.0
[Huawei-Vlanif30]inter vlan 40
[Huawei-Vlanif40]ip address 192.168.40.253 255.255.255.0
把vlan40加入組,並配置vrrp
vrrp配置虛擬IP
[Huawei-Vlanif40]vrrp vrid 40 virtual-ip 192.168.40.250
配置優先級
[Huawei-Vlanif40]vrrp vrid 40 priority 150
配置 鏈路跟蹤
[Huawei-Vlanif40]vrrp vrid 40 track interface gi0/0/2 reduced 100(如果gi0/0/2端口的狀態變為down,則優先級降低100,變為50)
相同的操作配置vlan30
[Huawei-Vlanif40]inter vlan 30
[Huawei-Vlanif30]vrrp vrid 30 virtual-ip 192.168.30.250
[Huawei-Vlanif30]vrrp vrid 30 priority 100
[Huawei-Vlanif30]vrrp vrid 30 track interface GigabitEthernet 0/0/2 reduced 100
開啟vlan10的vrrp功能
[Huawei-Vlanif30]inter vlan 10
[Huawei-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.250
開啟vlan20的vrrp功能
[Huawei-Vlanif10]inter vlan 20
[Huawei-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.250
將gi0/0/1配置為trunk模式
[Huawei-Vlanif20]inter gi0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
sw1
配置vlan10 20 的vrrp優先級為150
vlan30 40 開啟vrrp
<Huawei>
<Huawei>sys
[Huawei]vlan batch 10 20 30 40
[Huawei]inter vlan 10
[Huawei-Vlanif10]ip address 192.168.10.254 255.255.255.0
[Huawei-Vlanif10]inter vlan 20
[Huawei-Vlanif20]ip address 192.168.20.254 255.255.255.0
[Huawei-Vlanif20]inter vlan 30
[Huawei-Vlanif30]ip address 192.168.30.254 255.255.255.0
[Huawei-Vlanif30]inter vlan 40
[Huawei-Vlanif40]ip address 192.168.40.254 255.255.255.0
[Huawei-Vlanif40]q
[Huawei]inte gi 0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/1]q
[Huawei]inter vlan 10
[Huawei-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.250
[Huawei-Vlanif10]vrrp vrid 10 priority 150
[Huawei-Vlanif10]vrrp vrid 10 track inter gi 0/0/2 reduced 100
[Huawei-Vlanif10]inter vlan 20
[Huawei-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.250
[Huawei-Vlanif20]vrrp vrid 20 priority 150
[Huawei-Vlanif20]vrrp vrid 20 track inter gi0/0/2 reduced 100
驗證:實現全網通
開啟 debug
<sw1>terminal monito
<sw1>terminal debugging
<sw1>debugging ip icmp
<sw1>sys
[sw1]info-center console channel monitor
發包
回包看看是哪個三層
華為vrrp配置