以下内容摘自笔者最新图书《Cisco/H3C交换机配置与管理完全手册》。 本书在51CTO上的样章试读地址为:http://book.51cto.com/art/200908/142118.htm 8.5.4 创建PVLAN

在IOS和CatOS系统交换机中都可以配置PVLAN,所以下面也分别予以介绍。

1. IOS系统交换机的PVLAN创建

在IOS系统交换机中,创建一个PVLAN的步骤如表8-18所示。.

表8-18 配置VLAN作为PVLAN的步骤

命令

用途

Step 1

Switch(config)# vlan vlan_ID

键入要配置的VLAN的VLAN ID,进入VLAN配置模式

Step 2

Switch(config-vlan)# private-vlan {community | isolated | primary}

配置该VLAN为PVLAN

Switch(config-vlan)# no private-vlan {community | isolated | primary}

清除PVLAN配置。这个命令的配置要到退出VLAN配置模式后才会生效

Step 3

Switch(config-vlan)# end

退出VLAN配置模式

Step 4

Switch# show vlan private-vlan [type]

校验以上配置

以下示例显示如何配置VLAN 202作为一个主VLAN(primary VLAN),并校验配置。

Switch# configure terminal

Switch(config)# vlan 202

Switch(config-vlan)# private-vlan primary

Switch(config-vlan)# end

Switch# show vlan private-vlan

Primary Secondary Type Interfaces

------- --------- ----------------- ------------------------------------------

202 primary

以下示例显示如何配置VLAN 303作为公共VLAN(community VLAN),并校验配置。

Switch# configure terminal

Switch(config)# vlan 303

Switch(config-vlan)# private-vlan community

Switch(config-vlan)# end

Switch# show vlan private-vlan

Primary Secondary Type Interfaces

------- --------- ----------------- ------------------------------------------

202 primary

303 community

以下示例显示如何配置VLAN 440作为一个隔离VLAN(isolated VLAN),并校验配置。

Switch# configure terminal

Switch(config)# vlan 440

Switch(config-vlan)# private-vlan isolated

Switch(config-vlan)# end

Switch# show vlan private-vlan

Primary Secondary Type Interfaces

------- --------- ----------------- ------------------------------------------

202 primary

303 community

440 isolated

2. CatOS系统交换机的PVLAN创建

你可以使用“set pvlan primary_vlan_num {isolated_vlan_num | community_vlan_num}”命令绑定没有与隔离端口(isolated port)或者公共端口(community port)关联的隔离VLAN(isolated VLAN)或者公共VLAN(community VLAN)到主VLAN(private VLAN)中。也可以使用“set pvlan primary_vlan_num {isolated_vlan_num | community_vlan_num} mod/port”命令改变PVLAN中的隔离或者公共端口,而不用改变隔离或者公共VLAN。

你必须键入“set pvlan”命令来创建PVLAN,具体的步骤如表8-19所示。

表8-19 在CatoS系统交换机上创建PVLAN的步骤

命令

用途说明

Step 1

Console> (enable) set vlan vlan_num pvlan-type primary

创建主VLAN

Step 2

Console> (enable) set vlan vlan_num pvlan-type {isolated | community}

设置隔离或者公共VLAN

Step 3

Console> (enable)set pvlan primary_vlan_num {isolated_vlan_num | community_vlan_num}mod/ports

绑定隔离或者公共VLAN到主VLAN中,并把隔离或者公共VLAN与PVLAN进行关联

Step 4

Console> (enable) set pvlan mapping primary_vlan_num {isolated_vlan_num | community_vlan_num} mod/ports

在混杂端口上映射隔离、公共VLAN到主VLAN

Step 5

Console> (enable) show pvlan [vlan_num]

Console> (enable) show pvlan mapping

校验PVLAN配置

以下示例显示了如何使用VLAN 7作为主VLAN,VLAN 901作为隔离VLAN,VLAN 902和VLAN 903作为公共VLAN来创建一个PLAVN。VLAN 901使用模块4的端口3;VLAN 902使用模块4的端口4~6;VLAN 903使用模块4的端口7~9。路由器是连接到混杂端口3/1上的。

在开始编辑没有分配端口的VLAN 7、901、902、903前,使用“show vlan vlan_num”命令查看各VLAN中端口成员。如果在这些VLAN中,已分配了任何端口,使用“set vlan vlan_num {mod/port}”命令设置它们到其他适当的VLAN中。

以下示例显示了如何指定VLAN 7作为主LVAN。

Console> (enable) set vlan 7 pvlan-type primary

