教案——二层交换机端口与MAC地址的绑定.doc

上传人:豆**** 文档编号:17614066 上传时间:2022-05-25 格式:DOC 页数:13 大小:360KB
返回 下载 相关 举报
教案——二层交换机端口与MAC地址的绑定.doc_第1页
第1页 / 共13页
教案——二层交换机端口与MAC地址的绑定.doc_第2页
第2页 / 共13页
点击查看更多>>
资源描述

《教案——二层交换机端口与MAC地址的绑定.doc》由会员分享,可在线阅读,更多相关《教案——二层交换机端口与MAC地址的绑定.doc(13页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、【精品文档】如有侵权,请联系网站删除,仅供学习与交流教案二层交换机端口与MAC地址的绑定章节名称二层交换机上的端口与MAC绑定计划学时2课时教学目标1、了解什么是交换机的MAC绑定功能; 2、熟练掌握MAC与端口绑定的静态、动态方式。设计思路通过模拟构建的工作场景,使学生能够以工作过程的形式进行学习。教学环节教学内容、所用时间、教师活动、学生活动引入新课在日常工作中,经常会发生用户随意插拔交换机上的网线,给网管员在网络管理上带来一定的不便。同时也会出现在一个交换机端口下连接另一个Hub或交换机,导致网络线路的拥堵。当网络中某机器由于中毒进而引发大量的广播数据包在网络中洪泛时,网络管理员的唯一想

2、法就是尽快地找到根源主机并把它从网络中暂时隔离开。当网络的布置很随意时,任何用户只要插上网线,在任何位置都能够上网,这虽然使正常情况下的大多数用户很满意,但一旦发生网络故障,网管人员却很难快速准确定位根源主机。 希望通过一定的方法,固定每台计算机连接的交换机端口,方便网管员日常的维护与更新。新课教学通过端口绑定特性,网络管理员可以将用户的MAC 地址和IP 地址绑定到指定的端口上。进行绑定操作后,交换机只对从该端口收到的指定MAC 地址和IP 地址的用户发出的报文进行转发,提高了系统的安全性,增强了对网络安全的监控。我们通常说的MAC地址与交换机端口绑定其实就是交换机端口安全功能。端口安全功能

3、能让您配置一个端口只允许一台或者几台确定的设备访问那个交换机;能根据MAC地址确定允许访问的设备;允许访问的设备的MAC地址既可以手工配置,也可以从交换机“学到”;当一个未批准的MAC地址试图访问端口的时候,交换机会挂起或者禁用该端口等等。【实验一】 二层交换机端口静态绑定MAC地址1.1 实验设备1、2950-24交换机1台 2、PC机2台 3、交叉线1根 4、直通网线2根 1.2 组网图1.3 实验设备IP地址及要求设备名IP地址子网掩码VLAN 1192.168.1.11 255.255.255.0PC1192.168.1.1255.255.255.0PC2 192.168.1.2255

4、.255.255.0PC1连接F0/1端口,并且在F0/1上将PC1的MAC地址绑定,PC1能PING通交换机。PC2连接F0/2端口,并且在F0/2上将PC2的MAC地址绑定,PC2能PING通交换机。若将PC1更换到F0/2上,则不能PING通交换机。同理PC2更换到F0/1上,也不能PING通交换机。1.4配置过程和解释PC机上的IP地址请自行设置完成。第一步:得到PC1主机的mac地址 PCipconfig /allPhysical Address.: 00E0.A323.5CE1IP Address.: 192.168.1.1Subnet Mask.: 255.255.255.0De

5、fault Gateway.: 0.0.0.0DNS Servers.: 0.0.0.0我们得到了PC1主机的mac地址为:00E0.A323.5CE1第二步:配置交换机的IP地址 Switch(config)#int vlan 1Switch(config-if)#ip add 192.168.1.11 255.255.255.0Switch(config-if)#no shutdownSwitch(config-if)#exit第三步:使能F0/1端口的MAC地址绑定功能 Switch(Config)#interface F0/1 Switch(config-if)#switchport

6、mode access 将端口模式设置为access模式Switch(config-if)#switchport port-security命令:switchport port-security no switchport port-security 功能:使能端口MAC地址绑定功能;本命令的no操作为关闭端口MAC地址绑定功能。 命令模式:端口配置模式 缺省情况:交换机端口不打开MAC地址绑定功能。 使用指南:MAC地址绑定功能与802.1x、Spanning Tree、端口汇聚功能存在互斥关系,因此如果要打开端口的MAC地址绑定功能,就必须关闭端口上的802.1x、Spanning Tre

7、e、端口汇聚功能,且打开MAC地址绑定功能的端口不能是Trunk口。 Switch(config-if)#第四步:添加端口静态安全MAC地址,缺省端口最大安全MAC地址数为1 Switch(config-if)#switchport port-security mac-address 00E0.A323.5CE1 命令:switchport port-security mac-address no switchport port-security mac-address 功能:添加静态安全MAC地址;本命令的no操作为删除静态安全MAC地址。 命令模式:端口配置模式 参数:为添加/删除的MAC

8、地址。 使用指南:端口必须使能MAC地址绑定功能之后才能添加端口静态安全MAC地址。 第五步:配置违反MAC安全采取的措施Switch(config-if)#switchport port-security violation restrict 命令:switchport port-security violation protect | restrict | shutdown no switchport port-security violation 功能: 当超过设定MAC地址数量的最大值,或访问该端口的设备MAC地址不是这个MAC地址表中该端口的MAC地址,或同一个VLAN中一个MAC地

9、址被配置在几个端口上时,就会引发违反MAC地址安全。命令模式:端口配置模式参数:protect(保护模式):丢弃数据包,不发警告。 restrict(限制模式):丢弃数据包,发警告,发出SNMP trap,同时被记录在syslog日志里。 shutdown(关闭模式):这是交换机默认模式,在这种情况下端口立即变为err-disable状态,并且关掉端口灯,发出SNMP trap,同时被记录在syslog日志里,除非管理员手工激活,否则该端口失效。查看配置: Switch#show port-security address 命令:show port-security address inter

10、face 功能:显示端口安全MAC地址。 命令模式:特权配置模式 参数: 指定的显示端口。 使用指南:本命令显示端口安全MAC地址信息,如果不指定端口则显示所有端口安全MAC地址。显Secure Mac Address Table-Vlan Mac Address Type Ports Remaining ge(mins)- - - - -1 00E0.A323.5CE1 DynamicConfigured FastEthernet0/1- 验证配置:PC1连接在F0/1上,使能F0/1端口Switch(config)#int f0/1Switch(config-if)#shutdown Sw

11、itch(config-if)#no shutdown PC1与交换机的PING命令测试结果PCping 192.168.1.11Pinging 192.168.1.11 with 32 bytes of data:Reply from 192.168.1.11: bytes=32 time=31ms TTL=255Reply from 192.168.1.11: bytes=32 time=31ms TTL=255Reply from 192.168.1.11: bytes=32 time=31ms TTL=255Reply from 192.168.1.11: bytes=32 time=

12、31ms TTL=255Ping statistics for 192.168.1.11: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: Minimum = 31ms, Maximum = 31ms, Average = 31ms第六步:将PC2的MAC地址绑定在F0/2端口上配置命令与F0/1端口绑定PC1的MAC地址相同PC1连接在F0/2上,使能F0/2端口Switch(config)#int f0/2Switch(config-if)#

13、shutdown Switch(config-if)#no shutdown PCping 192.168.1.11Pinging 192.168.1.11 with 32 bytes of data:Request timed out.Request timed out.Request timed out.Reply from 192.168.1.11: bytes=32 time=32ms TTL=255Ping statistics for 192.168.1.11: Packets: Sent = 4, Received = 1, Lost = 3 (75% loss),Approxi

14、mate round trip times in milli-seconds: Minimum = 32ms, Maximum = 32ms, Average = 32ms1.5完整的配置文档Switch#sho run Building configuration.!interface FastEthernet0/1 switchport mode access switchport port-security switchport port-security mac-address 00E0.A323.5CE1!interface FastEthernet0/2switchport mod

15、e access switchport port-security switchport port-security mac-address 00D0.FFA4.BEB3!interface FastEthernet0/3!interface FastEthernet0/24!interface Vlan1 ip address 192.168.1.11 255.255.255.0!End1.6 实验验证PC连接的端口PING结果原因PC1F0/1192.168.1.11PC1F0/2192.168.1.11PC2F0/1192.168.1.11PC2F0/2192.168.1.11【实验二】

16、在一个端口上静态绑定多个MAC地址2.1实验设备1、2950-24交换机1台 2、PC机4台 3、交叉线1根 4、直通网线4根 2.2组网图2.3实验设备IP地址及要求设备名IP地址子网掩码VLAN 1192.168.1.11 255.255.255.0PC1192.168.1.1255.255.255.0PC2 192.168.1.2255.255.255.0PC3192.168.1.3255.255.255.0PC4192.168.1.4255.255.255.0将PC1、PC2、PC3的MAC地址都绑定在F0/1端口上,并且分别将三台计算机连接在F0/1端口上都能PING通交换机,但更换

17、为PC4后则不能PING通交换机。2.4配置过程和解释第一步:得到PC1主机的mac地址 PCipconfig /all第二步:配置交换机的IP地址 Switch(config)#int vlan 1Switch(config-if)#ip add 192.168.1.11 255.255.255.0Switch(config-if)#no shutdownSwitch(config-if)#exit第三步:使能F0/1端口的MAC地址绑定功能 Switch(Config)#interface F0/1 Switch(config-if)#switchport mode access Swit

18、ch(config-if)#switchport port-security第四步:添加端口静态安全MAC地址,端口最大安全MAC地址数为3Switch(config-if)#switchport port-security maximum 3命令:switchport port-security maximum no switchport port-security maximum 功能:设置端口最大安全MAC地址数;本命令的no操作为恢复最大安全地址数为1。 命令模式:端口配置模式 参数: 端口静态安全MAC地址上限,取值范围1132。 缺省情况:端口最大安全MAC地址数为1。 使用指南:

19、端口必须使能MAC地址绑定功能之后才能设置端口安全MAC地址上限。如果端口静态安全MAC地址数大于设置的最大安全MAC地址数,则设置失败;必须删除端口的静态安全MAC地址,直到端口静态安全MAC地址数不大于设置的最大安全MAC地址数,设置才会成功。 Switch(config-if)#switchport port-security mac-address aaaa.aaaa.aaaaSwitch(config-if)#switchport port-security mac-address aaaa.aaaa.bbbbSwitch(config-if)#switchport port-sec

20、urity mac-address aaaa.aaaa.cccc当添加第四个MAC地址时,会显示如下信息:Total secure mac-addresses on interface FastEthernet0/1 has reached maximum limit.第五步:配置违反MAC安全采取的措施Switch(config-if)#switchport port-security violation restrict 查看配置: Switch#show port-security address Secure Mac Address Table-VlanMac Address Type

21、 Ports Remaining Age(mins)- - - -1 AAAA.AAAA.AAAASecureConfiguredFastEthernet0/1-1 AAAA.AAAA.BBBBSecureConfiguredFastEthernet0/1-1 AAAA.AAAA.CCCCSecureConfiguredFastEthernet0/1-Total Addresses in System (excluding one mac per port) : 3Max Addresses limit in System (excluding one mac per port) : 1024

22、2.5完整的配置文档Switch#sho run Building configuration.!interface FastEthernet0/1 switchport mode access switchport port-security switchport port-security maximum 3 switchport port-security mac-address AAAA.AAAA.AAAA switchport port-security mac-address AAAA.AAAA.BBBBswitchport port-security mac-address AA

23、AA.AAAA.CCCC!interface FastEthernet0/2!interface FastEthernet0/24!interface Vlan1 ip address 192.168.1.11 255.255.255.0!End2.6实验验证PC连接的端口PING结果原因PC1F0/1192.168.1.11PC2F0/1192.168.1.11PC3F0/1192.168.1.11PC4F0/1192.168.1.11【实验三】二层交换机端口动态绑定MAC地址3.1实验设备1、2950-24交换机1台 2、PC机4台 3、交叉线1根 4、直通网线4根 3.2组网图3.3实验

24、设备IP地址及要求设备名IP地址子网掩码VLAN 1192.168.1.11 255.255.255.0PC1192.168.1.1255.255.255.0PC2 192.168.1.2255.255.255.0PC3192.168.1.3255.255.255.0PC4192.168.1.4255.255.255.0 在F0/1端口使用动态绑定功能,使端口能动态学习3个MAC地址,当学习数超过设定学习的最大值,端口将停止学习。3.4配置过程和解释第一步:得到PC1主机的mac地址 PCipconfig /all第二步:配置交换机的IP地址 Switch(config)#int vlan 1

25、Switch(config-if)#ip add 192.168.1.11 255.255.255.0Switch(config-if)#no shutdownSwitch(config-if)#exit第三步:使能F0/1端口的MAC地址绑定功能 Switch(Config)#interface F0/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport port-security第四步:动态添加端口安全MAC地址,端口最大安全MAC地址数为3Switch(config-if)#switchport p

26、ort-security maximum 3Switch(config-if)#switchport port-security mac-address sticky命令:switchport port-security mac-address sticky no switchport port-security mac-address sticky功能:设置端口动态学习MAC地址功能 命令模式:端口配置模式 3.5完整的配置文档Switch#sho runBuilding configuration.Current configuration : 1259 bytes!interface F

27、astEthernet0/1 switchport mode access switchport port-security switchport port-security maximum 2 switchport port-security mac-address sticky switchport port-security violation restrict switchport port-security mac-address sticky AAAA.AAAA.AAAA switchport port-security mac-address sticky AAAA.AAAA.B

28、BBBswitchport port-security mac-address sticky AAAA.AAAA.CCCC !interface FastEthernet0/2interface FastEthernet0/24!interface Vlan1 ip address 192.168.1.11 255.255.255.0!End3.6实验验证PC连接的端口PING结果原因PC1F0/1192.168.1.11PC2F0/1192.168.1.11PC3F0/1192.168.1.11PC4F0/1192.168.1.11课堂小结本次课主要是学习了计算机的MAC地址与交换机上的端口的相对关系,通过将MAC地址绑定在端口上,可以达到简单的安全防护。课后作业课内完成教学反思学生对MAC地址的作用还能是能够比较好的理解,通过对端口与MAC的对应关系可以达到对计算机在网络中通讯的控制,这个是比较好应用的一个措施。学生还能够感兴趣。.精品文档.教案课程名称 网络设备 授课年级 高一 学校 电子职校 教师姓名 李萱

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 小学资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