VLAN和生成树协议讲义(ppt 76页).ppt_第1页
VLAN和生成树协议讲义(ppt 76页).ppt_第2页
VLAN和生成树协议讲义(ppt 76页).ppt_第3页
VLAN和生成树协议讲义(ppt 76页).ppt_第4页
VLAN和生成树协议讲义(ppt 76页).ppt_第5页
已阅读5页,还剩71页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Lesson 6,VLAN和生成树协议,学习提纲,6.1VLAN操作介绍 6.2VTP(VLAN Trunk Protocol) 6.3配置VLAN 6.4在VLAN中使用生成树协议, 2004 Cisco Systems, Inc. All rights reserved.,ICND v2.22-3,06 VLAN和生成树协议,6.1 VLAN操作介绍,VLAN = Broadcast Domain = Logical Network (Subnet),6.1.1VLAN概述,Segmentation,Flexibility,Security,每个VLAN向物理网桥一样独立工作;通信只能在同

2、一VLAN中进行(限制单播、组播和广播); VLAN能够跨越多个交换机时; 中继链路(Trunk)能够携带多个VLAN的流量; Trunk使用特定的封装去区分不同的VLAN. 交换机为每一个不同的VLAN维护一张不同的MAC地址表 当交换机收到一个帧无法在MAC地址表中寻址的时候,交换机将把帧Flood(洪泛)到所有与源MAC地址所在同一VLAN端口和Trunk端口,除源端口。,6.1.2VLAN操作,6.1.3VLAN成员模式,静态VLAN:基于端口手工配置 动态VLAN:使用VLAN管理策略服务器(VMPS),6.1.4中继/主干链路(Trunk Link),访问链路(Access Lin

3、k):VLAN内部的链路,它只假定是广播域的一部分,帧在发到一个访问链路之前要删除所有的VLAN信息。 中继链路(Trunk Link):可以是单个端口也可以是多个VLAN的一部分,可承载多个VLAN信息。Trunk端口带宽必须是100Mbps以上。,IEEE 802.1Q Trunk,802.1Q帧,本征VLAN (Native VLAN),ISL是Cisco专用协议,用于封装和中继VLAN的流量 ISL接口必须至少支持100M bit/s速率,推荐使用全双工模式 ISL由ASIC硬件完成,拥有更高的性能 ISL工作在OSI模型的第二层上,封装时增加新的数据头和CRC,ISL trunk能够

4、使VLAN穿越主干(backbone),ISL Trunk,ISL封装, 2004 Cisco Systems, Inc. All rights reserved.,ICND v2.22-16,06 VLAN和生成树协议,6.2 VLAN Trunk Protocol(VTP),VTP是一个二层协议,用于在网络中维护VLAN的配置信息(添加、删除和更改); 使用VTP,可以保持VLAN配置的一致性; 一个以上共享VTP域名的相互连接的交换机构成一个VTP域; 仅在干道上传送VTP通告信息。,6.2.1VTP特点,6.2.2VTP的工作模式,VTP通告以组播方式发送 VTP服务器和客户机通过VT

5、P修订号进行信息同步 每5分钟或者当VLAN配置变化时发送VTP通告 Note: VTP透明模式交换机的通告的修订号总是0,6.2.3VTP操作,6.2.4VTP修剪(Pruning), 2004 Cisco Systems, Inc. All rights reserved.,ICND v2.22-21,06 VLAN和生成树协议,6.3 配置VLAN,6.3.1VLAN配置指南,支持的VLAN数量取决于交换机型号 大部分Catalyst桌面交换机支持64个VLAN CDP和VTP通告在VLAN 1上传输 交换机的IP地址设置在管理VLAN上(默认为VLAN 1) 只有处于服务器和透明模式的

6、交换机可以添加、删除VLAN 2950交换机可以支持250个VLAN,1增加一个VLAN,Catalyst 2950 Series,Switch#configure terminal Switch(config)#vlan 2 Switch(config-vlan)#name VLAN2,wg_sw_a(config-vlan)#name vlan-name,wg_sw_a#configure terminal wg_sw_a(config)#vlan 2 wg_sw_a(config-vlan)#name switchlab2,2划分交换机的端口到VLAN,Catalyst 2950 Ser

7、ies,wg_sw_2950(config-if)#switchport access vlan vlan# | dynamic,wg-sw_2950#configure terminal wg_sw_2950(config)#interface fastethernet 0/2 wg_sw_2950(config-if)#switchport access vlan 2 wg_sw_2950#sh vlan VLAN Name Status Ports - - - - default active Fa0/1, Fa0/3, Fa0/4 . . . . . 2 vlan2 active Fa

