手工配置的VLAN称为静态VLAN,通过GVRP协议创建的VLAN称为动态VLAN。
GVRP有三种注册模式,不同的模式对静态VLAN和动态VLAN的处理方式也不同。
GVRP的三种注册模式分别定义如下:
Normal模式:允许动态VLAN在端口上进行注册,同时会发送静态VLAN和动态VLAN的声明消息。
Fixed模式:不允许动态VLAN在端口上注册,只发送静态VLAN的声明消息。
Forbidden模式:不允许动态VLAN在端口上进行注册,同时删除端口上除VLAN1外的所有VLAN,只发送VLAN1的声明消息。
LSW11配置
<Huawei>sy
[Huawei]undo in en
[Huawei]vlan 10[Huawei]gvrp //开启GVRP服务
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all[Huawei-GigabitEthernet0/0/1]gvrp //trunk模式下才允许开启GVRP
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access
[Huawei-GigabitEthernet0/0/2]port default vlan 10
[Huawei-GigabitEthernet0/0/2]q
LSW12配置
<Huawei>sy
[Huawei]undo in en
[Huawei]gvrp
[Huawei]vlan 20
[Huawei-vlan20]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type trunk
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan all[Huawei-GigabitEthernet0/0/2]gvrp
[Huawei-GigabitEthernet0/0/2]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/1]gvrp
[Huawei-GigabitEthernet0/0/1]int g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 20
LSW13配置
<Huawei>sy
[Huawei]undo in en
[Huawei]gvrp
[Huawei]vlan 10
[Huawei-vlan30]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/1]gvrp
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access
[Huawei-GigabitEthernet0/0/2]port default vlan 10
测试通信