Vlan 7 configuration successful

Console> (enable)

以下示例显示如何指定VLAN 901作为隔离VLAN,VLAN 902和VLAN 903作为公共VLAN。

Console> (enable) set vlan 901 pvlan-type isolated

Vlan 901 configuration successful

Console> (enable) set vlan 902 pvlan-type community

Vlan 902 configuration successful

Console> (enable) set vlan 903 pvlan-type community

Vlan 903 configuration successful

Console> (enable)

以下示例显示如何绑定VLAN 901到主VLAN 7中,并指定端口4/3作为隔离端口。

Console> (enable) set pvlan 7 901 4/3

Successfully set the following ports to Private Vlan 7,901: 4/3

Console> (enable)

以下示例显示如何绑定VLAN 902到主VLAN 7中,并指定端口4/4~4/6作为隔离端口。

Console> (enable) set pvlan 7 902 4/4-6

Successfully set the following ports to Private Vlan 7,902:4/4-6

Console> (enable)

以下示例显示如何绑定VLAN 903到主VLAN 7中,并指定端口4/7~4/9作为隔离端口。

Console> (enable) set pvlan 7 903

Successfully set association between 7 and 903.

Console> (enable) set pvlan 7 903 4/7-9

Successfully set the following ports to Private Vlan 7,903:4/7-9

Console> (enable)

以下示例显示如何在混杂端口3/1上映射每个隔离和公共VLAN流量到主VLAN。

Console> (enable) set pvlan mapping 7 901 3/1

Successfully set mapping between 7 and 901 on 3/1

Console> (enable) set pvlan mapping 7 902 3/1

Successfully set mapping between 7 and 902 on 3/1

Console> (enable) set pvlan mapping 7 903 3/1

Successfully set mapping between 7 and 903 on 3/1

以下示例显示如何校验PVLAN配置。

Console> (enable) show vlan 7

VLAN Name Status IfIndex Mod/Ports, Vlans

---- -------------------------------- --------- ------- ------------------------

7 VLAN0007 active 35 4/4-6

VLAN Type SAID MTU Parent RingNo BrdgNo Stp BrdgMode Trans1 Trans2

---- ----- ---------- ----- ------ ------ ------ ---- -------- ------ ------

7 enet 100010 1500 - - - - - 0 0

VLAN DynCreated RSPAN

---- ---------- --------

7 static disabled

VLAN AREHops STEHops Backup CRF 1q VLAN

---- ------- ------- ---------- -------

Primary Secondary Secondary-Type Ports

------- --------- ----------------- -----------------

7 901 Isolated 4/3

7 902 Community 4/4-6

7 903 Community 4/7-9

Console> (enable) show vlan 902

VLAN Name Status IfIndex Mod/Ports, Vlans

---- -------------------------------- --------- ------- ------------------------

902 VLAN0007 active 38 4/4-6

VLAN Type SAID MTU Parent RingNo BrdgNo Stp BrdgMode Trans1 Trans2

---- ----- ---------- ----- ------ ------ ------ ---- -------- ------ ------

7 enet 100010 1500 - - - - - 0 0

VLAN DynCreated RSPAN

---- ---------- --------

7 static disabled

VLAN AREHops STEHops Backup CRF 1q VLAN

---- ------- ------- ---------- -------

Primary Secondary Secondary-Type Ports

------- --------- ----------------- -----------------

7 902 Isolated 4/4-6

Console> (enable) show pvlan

Primary Secondary Secondary-Type Ports

------- --------- -------------- ------------

7 901 isolated 4/3

7 902 community 4/4-6

7 903 community 4/7-9

Console> (enable) show pvlan mapping

Port Primary Secondary

----- -------- ----------

3/1 7 901-903

Console> (enable) show port

Port Name Status Vlan Duplex Speed Type

----- ------------------ ---------- ---------- ------ ----- ------------

...truncated output...

4/3 notconnect 7,901 half 100 100BaseFX MM

4/4 notconnect 7,902 half 100 100BaseFX MM

4/5 notconnect 7,902 half 100 100BaseFX MM

4/6 notconnect 7,902 half 100 100BaseFX MM

4/7 notconnect 7,903 half 100 100BaseFX MM

4/8 notconnect 7,903 half 100 100BaseFX MM

4/9 notconnect 7,903 half 100 100BaseFX MM

... truncated output...

