一种动态管理虚拟局域网(VLAN)的协议:GVRP

技术介绍:

在对交换机进行VLAN配置的时候,需要在每一台交换机上手工创建该交换机需要涉及到的所有VLAN,并且需要手工将交换机上的各个端口加入到相应的VLAN中去。如果交换机及 VLAN 的数量太多,特别是 VLAN 的数量又经常变化时,这种手工配置方式既耗费时间和精力,又非常容易出错。

为此,IEEE制定了一个名为GARP(Generic Attribute Registration Protocol,通用属性注册协议)的框架协议,该框架协议包含了两个具体的协议,分别称为

GMRP (GARP Multicast Registration Protocl,简称GMRP)和GVRP(GARP VLAN Registration Protocl,简称GVRP)。GVRP的应用,可以大大地降低VLAN配置过程中的手工工作量。

在涉及 GVRP 协议的应用时,我们通常将交换机上手工创建的 VLAN 称为静态VLAN,而将交换机利用GVRP协议自动创建的VLAN称为动态VLAN。GVRP协议提供了一种在交换机之间传递 VLAN 属性的机制,其主要作用是自动实现 VLAN 信息在交换机上的动态注册过程和注销过程。交换机上部署了GVRP协议后,用户只需要对少量的交换机进行静态 VLAN 配置,便可将这些 VLAN 配置信息传递并应用到其他的交换机上。

 

 

如图所示,PC1和PC2都被划分到VLAN 10,因此所有的交换机上都要进行针对VLAN 10的配置。

假设交换机LSW1、LSW2、LSW3、LSW4都已经全局使能了GVRP功能,并且相关的端口(LSW1的GE0/0/2LSW2的GE0/0/1和GE0/0/2LSW3的GE0/0/1和GE0/0/2LSW4的GE0/0/1)也都使能了GVRP功能,

那么当用户在交换机LSW1上手工创建了静态VLAN 10,并且配置LSW1的GE0/0/1端口允许属于VLAN 10的帧通过之后,LSW1的GE0/0/1端口便会向外发送VLAN属性的注册报文。

LSW2通过其GE0/0/1端口接收到LSW1发送过来的VLAN属性注册报文后,会自动创建动态VLAN 10,并将自己的GE0/0/1端口注册到(加入进)动态VLAN 10中。然后, LSW2会通过其GE0/0/2端口向外发送VLAN属性注册报文。需要注意的是,只有从链路上接收到VLAN属性注册报文的端口才会注册到相应的VLAN中,所以LSW2的GE0/0/2端口现在并未注册到动态VLAN 10中。

LSW3通过其GE0/0/1端口接收到LSW2发送过来的VLAN属性注册报文后,会自动创建动态VLAN 10,并将自己的GE0/0/1端口注册到动态VLAN 10中。然后,LSW3会通过其GE0/0/2端口向外发送VLAN属性注册报文。需要注意的是,LSW3的GE0/0/2端口现在并未注册到动态VLAN 10中。

LSW4通过其GE0/0/1端口接收到LSW3发送过来的VLAN属性注册报文后,会自动创建动态VLAN 10,并将自己的GE0/0/1端口注册到动态VLAN 10中。

 

 

在上述由LSW1向LSW4传递关于VLAN 10的信息过程中,LSW2、LSW3、LSW4上自动创建了动态VLAN 10,并且LSW2的GE0/0/1端口、LSW3的GE0/0/1端口、LSW4的GE0/0/1端口已经注册到VLAN 10中(这个过程称为VLAN属性的单向注册过程)。但是,到目前为止,LSW2的GE0/0/2端口和LSW3的GE0/0/2端口还未注册到VLAN 10中,所以,用户还必须在S4上手工创建静态VLAN 10,并配置LSW4的GE0/0/1端口允许通过属于VLAN 10的帧。

如图,在LSW4上手工创建静态VLAN 10,并配置LSW4的GE0/0/1端口允许通过属于 VLAN 10的帧。注意,所配置的静态 VLAN 10的信息会替换掉 S4上的动态VLAN 10的信息。然后,LSW4的GE0/0/1端口会向外发送VLAN属性的注册报文。

LSW3通过其GE0/0/2端口接收到LSW4发送过来的VLAN属性注册报文后,会将自己的GE0/0/2端口注册到已经被创建了的动态VLAN 10中。然后,LSW3会通过其GE0/0/1端口向外发送VLAN属性注册报文。

LSW2通过其GE0/0/2端口接收到LSW3发送过来的VLAN属性注册报文后,会将自己的GE0/0/2端口注册到已经被创建了的动态VLAN 10中。然后,LSW2会通过其GE0/0/1端口向外发送VLAN属性注册报文。

