1 / 44

第十一章 虚拟局域网

第十一章 虚拟局域网. VLAN 综述. 分段 灵活性 安全性. 第三层. 第二层. 第一层. 销售部. 工程部. 人力资源部. 一个 VLAN = 一个广播域 = 逻辑网段 ( 子网 ). VLAN 运作. 交换机 A. 红色 VLAN. 黑色 VLAN. 绿色 VLAN. 每个逻辑的 VLAN 就象一个独立的 物理桥 交换机上的每一个端口都可以分配给不同的 VLAN 默认的情况下,所有的端口都属于 VLAN1(Cisco). VLAN 运作. 交换机 A. 交换机 B. 红色 VLAN. 黑色 VLAN. 绿色

thetis
Download Presentation

第十一章 虚拟局域网

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第十一章虚拟局域网

  2. VLAN综述 • 分段 • 灵活性 • 安全性 第三层 第二层 第一层 销售部 工程部 人力资源部 一个VLAN =一个广播域 = 逻辑网段 (子网)

  3. VLAN运作 交换机 A 红色 VLAN 黑色 VLAN 绿色 VLAN • 每个逻辑的VLAN就象一个独立的物理桥 • 交换机上的每一个端口都可以分配给不同的VLAN • 默认的情况下,所有的端口都属于VLAN1(Cisco)

  4. VLAN运作 交换机A 交换机B 红色 VLAN 黑色 VLAN 绿色 VLAN 红色 VLAN 黑色 VLAN 绿色 VLAN • 每个逻辑的VLAN就象一个独立的物理桥 • 同一个VLAN可以跨越多个交换机

  5. VLAN运作 交换机A 交换机B 中继连接 快速以太网 红色 VLAN 黑色 VLAN 绿色 VLAN 红色 VLAN 黑色 VLAN 绿色 VLAN • 中继功能支持多个VLAN的数据 • 中继使用了特殊的封装格式支持不同的VLAN • 只有快速以太网端口可以配置为中继端口

  6. Switch A Red VLAN Black VLAN Green VLAN VLAN Trunk Switch B 中继连接 快速以太网 Red VLAN Black VLAN Green VLAN 交换机对帧进行VLAN标记有两种协议:ISL和802.1Q

  7. VLAN Trunk(cont.) VLAN中继:对于多个VLAN交换机来说,VLAN干线就是两个交换机之间的连接,它在两个或两个以上的VLAN之间传输通信。每个交换机必须确定它所收到的帧属于哪个VLAN。 一个交换机的任何端口都必须属于且只能属于一个VLAN,但当端口配置成trunk干线后,该端口就失去了它自身的VLAN标识,可以为该交换机内的所有VLAN传输数据。

  8. ISL标识(Cisco私有) ISL的中继功能使得VLAN信息可以穿越中继线 • 通过硬件(ASIC)实现 • ISL标识不会出现在工作站,客户端并不知道ISL的封装信息 • 在交换机或路由器与交换机之间,在交换机与具有ISL网卡的服务器之间可以实现 进入中继线前加上VLAN标识 ISL支持VLAN的标识 离开中继线后去掉VLAN标识

  9. VLAN BPDU ISL封装 CRC 4 bytes ISL 头 26 bytes 以太帧数据 DA Type User SA LEN AAAA03 HSA VLAN BPDU INDEX RES BPDU • 用ISL头与CRC进行帧封装 • 可以支持多个VLAN (1024) • VLAN号 • BPDU控制位

  10. ISL封装(cont.) DA Type User SA LEN AAAA03 HSA VLAN BPDU INDEX RES BPDU DA:目的地址,是一个组播地址,总是相同的40位01000C0000,告诉接收方该帧是ISL格式封装的。 TYPE:指明所封装祯的类型,以太网0000、令牌环网0001、FDDI网0010、ATM 0011 USER:用户自定义 SA:发送该ISL帧的交换机接口的48位MAC地址 LEN:ISL帧的长度 HSA:源地址高位,含生产商的ID和MAC源地址。以00000C开头。 VLAN:VLAN的ID号 BPDU:如果是STP帧就置该位的值。

  11. IEEE公共帧标记协议802.1Q 如果要跨越cisco交换机和其他厂商的交换机来建立多个VLAN,必须使用802.1Q协议 VLAN Tag added by incoming port 802.1Q VLAN identifier VLAN Tag stripped by forwarding port

  12. VLAN 间路由概述 Router on a stick ISL VLAN 2 VLAN 1 Application TCP IP 10.1.1.2 10.2.2.2 ISL Ethernet 网络层的设备使各个广播域之间可以互相通信 既可用单个路由器端口与交换机的trunk端口相连建立中继 也可以用多个路由器端口分别与每个VLAN相连,但浪费端口

  13. 创建一个VLAN Catalyst 1900 wg_sw_1900(config)#vlan vlan_# [name vlan_name] wg_sw_1900#configure terminal Enter configuration commands, one per line. End with CNTL/Z wg_sw_1900(config)#vlan 9 name switchlab2 Catalyst 2950 wg_sw_2950#vlan database wg_sw_2950(vlan)#vlan vlan_# [name vlan_name] wg_sw_2950#vlan databasewg_sw_ 2950(vlan)#vlan 9 name switchlab2wg_sw_ 2950(vlan)#exit

  14. 添加端口到VLAN Catalyst 1900 wg_sw_1900(config-if)#vlan-membership {static {vlan_#} | dynamic} wg_sw_1900#conf terminal Enter configuration commands, one per line. End with CNTL/Z wg_sw_1900(config)#interface ethernet 0/8 wg_sw_1900(config-if)#vlan-membership static 9 Catalyst 2950 wg_sw_2950(config-if)#switchport access vlan vlan_#

  15. 验证 VLAN Catalyst 1900 wg_sw_1900#show vlan [vlan_#] wg_sw_1900#show vlan 9 VLAN Name Status Ports ------------------------------------------------- 9 switchlab2 Enabled ------------------------------------------------- VLAN Type SAID MTU Parent RingNo BridgeNo Stp Trans1 Trans2 --------------------------------------------------------------------------- 9 Ethernet 100009 1500 0 1 1 Unkn 0 0 --------------------------------------------------------------------------- Catalyst 2950 wg_sw_2950#show vlan [id vlan_#]

  16. 验证 VLAN wg_sw_1900#show vlan-membership wg_sw_1900#show vlan-membership Port VLAN Membership Type Port VLAN Membership Type --------------------------- ------------------------------ 1 5 Static 13 1 Static 2 1 Static 14 1 Static 3 1 Static 15 1 Static 4 1 Static 16 1 Static 5 1 Static 17 1 Static 6 1 Static 18 1 Static 7 1 Static 19 1 Static 8 9 Static 20 1 Static Note: port 1=e0/1, port 2=e0/2 .....

  17. 验证 VLAN wg_sw_2950#show vlan brief wg_sw_2950#show vlan brief VLAN Name Status Ports ---- ------------------------ --------- ----------------------- 1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/11, Fa0/12, Fa0/13, Fa0/14, Fa0/15, Fa0/16, Fa0/17, Fa0/18, Fa0/19, Fa0/20, Fa0/21 5 VLAN5 active Fa0/3 9 VLAN9 active Fa0/22, Fa0/23 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active wg_sw_2950#show interfaces interface switchport

  18. 配置实例

  19. 配置实例Cont. • 交换机Asuqa配置如下: • Asuqa#configure terminal • Enter configuration commands, one per line. End with CNTL/Z. • Asuqa(config)#vtp domain Aiko • Changing VTP domain name from NULL to Aiko • Asuqa(config)#vtp mode server • Device mode already VTP SERVER. • Asuqa(config)#vtp password Asuqa • Setting device VLAN database password to Asuqa • Asuqa(config)#end • Asuqa# • 交换机Aiko配置如下: • Aiko#configure terminal • Enter configuration commands, one per line. End with CNTL/Z. • Aiko(config)#vtp domain Aiko • Changing VTP domain name from NULL to Aiko • Aiko(config)#vtp mode client • Setting device to VTP CLIENT mode. • Aiko(config)#no vlan 2 • VTP VLAN configuration not allowed when device is in CLIENT mode. • Aiko(config)#vtp password Asuqa • Setting device VLAN database password to Asuqa • Aiko(config)#end • Aiko#

  20. 创建VTP域 Catalyst 1900 wg_sw_1900(config)#vtp [server | transparent | client] [domain domain-name] [trap {enable | disable}] [password password] [pruning {enable | disable}] wg_sw_1900#configure terminal Enter configuration commands, one per line. End with CNTL/Z wg_sw_1900(config)#vtp transparent wg_sw_1900(config)#vtp domain switchlab Catalyst 2950 wg_sw_2950#vlan database wg_sw_2950(vlan)#vtp [ server | client | transparent ] wg_sw_2950(vlan)#vtp domain domain-name wg_sw_2950(vlan)#vtp password password wg_sw_2950(vlan)#vtp pruning wg_sw_2950(vlan)#snmp-server enable traps vtp wg_sw_2950(vlan)#exit

  21. VTP 配置实例 wg_sw_1900(config)#vtp transparent wg_sw_1900(config)#vtp domain switchlab pruning enable wg_sw_1900(config)#exit wg_sw_1900#show vtp VTP version: 1 Configuration revision: 4 Maximum VLANs supported locally: 1005 Number of existing VLANs: 6 VTP domain name : switchlab VTP password : VTP operating mode : Transparent VTP pruning mode : Enabled VTP traps generation : Enabled Configuration last modified by: 0.0.0.0 at 00-00-0000 00:00:00 wg_sw_1900#config terminal wg_sw_1900(config)#interface f0/26 wg_sw_1900(config-if)#trunk on desirable wg_sw_1900(config-if)#exitwg_sw_1900(config)#exitwg_sw_1900#show trunk A DISL state: On, Trunking: On, Encapsulation type: ISL

  22. 验证VTP配置 wg_sw_1900#show vtp wg_sw_1900#show vtp VTP version: 1 Configuration revision: 4 Maximum VLANs supported locally: 1005 Number of existing VLANs: 6 VTP domain name : switchlab VTP password : VTP operating mode : Transparent VTP pruning mode : Enabled VTP traps generation : Enabled Configuration last modified by: 10.1.1.40 at 00-00-0000 00:00:00

  23. 验证VTP配置 wg_sw_2950#show vtp status wg_sw_2950#show vtp status VTP Version : 2 <--- Indicates v2-capable Configuration Revision : 4 Maximum VLANs supported locally : 68 Number of existing VLANs : 6 VTP Operating Mode : Server VTP Domain Name : switchlab VTP Pruning Mode : Enabled VTP V2 Mode : Disabled <--- Indicates v2 disabled; v1 set VTP Traps Generation : Disabled <--- Catalyst 2950 default MD5 digest : 0x3D 0x02 0xD4 0x3A 0xC4 0x46 0xA1 0x03 Configuration last modified by 10.1.1.40 at 5-4-02 22:25:

  24. Configuring 802.1Q Trunking wg_sw_a(config-if)#switchport mode trunk • Configures the port as a VLAN trunk

  25. Configuring ISL Trunking wg_sw_1900(config-if)#trunk [on | off | desirable | auto | nonegotiate] • on = Set trunk on and negotiate with other side • off = Set trunk off and negotiate with other side • desirable = Negotiate with other side; trunk on if other side is on, desirable, or auto • auto = Will be a trunk only if the other side is on or desirable • nonnegotiate = Set trunk on and will not negotiate wg_sw_1900#conf terminal Enter configuration commands, one per line. End with CNTL/Z wg_sw_1900(config)#interface f0/26 wg_sw_1900(config-if)#trunk on First Trunk Port (Port A) • Note: The Catalyst 1900 only supports ISL encapsulation.

  26. Verifying a Trunk Catalyst 1900 wg_sw_1900#show trunk [A | B] wg_sw_1900#show trunk a DISL state: On, Trunking: On, Encapsulation type: ISL Catalyst 2950 wg_sw_2950#show interface interface switchport wg_sw_2950#show interface fa0/2 switchport Name: Fa0/2 Switchport: Enabled Administrative mode: trunk Operational Mode: trunk . . .

  27. Executing Adds, Moves, and Changes for VLANs wg_sw_a(config)#vlan database • Enters the vlan database privileged EXEC command to access VLAN configuration mode • Writes VLAN adds, moves, and changes to the vlan.dat file wg_sw_a(config)#vlan vlan-id mtu mtu-size • Identifies a VLAN and changes the MTU size

  28. Troubleshooting Switched LANs

  29. 配置实例Cont. • 交换机Asuqa配置如下: • Asuqa#configure terminal • Enter configuration commands, one per line. End with CNTL/Z. • Asuqa(config)#vlan 2 • Asuqa(config-vlan)#name Sales • Asuqa(config-vlan)#vlan 3 • Asuqa(config-vlan)#name Tech • Asuqa(config-vlan)#interface f0/2 • Asuqa(config-if)#switchport mode access • Asuqa(config-if)#switchport access vlan 2 • Asuqa(config-if)#no shutdown • Asuqa(config-if)#interface f0/3 • Asuqa(config-if)#switchport mode access • Asuqa(config-if)#switchport access vlan 3 • Asuqa(config-if)#no shutdown • Asuqa(config-if)#interface f0/1 • Asuqa(config-if)#switchport trunk encapsulation dot1q • Asuqa(config-if)#switchport mode trunk • Asuqa(config-if)#no shutdown • Asuqa(config-if)#end • Asuqa#

  30. 配置实例Cont. • 交换机Aiko配置如下: • Aiko#configure terminal • Enter configuration commands, one per line. End with CNTL/Z. • Aiko(config)#vlan 2 • Aiko(config-vlan)#name Sales • Aiko(config-vlan)#vlan 3 • Aiko(config-vlan)#name Tech • Aiko(config-vlan)#interface f0/3 • Aiko(config-if)#switchport mode access • Aiko(config-if)#switchport access vlan 2 • Aiko(config-if)#no shutdown • Aiko(config-if)#interface f0/5 • Aiko(config-if)#switchport mode access • Aiko(config-if)#switchport access vlan 3 • Aiko(config-if)#no shutdown • Aiko(config-if)#interface f0/24 • Aiko(config-if)#switchport trunk encapsulation dot1q • Aiko(config-if)#switchport mode trunk • Aiko(config-if)#no shutdown • Aiko(config-if)#end • Aiko#

  31. 配置实例Cont. • Asuqa#show vlan brief • VLAN Name Status Ports • ---- -------------------------------- --------- ------------------------------- • 1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/7 • Fa0/8, Fa0/9, Fa0/10, Fa0/11 • Fa0/12, Fa0/13, Fa0/14, Fa0/15 • Fa0/16, Fa0/17, Fa0/18, Fa0/19 • Fa0/20, Fa0/21, Fa0/22, Fa0/23 • Gi0/1, Gi0/2 • 2 Sales active Fa0/2 • 3 Tech active Fa0/3 • 1002 fddi-default act/unsup • 1003 token-ring-default act/unsup • 1004 fddinet-default act/unsup • 1005 trnet-default act/unsup • Asuqa#

  32. 配置实例Cont. • Aiko#show vlan brief • VLAN Name Status Ports • ---- -------------------------------- --------- ------------------------------- • 1 default active Fa0/1, Fa0/2, Fa0/4, Fa0/6 • Fa0/7, Fa0/8, Fa0/9, Fa0/10 • Fa0/11, Fa0/12, Fa0/13, Fa0/14 • Fa0/15, Fa0/16, Fa0/17, Fa0/18 • Fa0/19, Fa0/20, Fa0/21, Fa0/22 • Fa0/23, Gi0/1, Gi0/2 • 2 Sales active Fa0/3 • 3 Tech active Fa0/5 • 1002 fddi-default act/unsup • 1003 token-ring-default act/unsup • 1004 fddinet-default act/unsup • 1005 trnet-default act/unsup

  33. VTP协议(VLAN Trunking Protocol ) • 一个能够宣告VLAN配置信息的信息系统 • 通过一个共有的管理域,维持VLAN配置信息的一致性 • VTP只能在中继端口发送要宣告的信息 • 支持混合的介质中继连接(快速以太网, FDDI, ATM) VTP 域 “vlan_ domain” 3.同步最新的vlan信息 2 1.“新增一个vlan”

  34. VTP模式 • 创建vlan • 修改vlan • 删除vlan • 发送/转发信息宣告 • 同步 • 存贮于NVRAM Catalyst switches 上默认的VTP模式是服务器模式,这样在向VLAN中增加一台交换机时必须注意这一点。 服务器模式 • 创建vlan • 修改vlan • 删除vlan • 转发信息宣告 • 不同步 • 存贮于NVRAM • 发送/转发 信息宣告 • 同步 • 不会存贮于NVRAM 客户模式 透明模式

  35. VTP是如何工作的 • VTP信息宣告以多点传送的方式来进行 • VTP服务器和客户模式下会同步最新版本的宣告信息 • VTP信息宣告每隔5分钟或者有变化时发生

  36. VTP是如何工作的 • VTP信息宣告以多点传送的方式来进行 • VTP服务器和客户模式下会同步最新版本的宣告信息 • VTP信息宣告每隔5分钟或者有变化时发生 1.新增VLAN 2.版本3 -->版本4 服务器 3 3 4.版本3 -->版本4 5.同步新的VLAN信息 4.版本3 -->版本4 5.同步新的VLAN信息 客户 客户

  37. VTP配置步骤 • 1.全局配置模式下,定义VTP模式: • Switch(config)#vtp mode {server|client|transparent} • 2.定义VTP域名,在同一VLAN管理域的交换机的VTP域名必须相同.该域名长度为1到32字符: • Switch(config)#vtp domain {domain-name} • 3.设置VTP域的密码,同一VTP域里的交换机的VTP域的密码必须一致,密码长度为8到64字符.可选: • Switch(config)#vtp password {password}

  38. 配置实例

More Related