2022年教案二层交换机端口与MAC地址的绑定

上传人:hs****ma 文档编号:567317882 上传时间:2024-07-19 格式:PDF 页数:12 大小:191.78KB
返回 下载 相关 举报
2022年教案二层交换机端口与MAC地址的绑定_第1页
第1页 / 共12页
2022年教案二层交换机端口与MAC地址的绑定_第2页
第2页 / 共12页
2022年教案二层交换机端口与MAC地址的绑定_第3页
第3页 / 共12页
2022年教案二层交换机端口与MAC地址的绑定_第4页
第4页 / 共12页
2022年教案二层交换机端口与MAC地址的绑定_第5页
第5页 / 共12页
点击查看更多>>
资源描述

《2022年教案二层交换机端口与MAC地址的绑定》由会员分享,可在线阅读,更多相关《2022年教案二层交换机端口与MAC地址的绑定(12页珍藏版)》请在金锄头文库上搜索。

1、名师精编优秀教案教案课程名称网络设备授课年级高一学校 电子职校教师姓名李萱章节名称二层交换机上的端口与MAC绑定计划学时2 课时教学目标1、了解什么是交换机的 MAC 绑定功能;2、熟练掌握 MAC 与端口绑定的静态、动态方式。设计思路通过模拟构建的工作场景,使学生能够以工作过程的形式进行学习。教学环节教学内容、所用时间、教师活动、学生活动引入新课在日常工作中,经常会发生用户随意插拔交换机上的网线,给网管员在网络管理上带来一定的不便。同时也会出现在一个交换机端口下连接另一个Hub 或交换机,导致网络线路的拥堵。当网络中某机器由于中毒进而引发大量的广播数据包在网络中洪泛时,网络管理员的唯一想法就

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

3、能让您配置一个端口只允许一台或者几台确定的设备访问那个交换机;能根据MAC 地址确定允许访问的设备;允许访问的设备的MAC 地址既可以手工配置,也可以从交换机“ 学到 ” ;当一个未批准的 MAC 地址试图访问端口的时候,交换机会挂起或者禁用该端口等等。精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 1 页,共 12 页名师精编优秀教案【实验一】二层交换机端口静态绑定 MAC 地址1.1 实验设备1、2950-24 交换机 1台2、PC 机2台3、交叉线 1根4、直通网线 2根1.2 组网图PC1PC2SW0F0/1F0/2F0/31.3 实验设备

4、 IP 地址及要求设备名IP地址子网掩码VLAN 1 192.168.1.11 255.255.255.0 PC1 192.168.1.1 255.255.255.0 PC2 192.168.1.2 255.255.255.0 PC1 连接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

5、 地址请自行设置完成。第一步:得到 PC1 主机的 mac 地址PCipconfig /all Physical Address.: 00E0.A323.5CE1 IP Address.: 192.168.1.1 Subnet Mask.: 255.255.255.0 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 2 页,共 12 页名师精编优秀教案Default Gateway.: 0.0.0.0 DNS Servers.: 0.0.0.0 我们得到了 PC1 主机的 mac地址为: 00E0.A323.5CE1 第二步:配置交换机的 IP地址

6、Switch(config)#int vlan 1 Switch(config-if)#ip add 192.168.1.11 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#exit 第三步:使能 F0/1端口的 MAC 地址绑定功能Switch(Config)#interface F0/1 Switch(config-if)#switchport mode access 将端口模式设置为access 模式Switch(config-if)#switchport port-security 命令: switchpor

7、t port-security no switchport port-security 功能:使能端口 MAC 地址绑定功能;本命令的 no操作为关闭端口 MAC 地址绑定功能。命令模式:端口配置模式缺省情况:交换机端口不打开MAC 地址绑定功能。使用指南:MAC 地址绑定功能与 802.1x、Spanning Tree 、端口汇聚功能存在互斥关系,因此如果要打开端口的MAC 地址绑定功能,就必须关闭端口上的802.1x、Spanning Tree 、 端口汇聚功能,且打开 MAC 地址绑定功能的端口不能是Trunk口。Switch(config-if)# 第 四 步 :添 加端 口静态 安全

8、 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 地址。使用指南:端口必须使能 MAC 地址绑定功能之后才能添加端口静态安全MAC 地址。

9、第五步:配置违反 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 地址被配置在几个端口上时,就会引发违反MAC 地址精选学习资料 - -

