交换和VLAN.ppt

上传人:少林足球 文档编号:4146130 上传时间:2019-10-23 格式:PPT 页数:21 大小:505KB
返回 下载 相关 举报
交换和VLAN.ppt_第1页
第1页 / 共21页
交换和VLAN.ppt_第2页
第2页 / 共21页
交换和VLAN.ppt_第3页
第3页 / 共21页
交换和VLAN.ppt_第4页
第4页 / 共21页
交换和VLAN.ppt_第5页
第5页 / 共21页
点击查看更多>>
资源描述

《交换和VLAN.ppt》由会员分享,可在线阅读,更多相关《交换和VLAN.ppt(21页珍藏版)》请在三一文库上搜索。

1、第六讲:实验二 交换和VLAN,教学目标(Objectives ),1. 交换机学习主机地址 (Switche Learn Host Address) 2. 两种交换方法(Two Switching Methods) 3. 配置端口安全(Configuring Port Security) 4.密码破解(Password Recovery) 5. VLAN操作(VLAN Operations) 6.配置和验证静态VLAN (Configuring and Verifying Static VLANs),地址学习(Address learning) 决定转发或过滤(Forward/filter

2、decision) 避免环路(Loop avoidance),交换机三种功能 (Three Switch Functions ),交换机学习主机地址 (Switche Learn Host Address),初始MAC地址表是空的 Initial MAC address table is empty,MAC address table,0260.8c01.1111,0260.8c01.2222,0260.8c01.3333,0260.8c01.4444,E0,E1,E2,E3,A,B,C,D,交换机学习主机地址 (Switche Learn Host Address),A向C发送帧(Stati

3、on A sends a frame to Station C) 交换机将A的MAC地址和其对应的接口E0放入MAC地址表 该帧向除了E0接口的所有接口泛洪,MAC address table,0260.8c01.1111,0260.8c01.2222,0260.8c01.3333,0260.8c01.4444,E0: 0260.8c01.1111,E0,E1,E2,E3,D,C,B,A,交换机学习主机地址 (Switche Learn Host Address),D向C发送帧(Station D sends a frame to station C) 交换机将D的MAC地址和其对应的接口E3

4、放入MAC地址表 该帧向除了E3接口的所有接口泛洪,MAC address table,0260.8c01.1111,0260.8c01.2222,0260.8c01.3333,0260.8c01.4444,E0: 0260.8c01.1111,E3: 0260.8c01.4444,E0,E1,E2,E3,D,C,A,B,交换机过滤帧 ( Switches Filter Frames),A向C发送帧 目的地址已知,帧不被泛洪,E0: 0260.8c01.1111,E2: 0260.8c01.2222,E1: 0260.8c01.3333,E3: 0260.8c01.4444,0260.8c01

5、.1111,0260.8c01.2222,0260.8c01.3333,0260.8c01.4444,E0,E1,E2,E3,X,X,D,C,A,B,MAC address table,两种交换方法 (Two Switching Methods),存储转发特征(Store-and-forward Feature) 在转发之前整个帧被接收 由于交换开始之前要接收完整帧,较大的数据帧延迟较大 直通特征(Cut-through Feature) 在接收完整帧之前,帧就被转发。 最快的是只要读到目的地址就转发。 这种模式降低了延迟,但是不进行检错,交换要机的基本配置,配置主机名(全局配置模式下) Sw

6、itch(config)#hostname 交换机名 配置密码(全局配置模式下) Switch(config)#enable password 密码(明文) Switch(config)#enable secret 密码(密文) 查看配置情况 Switch#show running-configuration Switch#show version,配置交换机的IP地址,进入交换机的管理子网 (VLAN1为默认的交换机的管理子网,交换机的IP地址只能配置给管理子网) Switch(config)#interface vlan 1 Switch(config-if)#ip address IP地