8、0/2,3执行增加、移动、和改变VLAN,wg_sw_a(config)#vlan vlan-id wg_sw_a(config-vlan)#,Enters the privileged EXEC VLAN configuration mode Writes VLAN adds, moves, and changes to the vlan.dat file,wg_sw_a(config-if)#switchport access vlan vlan#,Statically assigns a VLAN to a specific port,4检查VLAN,Catalyst 2950 Seri

9、es,wg_sw_2950#sh vlan id 2 VLAN Name Status Ports - - - - 2 switchlab99 active Fa0/2, Fa0/12 VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 - - - - - - - - - - - 2 enet 100002 1500 - - - - - 0 0 . . . wg_sw_2950#,wg_sw_2950#show vlan brief | id vlan-id | name vlan-name,wg_sw_29

10、50#show vlan brief VLAN Name Status Ports - - - - 1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4 2 vlan2 active 3 vlan3 active 4 vlan4 active 1002 fddi-default act/unsup 1003 token-ring-default act/unsup VLAN Name Status Ports - - - - 1004 fddinet-default act/unsup 1005 trnet-default act/unsup,wg_sw_29

11、50#show vlan brief,检查VLAN的成员关系,wg_sw_2950#show interfaces interface switchport,6.3.2配置Trunk Link,1配置802.1Q Trunk,wg_sw_a(config-if)#switchport mode trunk,Configures the port as a VLAN trunk,Note: 2950交换机只支持802.1Q封装类型,wg_sw_a(config-if)#switchport trunk encapsulation dot1q,2配置ISL Trunk,wg_sw_4000(con

12、fig)# interface fastethernet | gigabitethernet slot/port,选择一个将要被配置为Trunk的端口,wg_sw_4000(config-if)# shutdown,(可选项)关闭端口,阻止流量通过,直到配置完成,wg_sw_4000(config-if)# switchport trunk encapsulation isl | dot1q | negotiate,(可选项)配置特定的封装。,wg_sw_4000(config-if)# switchport mode dynamic auto | desirable | trunk,配置接口

13、作为第二层Trunk,配置ISL Trunk实例,wg_sw_4000#configure terminal wg_sw_4000(config-if)#interface gigabitEthernet 2/24 wg_sw_4000(config-if)#shutdown wg_sw_4000(config-if)#switchport trunk encapsulation isl wg_sw_4000(config-if)#switchport mode trunk wg_sw_4000(config-if)#no shutdown,Note: 不是所有的Catalyst系列交换机都支

14、持ISL,3检查Trunk,wg_sw_2950#show interfaces interface switchport | trunk,wg_sw_2950#show interfaces fa0/11 switchport Name: Fa0/11 Switchport: Enabled Administrative Mode: trunk Operational Mode: down Administrative Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default)

15、 Trunking Native Mode VLAN: 1 (default) . . .,wg_sw_2950#show interfaces fa0/11 trunk Port Mode Encapsulation Status Native vlan Fa0/11 desirable 802.1q trunking 1 Port Vlans allowed on trunk Fa0/11 1-4094 Port Vlans allowed and active in management domain Fa0/11 1-13,6.3.3 VLAN之间的路由,通过三层设备(如路由器,三层交

16、换机)可以实现VLAN之间的路由,单臂路由(Router on a stick),将一个物理接口划分成多个逻辑子接口(Sub-interface)来实现VLAN之间的路由叫单臂路由( Router on a stick ),1使用ISL Trunk实现VLAN之间的路由,2使用802.1Q实现VLAN之间的路由,VLAN之间路由配置 实例1,2950#config t 2950(config)#int f0/1 2950(config-if)#switchport mode trunk 2950(config-if)#int f0/2 2950(config-if)#switchport ac

17、cess vlan 1 2950(config-if)#int f0/3 2950(config-if)#switchport access vlan 2,2950(config)#int vlan 1 2950(config-if)#ip address 172.16.10.2 255.255.255.128 2950(config-if)#no shutdown,Router#config t Router(config)#int f0/0 Router(config-if)#no ip address Router(config-if)#no shutdown Router(config

18、-if)#int f0/0.1 Router(config-subif)#encapsulation dot1q 1 Router(config-subif)#ip address 172.16.10.1 255.255.255.128 Router(config-subif)#int f0/0.2 Router(config-subif)#encapsulation dot1q 2 Router(config-subif)#ip address 172.16.10.254 255.255.255.128,VLAN之间路由配置 实例2,2950#config t 2950(config)#in