跟我学交换机配置(四)相关推荐

  1. 跟我学交换机配置(三)

    以下内容摘自笔者最新图书<Cisco/H3C交换机配置与管理完全手册>. 本书在51CTO上的样章试读地址为:http://book.51cto.com/art/200908/142118 ...

  2. 跟我学交换机配置(一)

    从本篇开始,从笔者最新的图书<Cisco/H3C交换机配置与管理完全手册>一书中摘选部分内容与广大读者朋友分享. 本书在51CTO上的样章试读地址为:http://book.51cto.c ...

  3. Cisco Packet Tracer_实验四_使用两台二层交换机配置vlan

    建立拓扑 首先先建立如下的拓扑,每一台交换机与两台主机相连.此处值得注意的是主机IP地址的配置:最好不要将即将设置在不同VLAN下的两台主机配置在不同的网段中,如PC0配置在10.0网段,PC1配置在 ...

  4. 实验四 交换机配置方式及基本命令的熟悉

    [实验目的] 通过对交换机设备的几种配置手段.配置模式和基本配置命令的认识,获得交换机的基本使用能力. [实验任务] 1.认识交换机的配置方式. 2.按照给出的参考拓扑图构建逻辑拓扑图. 3.按照给出 ...

  5. 《H3C交换机配置与管理完全手册》(第二版)前言和目录

    史上最具人气.最受好评的网络设备图书领域"四大金刚"的全新升级版本再现江湖了,他们分别是:<Cisco交换机配置与管理完全手册>(第二版).<H3C交换机配置与管 ...

  6. 华为3COM交换机配置

    华为3Com 2000_EI.S2000-SI.S3000-SI.S3026E.S3526E.S3528.S3552.S3900.S3050.S5012.S5024.S5600系列: 华为交换机端口限 ...

  7. 交换机配置软件crt安装_非常详细的锐捷二层交换机配置教程,适合新手小白

    笔者上一篇文章写了关于锐捷三层交换机配置教程,但是这只是核心的配置,还不能搭建一个完整的企业网络.那么这一篇就来讲一下锐捷的二层交换机配置,比起三层交换机的配置,二层交换机配置就非常简单了.同样,今天 ...

  8. 从PRISM开始学WPF(四)Prism-Module?

    原文:从PRISM开始学WPF(四)Prism-Module? 从PRISM开始学WPF(一)WPF? 从PRISM开始学WPF(二)Prism? 从PRISM开始学WPF(三)Prism-Regio ...

  9. cisco3550交换机配置手册

    cisco3550交换机配置手册 说明 本手册只包括日常使用的有关命令及特性,其它未涉及的命令及特性请参考英文的详细配置手册. 产品特性 3550EMI是支持二层.三层功能(EMI)的交换机 支持VL ...

最新文章

  1. python语言if语句-Python中if语句是怎么用的?本文详解
  2. python 类-python--类
  3. ECSHOP如何增加红包序列号字符
  4. MyEclipse使用总结——MyEclipse文件查找技巧 ctrl+shift+R ctrl+H
  5. C/C++混淆点-运算符短路
  6. matlab两张图片合成一张_二次曝光合成手机照片剪影照并不难,这样用snapseed轻松实现...
  7. 【Keras】完整实现‘交通标志’分类、‘票据’分类两个项目,让你掌握深度学习图像分类...
  8. JavaEE 笔记一
  9. 获取微信公众平台的access_token
  10. linux中pak命令,Linux下Flatpak的安装与使用超详细教程
  11. 网吧服务器ip地址修改,详解修改BXP服务器IP地址的方法
  12. Unity 官方教程2
  13. 计算机类研究生求职经历以及经验共享(转)
  14. 【RS-422与RS-485】RS-422与RS-485串行接口标准
  15. Django ORM模型一对一、一对多、多对多的操作详解
  16. 学一点Wi-Fi:Roaming
  17. win7音量图标不见了如何解决
  18. 哪些晦涩难懂的shell命令都是什么的缩写?
  19. 各个操作系统的命令行窗口的样式
  20. 企业所得税汇总纳税信息报告网上办理操作指南

热门文章

  1. python运行错误怎么查找_求助,python的二分法查找,按照视频上的代码写下来,结果运行错误...
  2. 设备漏电对计算机影响,电脑机箱漏电对电脑有影响吗
  3. Red Hat Linux 安装教程
  4. 微信小程序日期相减得出天数
  5. iOS 开发者账号 到期续费问题
  6. 半透明遮罩层覆盖整个可视区域
  7. 从理论到实践 全面理解HTTP/2
  8. spring boot 2.0 源码分析(二)
  9. 电子文件归档为什么非云不可
  10. 【独家】深入浅出话AI:定义和主要研究方法