7、址 子网掩码 Switch(config-if)#no shutdown 测试交换机IP地址的正确性 Switch#ping 主机IP地址(已连接到交换机的主机) 注意不同的命令在不同的模式下使用,VLAN概述,分段Segmentation 灵活 Flexibility 安全 Security,3rd floor,2nd floor,1st floor,SALES,HR,ENG,1 VLAN =1广播域1逻辑子网 A VLAN = A broadcast domain = Logical network (subnet),VLAN操作(VLAN Operations),每一个逻辑的VLAN就像

8、一个独立的物理网桥 同一个VLAN可以跨越多个交换机,VLAN操作(VLAN Operations),Trunk,TRUNK链路携带多个VLAN的数据 Trunks利用特定的封装来识别不同的VLAN,Fast Ethernet,VLAN成员模式 (VLAN Membership Modes),VLAN5,静态VLAN (Static VLAN),动态VLAN(Dynamic VLAN),MAC = 1111.1111.1111,Trunk,VMPS 1111.1111.1111 = vlan 10,VLAN10,Port e0/9,Port e0/4,配置静态VLAN,1.创建VLAN Swi

9、tch#vlan database Switch(vlan)#vlan vlan_number Switch(vlan)#exit 2.将接口指定到VLAN中 Switch(config)#interface F0/9 Switch(config-if)#switchport access vlan vlan_number (将端口划分为指定的VLAN) 显示VLAN信息 Switch# show vlan,实现VLAN内的通信,配置指定端口为Trunk模式 Switch(config)#interface F0/23 switch1(config-if)# switchport mode t

10、runk switch1(config-if)#switchport trunk allowed vlan 2 switch1(config-if)# switchport mode trunk 1号交换机的F24端口配置为TRUNK switch2(config-if)#switchport trunk allowed vlan 2 switch1(config-if)# switchport mode trunk 2号交换机的F24端口配置为TRUNK,配置静态VLAN实例 (Configuring Static VLANs Example),Switch#vlan database Sw

11、itch(vlan)#vlan 2 name v2 VLAN 2 added: Name: v2 Switch(vlan)#vlan 3 name v3 VLAN 3 added: Name: v3 Switch(vlan)#vlan 4 name v4 VLAN 4 modified: Name: v4 Switch(vlan)#no vlan 4 Deleting VLAN 4. Switch(vlan)#exit APPLY completed. Exiting,Switch(config)#int f0/2 Switch(config-if)#switchport mode acces

12、s Switch(config-if)#switchport access vlan 2 Switch(config-if)#int f0/3 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 3 Switch(config-if)#end,验证静态VLAN配置 (Verifying Static VLANs Configuration),Switch#sh vlan brie VLAN Name Status Ports - - - - 1 default active Fa0/

13、1, Fa0/4, Fa0/5, Fa0/6 Fa0/7, Fa0/8, Fa0/9, Fa0/10 Fa0/11, Fa0/12 2 v2 active Fa0/2 3 v3 active Fa0/3 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active Switch#,密码破解(Password Recovery),1. 拔掉电源(Unplug the power cable) 2.按下mode按钮(hold down the

14、 mode button) 3.输入flash_init (type flash_init) 4.执行dir flash: (type dir flash:) 5.重命名配置文件 (rename flash:config.text flash:config.old) 6.启动(Boot) 7.在进入setup模式提示下输入N (enter N at the prompt to start the setup program.),密码破解(Password Recovery),8. 进入特权模式(switchenable) 9. 重命名配置文件 (rename flash:config.old flash:config.text) 10. 将配置文件拷贝到RAM中运行 (copy flash:config.text system:running-config) 11.修改密码 (enable password cisco) 12.存盘(write) 13.重启(reload),思考题(Questions),1. 交换机三种主要的功能是什么? 2. 交换机怎样学习主机地址? 3.交换机有哪两种数据转发方式?各有什么特点? 4. 简述交换机密码破解的步骤? 5. 什么是VLAN?,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1