10、 - - - - - - - 名师归纳总结 - - - - - - -第 3 页,共 12 页名师精编优秀教案安全。命令模式:端口配置模式参数:protect(保护模式):丢弃数据包,不发警告。 restrict(限制模式):丢弃数据包,发警告,发出SNMP trap ,同时被记录在syslog日志里。 shutdown(关闭模式):这是交换机默认模式,在这种情况下端口立即变为err-disable状态,并且关掉端口灯,发出SNMP trap ,同时被记录在syslog 日志里,除非管理员手工激活,否则该端口失效。查看配置:Switch#show port-security address 命

11、令: show port-security address interface 功能:显示端口安全 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 端口Swit

12、ch(config)#int f0/1 Switch(config-if)#shutdown Switch(config-if)#no shutdownPC1 与交换机的 PING 命令测试结果PCping 192.168.1.11 Pinging 192.168.1.11 with 32 bytes of data: Reply from 192.168.1.11: bytes=32 time=31ms TTL=255 Reply from 192.168.1.11: bytes=32 time=31ms TTL=255 Reply from 192.168.1.11: bytes=32 t

13、ime=31ms TTL=255 Reply from 192.168.1.11: bytes=32 time=31ms TTL=255 Ping statistics for 192.168.1.11: 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 4 页,共 12 页名师精编优秀教案 Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 31ms, Maximum = 31ms,

14、 Average = 31ms 第六步:将 PC2 的MAC 地址绑定在 F0/2 端口上配置命令与 F0/1 端口绑定 PC1 的MAC 地址相同PC1 连接在 F0/2 上,使能 F0/2端口Switch(config)#int f0/2 Switch(config-if)#shutdown Switch(config-if)#no shutdown PCping 192.168.1.11 Pinging 192.168.1.11 with 32 bytes of data: Request timed out. Request timed out. Request timed out.

15、Reply from 192.168.1.11: bytes=32 time=32ms TTL=255 Ping statistics for 192.168.1.11: Packets: Sent = 4, Received = 1, Lost = 3 (75% loss), Approximate round trip times in milli-seconds: Minimum = 32ms, Maximum = 32ms, Average = 32ms 1.5 完整的配置文档Switch#sho run Building configuration. ! interface Fast

16、Ethernet0/1 switchport mode access switchport port-security switchport port-security mac-address 00E0.A323.5CE1 ! interface FastEthernet0/2 switchport mode access switchport port-security switchport port-security mac-address 00D0.FFA4.BEB3 ! interface FastEthernet0/3 ! 精选学习资料 - - - - - - - - - 名师归纳总

17、结 - - - - - - -第 5 页,共 12 页名师精编优秀教案interface FastEthernet0/24 ! interface Vlan1 ip address 192.168.1.11 255.255.255.0 ! End 1.6 实验验证PC 连接的端口PING 结果原因PC1 F0/1 192.168.1.11 PC1 F0/2 192.168.1.11 PC2 F0/1 192.168.1.11 PC2 F0/2 192.168.1.11 【实验二】在一个端口上静态绑定多个MAC 地址2.1 实验设备1、2950-24 交换机 1台2、PC 机4台3、交叉线 1根

18、4、直通网线 4根2.2 组网图PC1PC2PC3PC4SW0F0/12.3实验设备 IP地址及要求设备名IP地址子网掩码VLAN 1 192.168.1.11 255.255.255.0 PC1 192.168.1.1 255.255.255.0 PC2 192.168.1.2 255.255.255.0 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 6 页,共 12 页名师精编优秀教案PC3 192.168.1.3 255.255.255.0 PC4 192.168.1.4 255.255.255.0 将 PC1 、PC2 、PC3的 MAC

19、 地址都绑定在 F0/1 端口上,并且分别将三台计算机连接在 F0/1 端口上都能 PING通交换机,但更换为 PC4后则不能 PING通交换机。2.4 配置过程和解释第一步:得到 PC1 主机的 mac 地址PCipconfig /all 第二步:配置交换机的 IP地址Switch(config)#int vlan 1 Switch(config-if)#ip add 192.168.1.11 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#exit 第三步:使能 F0/1端口的 MAC 地址绑定功能Switch(C

20、onfig)#interface F0/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport port-security 第四步:添加端口静态安全MAC 地址,端口最大安全MAC 地址数为 3 Switch(config-if)#switchport port-security maximum 3 命令: switchport port-security maximum no switchport port-security maximum 功能:设置端口最大安全MAC 地址数;本命令的 no操作为恢复最

