欢迎您访问我爱IT技术网,今天小编为你分享的电脑教程是网络协议方面的经验知识教程:private vlan的配置,下面是详细的分享!
private vlan的配置
private vlan的配置
private vlan:
private vlan是一个私有vlan,配置之后可以实现同一vlan的主机之间实现隔离,加强了网络安全。
private vlan包括三部分,分别是:primary vlan、isolated vlan、community vlan。primary vlan是一个整体vlan,各部分的主机都能和这部分的主机通信;isolated vlan是一个隔离vlan,isolated vlan中的用户之间不能相互通信,isolated vlan中的用户只能和primary vlan中的用户通信;相同community vlan中的主机相互之间能够通信,不同community vlan之间的用户不能通信,community vlan中的用户可以和primary vlan中的用户通信,一个vlan中至少有isolated vlan和community vlan的和至少是一个,同时一个vlan中最多有一个isolated vlan。在对外表现时,这个vlan表现的是primary vlan的id号码和信息,isolated vlan和community vlan的信息不对外表现。在vlan中,位于primary vlan中的端口是promiscuous port,位于isolated vlan中的端口是isolated port,位于community vlan中的端口是community port。
配置代码:(因为没有找到能够模拟private vlan这个功能的模拟器,所以转载了这个朋友的代码)
switch(config)#vtp mode transparent #将VTP版本设置为1或2,并且要求工作在transparent模式下
switch(config)# vlan 200
switch(config-vlan)#private-vlan community #定义vlan 200为团体vlan
switch(config)#vlan 300
switch(config-vlan)#private-vlan isolated #定义vlan 300为隔离vlan
switch(config)#vlan 100
switch(config-vlan)#private-vlan primary #定义vlan 100为主vlan
switch(config-vlan)#private-vlan association 200,300 #进入主vlan中,将所有辅助vlan关联到主vlan。这里可以配置添加哪些辅助vlan的关联或移除哪些辅助vlan的关联。
switch(config)#interface range fa0/1 – 2
switch(config-if)#switchport mode private-vlan host #配置fa0/1 – 2为主机端口
switch(config-if)# switchport private-vlan host-assocition 100 200 #在主机端口上配置PVLAN的端口关联
switch(config)#interface fa0/3 – 4
switch(config-if)#switchport mode private-vlan host #配置fa0/3 – 4为主机端口
switch(config-if)# switchport private-vlan host-assocition 100 300 #在主机端口上配置PVLAN的端口关联
switch(config)#interface fa0/24 #配置fa0/24为混杂端口
switch(config-if)#switchport mode private-vlan promiscuous
switch(config-if)# switchport private-vlan mapping 100 200,300 #在混杂端口上配置PVLAN的端口关联
以上就是关于private vlan的配置的网络协议知识分享,更多电脑教程请移步到>>电脑教程。
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