19、t f0/1 2950(config-if)#switchport mode trunk 2950(config-if)#int f0/2 2950(config-if)#switchport access vlan 1 2950(config-if)#int f0/3 2950(config-if)#switchport access vlan 1 2950(config-if)#int f0/4 2950(config-if)#switchport access vlan 3 2950(config-if)#int f0/5 2950(config-if)#switchport acces

20、s vlan 3 2950(config-if)#int f0/6 2950(config-if)#switchport access vlan 2,VLAN之间路由配置 实例2(续),VLAN 1: 192.168.10.16/28 VLAN 2: 192.168.10.32/28 VLAN 3: 192.168.10.48/28,Router#config t Router(config)#int f0/0 Router(config-if)#no ip address Router(config-if)#no shutdown Router(config-if)#int f0/0.1 R

21、outer(config-subif)#encapsulation dot1q 1 Router(config-subif)#ip address 192.168.10.17 255.255.255.240 Router(config-subif)#int f0/0.2 Router(config-subif)#encapsulation dot1q 2 Router(config-subif)#ip address 192.168.10.33 255.255.255.240 Router(config-subif)#int f0/0.3 Router(config-subif)#encaps

22、ulation dot1q 3 Router(config-subif)#ip address 192.168.10.49 255.255.255.240,VTP domain name VTP mode (server, client, or transparent); server mode is default VTP pruning VTP password VTP version,当添加一个新的交换机到当前域中时要小心。为阻止一个新添加的交换机去通告一个错误的VLAN信息。应该将新添加的交换机的工作模式改变为透明模式(Transparent Mode),使其VTP修订号( revis

23、ion number )重置为0,6.3.4VTP配置指南,1创建一个VTP Domain,Catalyst 2950 Series,wg_sw_2950#config terminal wg_sw_2950(config)#vtp mode server | client | transparent wg_sw_2950(config)#vtp domain domain-name wg_sw_2950(config)#vtp password password wg_sw_2950(config)#vtp pruning wg_sw_2950(config)#end,VTP配置实例,Swi

24、tch(config)#vtp domain ICND Changing VTP domain name to ICND Switch(config)#vtp mode transparent Setting device to VTP TRANSPARENT mode. Switch(config)#end Switch#show vtp status VTP Version : 2 Configuration Revision : 0 Maximum VLANs supported locally : 64 Number of existing VLANs : 17 VTP Operati

25、ng Mode : Transparent VTP Domain Name : ICND VTP Pruning Mode : Disabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0 x7D 0 x6E 0 x5E 0 x3D 0 xAF 0 xA0 0 x2F 0 xAA Configuration last modified by 10.1.1.4 at 3-3-93 20:08:05 Switch#,2检查VTP配置,wg_sw_2950#show vtp status,wg_sw_29

26、50#show vtp status VTP Version : 2 Configuration Revision : 0 Maximum VLANs supported locally : 64 Number of existing VLANs : 17 VTP Operating Mode : Server VTP Domain Name : ICND_lab VTP Pruning Mode : Disabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0 x7D 0 x6E 0 x5E 0

27、x3D 0 xAF 0 xA0 0 x2F 0 xAA Configuration last modified by 10.10.10.40 at 3-3-93 20:08:05,6.3.5交换机VLAN排错,Problem:两个设备不能通信,检查IP地址、子网掩码以及VLAN成员资格等设置是否正确; 如果主机与交换机接口在同一子网,检查交换机接口和主机所连接的端口是否在同一个VLAN中; 如果主机在不同子网,检查交换机的默认网关设置; 如果端口处于监听和学习状态,等端口转为转发状态再次尝试; 检查主机和交换机相应端口的双工和速率设置; 如果端口连接的设备是终端用户,启用portfast并禁用

28、trunk; 检查交换机是否学习到了主机的MAC地址。,Problem:设备不能通过Trunk建立连接,保证链路两端的Trunk设置是正确的 保证链路两端的封装类型一致 在802.1Q Trunk上,保证两端的本地VLAN是同一个,Problem: VTP不能正常更新配置,保证交换机之间的连接是在Trunk线路上; 保证交换机的VTP域名配置是一致的; 检查交换机VTP的模式; 如果设置了VTP密码,保证密码一致。, 2004 Cisco Systems, Inc. All rights reserved.,ICND v2.22-48,06 VLAN和生成树协议,6.4 在VLAN中使用生成树

29、协议,6.4.1生成树协议类型介绍,Spanning Tree Protocol(STP) Per VLAN Spanning Tree(PVST) Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP) MSTP is also known as Multi-Instance Spanning Tree Protocol (MISTP) on Cisco Catalyst 6500 switches and above Per VLAN