21、大安全地址数为1。命令模式:端口配置模式参数: 端口静态安全 MAC 地址上限,取值范围 1132。缺省情况:端口最大安全MAC 地址数为 1。使用指南:端口必须使能 MAC 地址绑定功能之后才能设置端口安全MAC 地址上限。如果端口静态安全 MAC 地址数大于设置的最大安全MAC 地址数,则设置失败;必须删除端口的静态安全MAC 地址,直到端口静态安全 MAC 地址数不大于设置的最大安全 MAC 地址数,设置才会成功。Switch(config-if)#switchport port-security mac-address aaaa.aaaa.aaaa Switch(config-if)#

22、switchport port-security mac-address aaaa.aaaa.bbbb Switch(config-if)#switchport port-security 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

23、 restrict 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 7 页,共 12 页名师精编优秀教案查看配置:Switch#show port-security addressSecure Mac Address Table - Vlan Mac Address Type Ports Remaining Age(mins) - - - - - 1 AAAA.AAAA.AAAA SecureConfigured FastEthernet0/1 - 1 AAAA.AAAA.BBBB SecureConfigured FastEthernet0/1

24、- 1 AAAA.AAAA.CCCC SecureConfigured FastEthernet0/1 - - Total Addresses in System (excluding one mac per port) : 3 Max Addresses limit in System (excluding one mac per port) : 1024 2.5 完整的配置文档Switch#sho run Building configuration. ! interface FastEthernet0/1 switchport mode access switchport port-se

25、curity switchport port-security maximum 3 switchport port-security mac-address AAAA.AAAA.AAAA switchport port-security mac-address AAAA.AAAA.BBBB switchport port-security mac-address AAAA.AAAA.CCCC ! interface FastEthernet0/2 ! interface FastEthernet0/24 ! interface Vlan1 ip address 192.168.1.11 255

26、.255.255.0 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 8 页,共 12 页名师精编优秀教案! End 2.6 实验验证PC 连接的端口PING 结果原因PC1 F0/1 192.168.1.11 PC2 F0/1 192.168.1.11 PC3 F0/1 192.168.1.11 PC4 F0/1 192.168.1.11 【实验三】二层交换机端口动态绑定MAC 地址3.1 实验设备1、2950-24 交换机 1台2、PC 机4台3、交叉线 1根4、直通网线 4根3.2 组网图PC1PC2PC3PC4SW0F0/13.3实验设备

27、IP地址及要求设备名IP地址子网掩码VLAN 1 192.168.1.11 255.255.255.0 PC1 192.168.1.1 255.255.255.0 PC2 192.168.1.2 255.255.255.0 PC3 192.168.1.3 255.255.255.0 PC4 192.168.1.4 255.255.255.0 在 F0/1 端口使用动态绑定功能,使端口能动态学习3 个 MAC 地址,当学习精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 9 页,共 12 页名师精编优秀教案数超过设定学习的最大值,端口将停止学习。3.4

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

29、-if)#switchport port-security 第四步:动态添加端口安全MAC 地址,端口最大安全MAC 地址数为 3 Switch(config-if)#switchport port-security maximum 3 Switch(config-if)#switchport port-security mac-address sticky 命令: switchport port-security mac-address stickyno switchport port-security mac-address sticky功能:设置端口动态学习MAC 地址功能命令模式:端口

30、配置模式3.5 完整的配置文档Switch#sho run Building configuration. Current configuration : 1259 bytes ! interface FastEthernet0/1 switchport mode access switchport port-security switchport port-security maximum 2 switchport port-security mac-address sticky switchport port-security violation restrict 精选学习资料 - - -

31、 - - - - - - 名师归纳总结 - - - - - - -第 10 页,共 12 页名师精编优秀教案 switchport port-security mac-address sticky AAAA.AAAA.AAAA switchport port-security mac-address sticky AAAA.AAAA.BBBB switchport port-security mac-address sticky AAAA.AAAA.CCCC ! interface FastEthernet0/2 interface FastEthernet0/24 ! interface V

32、lan1 ip address 192.168.1.11 255.255.255.0 ! End 3.6 实验验证PC 连接的端口PING 结果原因PC1 F0/1 192.168.1.11 PC2 F0/1 192.168.1.11 PC3 F0/1 192.168.1.11 PC4 F0/1 192.168.1.11 课堂小结本次课主要是学习了计算机的MAC 地址与交换机上的端口的相对关系,通过将 MAC 地址绑定在端口上,可以达到简单的安全防护。课后作业课内完成教学反思学生对 MAC 地址的作用还能是能够比较好的理解, 通过对端口与 MAC 的对应关系可以达到对计算机在网络中通讯的控制,这个是比较好应用的一个措施。学生还能够感兴趣。精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 11 页,共 12 页名师精编优秀教案精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 12 页,共 12 页

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号