LSW1的GE0/0/1端口也会接收到LSW2发送过来的VLAN属性注册报文。由于LSW1上以及LSW1的GE0/0/1端口上已经有了关于静态VLAN 10的相关信息,所以LSW1不会进行涉及动态VLAN 10的相关操作。

 

提示:

当网络中的VLAN数量需要增加时,我们可以利用GVRP协议来进行VLAN的自动创建和注册。同样,当网络中的VLAN数量需要减少时,我们也可以利用GVRP协议来进行VLAN的自动删除和注销。

 

 

配置示例

 

如图所示,PC1和PC2被划分至VLAN 10中,我们希望GVRP协议来实现VLAN 10的自动创建和注册。

LSW1配置:

[XJWS1]dis cu
#
sysname XJWS1
#
vlan batch 10
#
gvrp
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default
 domain default_admin
 local-user admin password simple admin
 local-user admin service-type http
#
interface Vlanif1
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 10
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 gvrp
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
user-interface con 0
user-interface vty 0 4
#
return
[XJWS1]

LSW2配置:

 

[XJWS2]display gvrp status
 Info: GVRP is enabled
[XJWS2]display vlan summary
static vlan:
Total 1 static vlan.
  1 


dynamic vlan:

Total 1 dynamic vlan.

10




reserved vlan:

Total 0 reserved vlan.

[XJWS2]

[XJWS2]dis cu






sysname XJWS2






gvrp






cluster enable

ntdp enable

ndp enable






drop illegal-mac alarm






diffserv domain default






drop-profile default






aaa

authentication-scheme default

authorization-scheme default

accounting-scheme default

domain default

domain default_admin

local-user admin password simple admin

local-user admin service-type http






interface Vlanif1






interface MEth0/0/1






interface GigabitEthernet0/0/1

port link-type trunk

port trunk allow-pass vlan 2 to 4094

gvrp






interface GigabitEthernet0/0/2

port link-type trunk

port trunk allow-pass vlan 2 to 4094

gvrp






interface GigabitEthernet0/0/3






interface GigabitEthernet0/0/4






interface GigabitEthernet0/0/5






interface GigabitEthernet0/0/6






interface GigabitEthernet0/0/7






interface GigabitEthernet0/0/8






interface GigabitEthernet0/0/9






interface GigabitEthernet0/0/10






interface GigabitEthernet0/0/11






interface GigabitEthernet0/0/12






interface GigabitEthernet0/0/13






interface GigabitEthernet0/0/14






interface GigabitEthernet0/0/15






interface GigabitEthernet0/0/16






interface GigabitEthernet0/0/17






interface GigabitEthernet0/0/18






interface GigabitEthernet0/0/19






interface GigabitEthernet0/0/20






interface GigabitEthernet0/0/21






interface GigabitEthernet0/0/22






interface GigabitEthernet0/0/23






interface GigabitEthernet0/0/24






interface NULL0






user-interface con 0

user-interface vty 0 4




return

[XJWS2]

LSW3配置:

[XJWS3-GigabitEthernet0/0/2]dis cu
#
sysname XJWS3
#
gvrp
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default
 domain default_admin
 local-user admin password simple admin
 local-user admin service-type http
#
interface Vlanif1
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 gvrp
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 gvrp
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
user-interface con 0
user-interface vty 0 4
#
return

LSW4配置:

[XJWS4]dis cu
#
sysname XJWS4
#
vlan batch 10
#
gvrp
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default
 domain default_admin
 local-user admin password simple admin
 local-user admin service-type http
#
interface Vlanif1
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 gvrp
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 10
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
user-interface con 0
user-interface vty 0 4
#
return
[XJWS4]

 

 

配置验证:

1)可以使用命令display gvrp status,查看全局GVRP的使能情况。

[XJWS1]dis gvrp status 
 Info: GVRP is enabled

2)可以使用命令display gvrp statistics,查看端口的GVRP统计信息。

[XJWS3]display gvrp statistics 


GVRP statistics on port GigabitEthernet0/0/1

GVRP status				: Enabled

GVRP registrations failed		: 0

GVRP last PDU origin		: 4c1f-cc30-75cd

GVRP registration type		: Normal


GVRP statistics on port GigabitEthernet0/0/2

GVRP status				: Enabled

GVRP registrations failed		: 0

GVRP last PDU origin		: 0000-0000-0000

GVRP registration type		: Normal

[XJWS3]

[XJWS4]display gvrp statistics

  GVRP statistics on port GigabitEthernet0/0/1 
    GVRP status				: Enabled
    GVRP registrations failed		: 0
    GVRP last PDU origin		: 4c1f-cc87-1731
    GVRP registration type		: Normal
[XJWS4]

 

posted @   小橘哇  阅读(344)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示