实验名称:华为vrrp配置

实验目的:为了实现路由器的冗余即备份,当其中一个三层交换机坏了,PC还能正常上网

实验拓扑:


spacer.gif

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

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

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

验证:实现全网通

spacer.gif

开启 debug

terminal monito

terminal debugging

debugging ip icmp

sys   

[sw1]info-center console channel monitor

发包

回包看看是哪个三层

spacer.gif