30、 Rapid Spanning Tree (PVRST),Root for Green VLAN,Root for Red VLAN,ISL Tagged Trunk,Allows control of forwarding paths on a subnet basis Creates flexible design tools for traffic management Provides simple techniques for Layer 2 redundancy,Forwarding Port for Red VLAN,Forwarding Port for Green VLAN,

31、Blocking Port for Green VLAN,Blocking Port for Red VLAN,1PVST( Per VLAN Spanning Tree,每VLAN生成树),Per VLAN Spanning Tree (Cont.),2PVST+,PVST+是Cisco交换机默认生成树类型; PVST+ 是 CISCO 解决在VLAN上处理生成树问题的另一个方案。PVST+ 允许 CST 信息传给 PVST,以便与其他厂商在 VLAN 上运行生成树的实现方法进行操作,STP Zone,IEEE文档,IEEE 802.1D - Media Access Control (MA

32、C) bridges IEEE 802.1Q- Virtual Bridged Local Area Networks IEEE 802.1w- Rapid Reconfiguration (Supp. to 802.1D) IEEE 802.1s- Multiple Spanning Tree (Supp. to 802.1Q),6.4.2Cisco生成树协议的增强型特征,端口快速(PortFast) 上行链路快速(UplinkFast) 主干快速(BackboneFast),1端口快速(PortFast),配置PortFast,在接口配置模式中配置PortFast:Switch(confi

33、g-if)# spanning-tree portfast 在全局模式下将所有非Trunk端口配置成PortFast:Switch(config)#spanning-tree portfast default 检查配置:Switch#show running-config Switch#show interface 接口,UplinkFast,最小化网络停工时间(Minimize network downtime) 交换机之间的连接小于5s收敛(UplinkFast is for fast spanning-tree uplink convergence in 5 seconds for in

34、ter-switch connections),New Forwarding Path for VLAN Red,Normal Forwarding Link,End-User PC,2上行链路快速(UplinkFast)?,UplinkFast,Enabling UplinkFast,Switch(config)#spanning-tree uplinkfast max-update-rate max_update_rate,Enables UplinkFast,Verifying UplinkFast,Switch# show spanning-tree uplinkfast Uplink

35、Fast is enabledStation update rate set to 150 packets/sec.UplinkFast statistics-Number of transitions via uplinkFast (all VLANs) :9Number of proxy multicast addresses transmitted (all VLANs) :5308Name Interface List- -VLAN1 Fa6/9(fwd), Gi5/7VLAN2 Gi5/7(fwd)VLAN3 Gi5/7(fwd)VLAN4VLAN5VLAN1002 Gi5/7(fw

36、d)VLAN1003 Gi5/7(fwd)VLAN1004 Gi5/7(fwd)VLAN1005 Gi5/7(fwd),Switch# show spanning-tree uplinkfast,Displays UplinkFast configuration information,3BackboneFast(主干快速),开启和检查BackboneFast,Switch#show spanning-tree backbonefast BackboneFast is enabled BackboneFast statistics-Number of transition via backbo

37、neFast (all VLANs) : 0Number of inferior BPDUs received (all VLANs) : 0Number of RLQ request PDUs received (all VLANs) : 0Number of RLQ response PDUs received (all VLANs) : 0Number of RLQ request PDUs sent (all VLANs) : 0Number of RLQ response PDUs sent (all VLANs) : 0,Switch(config)#spanning-tree b

38、ackbonefast,Enables BackboneFast,Switch#show spanning-tree backbonefast,Displays BackboneFast configuration information, 2004 Cisco Systems, Inc. All rights reserved.,07Configuring Catalyst Switch Operations,6.4.3 RSTP(快速生成树协议),1RSTP(Rapid Spanning Tree Protocol,快速生成树协议)概述,2RSTP 端口状态,3RSTP端口角色,4Edge

39、 Ports(边缘端口),永远不会是交换机连接到它; 马上转变成转发状态; 功能类似于PortFast 通过spanning-tree portfast命令配置,5RSTP链路类型,RSTP的链路类型分为共享链路和点到点链路; 链路类型是从端口的双工模式(duplex mode)自动获取的。 默认时,操作在全双工模式的端口被认为是点对点的,而操作在半双工模式的端口被认为是共享端口。,6RSTP BPDU中的Flag字段,7PVRST命令,Cisco不支持纯粹的RSTP,支持PVRST(Per VLAN Rapid-Spanning-tree,每VLAN快速生成树) Configuring spanning-tree mode rapid-pvst Verifying show spanning-tree vlan 101 Debugging debug spanning-tree,如何实现PVRST,检查PVRST,Display span

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论