400 likes | 796 Views
第七章 VLAN 实现. 本章目标. 通过本章的学习,您应该掌握以下内容 : 配置一个 VLAN 配置 VTP ( VLAN Trunking Protocol) 协议 配置交换机的主干连接功能 确认 VLAN 的连接性 确认生成树( spanning-tree) 是否运行. VLAN 综述. 分段 灵活性 安全性. 第三层. 第二层. 第一层. 销售部. 工程部. 人力资源部. 一个 VLAN = 一个广播域 = 逻辑网段 ( 子网 ). VLAN 运作. 交换机 A. 红色 VLAN. 黑色 VLAN. 绿色 VLAN.
E N D
本章目标 通过本章的学习,您应该掌握以下内容: • 配置一个VLAN • 配置VTP (VLAN Trunking Protocol)协议 • 配置交换机的主干连接功能 • 确认VLAN的连接性 • 确认生成树(spanning-tree)是否运行
VLAN综述 • 分段 • 灵活性 • 安全性 第三层 第二层 第一层 销售部 工程部 人力资源部 一个VLAN =一个广播域 = 逻辑网段 (子网)
VLAN运作 交换机 A 红色 VLAN 黑色 VLAN 绿色 VLAN • 每个逻辑的VLAN就象一个独立的物理桥
VLAN运作 交换机A 交换机B 红色 VLAN 黑色 VLAN 绿色 VLAN 红色 VLAN 黑色 VLAN 绿色 VLAN • 每个逻辑的VLAN就象一个独立的物理桥 • 同一个VLAN可以跨越多个交换机
VLAN运作 交换机A 交换机B 主干连接 快速以太网 红色 VLAN 黑色 VLAN 绿色 VLAN 红色 VLAN 黑色 VLAN 绿色 VLAN • 每个逻辑的VLAN就象一个独立的物理桥 • 同一个VLAN可以跨越多个交换机 • 主干功能支持多个VLAN的数据
VLAN的成员模式 静态VLAN 动态VLAN 主干连接 端口 e0/4 端口 e0/9 VLAN5 VLAN10 VLAN成员策略服务器 1111.1111.1111 = vlan 10 MAC = 1111.1111.1111
ISL标识 ISL的主干功能使得VLAN信息可以穿越主干线 • 通过硬件(ASIC)实现 • ISL标识不会出现在工作站,客户端并不知道ISL的封装信息 • 在交换机或路由器与交换机之间,在交换机与具有ISL网卡的服务器之间可以实现 进入主干线前加上VLAN标识 ISL支持VLAN的标识 离开主干线后去掉VLAN标识
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控制位
VTP协议(VLAN Trunking Protocol ) • 一个能够宣告VLAN配置信息的信息系统 • 通过一个共有的管理域,维持VLAN配置信息的一致性 • VTP只能在主干端口发送要宣告的信息 • 支持混合的介质主干连接(快速以太网, FDDI, ATM) VTP 域 “ICND” 3.同步最新的vlan信息 2 1.“新增一个vlan”
VTP模式 • 创建vlan • 修改vlan • 删除vlan • 发送/转发信息宣告 • 同步 • 存贮于NVRAM 服务器模式 • 发送/转发 信息宣告 • 同步 • 不会存贮于NVRAM • 创建vlan • 修改vlan • 删除vlan • 转发信息宣告 • 不同步 • 存贮于NVRAM 客户模式 透明模式
VTP是如何工作的 • VTP信息宣告以多点传送的方式来进行 • VTP服务器和客户模式下会同步最新版本的宣告信息 • VTP信息宣告每隔5分钟或者有变化时发生
VTP是如何工作的 • VTP信息宣告以多点传送的方式来进行 • VTP服务器和客户模式下会同步最新版本的宣告信息 • VTP信息宣告每隔5分钟或者有变化时发生 1.新增VLAN 2.版本3 -->版本4 服务器 3 3 4.版本3 -->版本4 5.同步新的VLAN信息 4.版本3 -->版本4 5.同步新的VLAN信息 客户 客户
VTP裁减 • 通过阻止不必要数据的泛洪传送来增加可用的带宽 • 例如: 主机A发出广播,广播仅仅泛洪到已有端口被分配到红色VLAN的所有交换机 端口 2 B 交换机4 被泛洪的数据在 这些地方被阻止 交换机2 红色VLAN 交换机5 端口 1 A 交换机6 交换机3 交换机 1
VLAN配置的原则 • 支持的最大VLAN数取决于交换机 • Catalyst 1900系列交换最大支持64个VLAN,每个VLAN可以有其独立的生成树 • VLAN1是出厂缺省设置的VLAN之一 • CDP和VTP宣告被发送到VLAN1 • Catalyst 1900系列交换机的IP地址作用于VLAN1的广播域中 • 只有在VTP的服务器或透明模式下才可以创建、增加或删除VLAN
VLAN配置的步骤 • 启用VTP (可选) • 启用主干功能 • 创建VLAN • 将端口加入VLAN
VTP 配置的内容 • VTP域名 • VTP模式 (服务器/客户/透明)—VTP服务器模式是缺省值 • VTP裁减 • VTP密码 • VTP捕取 注意:当加入一新的交换机到一个已经存在的VTP域时,这个交换机会被以客户模式加入,以便防止该交换机宣告不正确的VLAN信息 可以用命令delete vtp来复位VTP的版本号
创建VTP域 wg_sw_a(config)# vtp [server | transparent] [domain domain-name] [trap {enable | disable}] [password password] [pruning {enable | disable}
创建VTP域 wg_sw_a(config)# vtp [server | transparent] [domain domain-name] [trap {enable | disable}] [password password] [pruning {enable | disable} wg_sw_a#conf terminal Enter configuration commands, one per line. End with CNTL/Z wg_sw_a(config)#vtp transparent wg_sw_a(config)#vtp domain switchlab
确认VTP配置 wg_sw_a#show vtp
确认VTP配置 wg_sw_a#show vtp wg_sw_a#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
设置主干功能 wg_sw_a(config-if)# trunk [on | off | desirable | auto | nonegotiate] • On = 打开主干功能并与对方协商执行 • Off = 关闭主干功能并与对方协商执行 • Desirable = 与对方协商执行 如果对方设为on、desirable或auto则打开主干功能 • Auto = 只有对方设为on或desirable时才打开主干功能 • Non-negotiate =打开主干功能并不再与对方协商执行
设置主干功能 wg_sw_a(config-if)# trunk [on | off | desirable | auto | nonegotiate] • On = 打开主干功能并与对方协商执行 • Off = 关闭主干功能并与对方协商执行 • Desirable = 与对方协商执行 如果对方设为on、desirable或auto则打开主干功能 • Auto = 只有对方设为on或desirable时才打开主干功能 • Non-negotiate =打开主干功能并不再与对方协商执行 wg_sw_a#conf terminal Enter configuration commands, one per line. End with CNTL/Z wg_sw_a(config)#interface f0/26 wg_sw_a(config-if)#trunk on 首先打开端口的主干功能(端口 A)
确认主干功能 wg_sw_a#show trunk [A | B]
确认主干功能 wg_sw_a#show trunk [A | B] wg_sw_a#show trunk a DISL state: On, Trunking: On, Encapsulation type: ISL
创建一个VLAN wg_sw_a(config)# vlan vlan# [name vlan-name]
创建一个VLAN wg_sw_a(config)# vlan vlan# [name vlan-name] wg_sw_a#conf terminal Enter configuration commands, one per line. End with CNTL/Z wg_sw_a(config)#vlan 9 name switchlab2
确认一个VLAN wg_sw_a#show vlan [vlan#]
确认一个VLAN wg_sw_a#show vlan [vlan#] wg_sw_a#sh 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 --------------------------------------------------------------------------------------------------------
修改一个VLAN的名称 wg_sw_a(config)# vlan vlan# name vlan-name wg_sw_a#conf terminal Enter configuration commands, one per line. End with CNTL/Z wg_sw_a(config)#vlan 9 name switchlab90 wg_sw_a#show vlan 9 VLAN Name Status Ports ------------------------------------------------ 9 switchlab90 Enabled ------------------------------------------------
分配交换机的端口到VLAN中 wg_sw_a(config-if)# vlan-membership {static {vlan#} | dynamic}
分配交换机的端口到VLAN中 wg_sw_a(config-if)# vlan-membership {static {vlan#} | dynamic} wg_sw_a#conf terminal Enter configuration commands, one per line. End with CNTL/Z wg_sw_a(config)#interface ethernet 0/8 wg_sw_a(config-if)#vlan-membership static 9
查看VLAN中的成员 wg_sw_a#show vlan-membership
查看VLAN中的成员 wg_sw_a#show vlan-membership wg_sw_a#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 注意:port 1=e0/1, port 2=e0/2 .....
确认生成树 wg_sw_a#show spantree {vlan number}
确认生成树 wg_sw_a#show spantree {vlan number} • wg_sw_a#show spantree 1 • VLAN1 is executing the IEEE compatible Spanning Tree Protocol • Bridge Identifier has priority 32768, address 0050.F037.DA00 • Configured hello time 2, max age 20, forward delay 15 • Current root has priority 0, address 00D0.588F.B600 • Root port is FastEthernet 0/26, cost of root path is 10 • Topology change flag not set, detected flag not set • Topology changes 53, last topology change occured 0d00h17m14s ago • Times: hold 1, topology change 8960 • hello 2, max age 20, forward delay 15 • Timers: hello 2, topology change 35, notification 2 • Port Ethernet 0/1 of VLAN1 is Forwarding • Port path cost 100, Port priority 128 • Designated root has priority 0, address 00D0.588F.B600 • Designated bridge has priority 32768, address 0050.F037.DA00 • Designated port is Ethernet 0/1, path cost 10 • Timers: message age 20, forward delay 15, hold 1
可视化目标 wg_pc_a 10.2.2.12 SUBNET VLAN POD 10.1.1.0 1 wg_ro_x, wg_sw_x, core_sw_a 10.2.2.0 2 wg_pc_a, core_server 10.3.3.0 3 wg_pc_b, core_server 10.4.4.0 4 wg_pc_c, core_server 10.5.5.0 5 wg_pc_d, core_server 10.6.6.0 6 wg_pc_e, core_server 10.7.7.0 7 wg_pc_f, core_server 10.8.8.0 8 wg_pc_g, core_server 10.9.9.0 9 wg_pc_h, core_server 10.10.10.0 10 wg_pc_i, core_server 10.11.11.0 11 wg_pc_j, core_server 10.12.12.0 12 wg_pc_k, core_server 10.13.13.0 13 wg_pc_l, core_server VLAN2 fa0/26 (port A) e0/1 e0/2 e0 wg_sw_a 10.1.1.10 wg_ro_a 10.1.1.11 wg_pc_l 10.13.13.12 VLAN13 fa0/26 (port A) e0/1 e0/2 e0 wg_ro_l 10.1.1.121 wg_sw_l 10.1.1.120 ... ISL ISL fa0/1 fa0/12 fa0/24 core_ server 10.x.x.1 ISL core_sw_a 10.1.1.2
可视化目标 wg_pc_a 10.2.2.12 VLAN2 SUBNET VLAN POD 10.1.1.0 1 wg_ro_x, wg_sw_x, core_sw_a, core_sw_b 10.2.2.0 2 wg_pc_a, core_server 10.3.3.0 3 wg_pc_b, core_server 10.4.4.0 4 wg_pc_c, core_server 10.5.5.0 5 wg_pc_d, core_server 10.6.6.0 6 wg_pc_e, core_server 10.7.7.0 7 wg_pc_f, core_server 10.8.8.0 8 wg_pc_g, core_server 10.9.9.0 9 wg_pc_h, core_server 10.10.10.0 10 wg_pc_i, core_server 10.11.11.0 11 wg_pc_j, core_server 10.12.12.0 12 wg_pc_k, core_server 10.13.13.0 13 wg_pc_l, core_server fa0/26 (port A) fa0/27 (port B) e0/1 wg_sw_a 10.1.1.10 wg_pc_l 10.13.13.12 VLAN13 fa0/26 (port A) fa0/27 (port B) e0/1 wg_sw_l 10.1.1.120 ... ... ISL ISL ISL ISL fa0/12 fa0/12 fa0/1 fa0/1 fa0/13 fa0/13 fa0/24 ISL fa0/14 ISL fa0/14 core_ server core_sw_a 10.1.1.2 core_sw_b 10.1.1.4 10.x.x.1
通过本章的学习,您应该掌握以下内容: 配置VLAN 配置VTP 配置Trunk 确认生成树的运行状况 本章总结
1. 有哪三种VTP工作模式? 2. VTP信息宣告在哪类端口上可以发送? 3. VLAN ID 在 ________ 头中得到支持? 4. 如何将一个端口加入到某个VLAN中? 问题回顾