Transcript 项目十一交换机端口安全
项目十一 交换机端口安全 1.教学目标 了解交换机端口在网络安全中的重要作用,掌 握交换机端口安全功能配置方法,具体如下: (1)认识交换机端口安全功能用途 (2)掌握交换机端口安全功能配置方法 2.工作任务 你是某公司的网络管理员,公司要求对网络进行严 格控制。为了防止公司内部用户的IP地址冲突,防止公 司内部的网络攻击和破坏行为。为每一位员工分配了 固定的IP地址,并且限制只允许公司员工主机可以使用 网络,不得随意连接其他主机。 3. 相关实践知识 公司网络接入交换机的所有端口配置最大连接数为1, 并对公司每台主机连接的交换机端口进行IP+MAC地址 绑定,模拟网络拓朴结构如图11.1所示。假设PC1的IP 地 址 为 192.168.0.10/24 , PC2 的 IP 地 址 为 192.168.0.20/24,PC3的IP地址为192.168.0.30/24。 Fa 0/1 Fa 0/10 SwitchA Fa 0/2 NIC NIC PC1 PC2 图11.1 交换机端口安全功能配置 NIC PC3 第1步:配置交换机端口的最大连接数限制 SwitchA#configure terminal SwitchA(config)#interface range fastethernet 0/1-23 SwitchA(config-if-range)#switchport port-security SwitchA(config-if-range)# switchport port-security maximum 1 SwitchA(config-if-range)# switchport port-security violation shutdown SwitchA(config-if-range)#end SwitchA#show port-security 第2步:配置交换机端口的地址绑定 SwitchA#configure terminal SwitchA(config)#interface fastethernet 0/1 SwitchA(config-if)# switchport port-security SwitchA(config-if)# switchport port-security macaddress 0006.1bde.13b4 ip-address 192.168.0.10 SwitchA(config-if)#end SwitchA# SwitchA#show port-security address 4. 相关理论知识 □ 端口安全简述 (1)限制允许访问交换机上某个端口的MAC地址以 及IP ; (2)限制一个端口上能包含的安全地址最大个数 。 □ 对违例的处理模式 (1)protect:当安全地址个数满后,安全端口将丢 弃未知名地址(不是该端口的安全地址中的任何一个) 的包 (2)restrict:当违例产生时,将发送一个Trap通知 (3)shutdown:当违例产生时,将关闭端口并发送 一个Trap通知。 □ 端口安全配置 (1)限制允许访问交换机上某个端口的MAC地址以 及IP 例如:在交换机端口fastethernet 0/3上配置一个安 全地址:00d0.f800.073c,并为其绑定一个IP地址: 192.168.12.202 。 Switch# configure terminal Switch(config)# interface fastethernet 0/3 Switch(config-if)# switchport mode access Switch(config-if)# switchport port-security Switch(config-if)# switchport port-security macaddress 00d0.f800.073c ip-address 192.168.12.202 Switch(config-if)# end □ 端口安全配置 (2) 限制一个端口上能包含的安全地址最大个数 例如:在交换机端口fastethernet 0/3上配置端口安 全功能,设置最大地址个数为8,设置违例方式为 protect 。 Switch# configure terminal Switch(config)# interface fastethernet 0/3 Switch(config-if)# switchport mode access Switch(config-if)# switchport port-security Switch(config-if)# switchport port-security maximum 8 Switch(config-if)# switchport port-security violation protect Switch(config-if)# end 项目结束