网络工程(四)交换机端口与mac地址绑定

本文详细介绍了如何使用Cisco模拟器配置交换机的MAC地址绑定功能,包括配置交换机IP、获取计算机MAC地址及设置端口安全策略,通过实例验证了绑定效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

实验目的

掌握交换机mac地址绑定的方法

实验环境

Windows 2003,Cisco模拟器

相关知识

交换机的端口安全,是一种交换机的过滤策略,即为交换机的某个端口绑定一个固定的mac地址,使其他的mac地址访问的时候触发策略,down掉端口或者拒绝服务。

实验过程

1. 配置交换机IP为192.168.1.100

代码块:

Switch>enable
Switch#config terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface vlan 1
Switch(config-if)#ip address 192.168.1.100 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up
    
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
Switch(config-if)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console

运行图

2. 配置计算机A的IP为192.168.1.10,并获取计算机的mac地址

在这里插入图片描述
在这里插入图片描述

3. 配置交换机端口mac地址绑定功能

代码块:

Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface Fa 0/5
Switch(config-if)#switchport mode access
Switch(config-if)#switchport port-security
Switch(config-if)#switchport port-security mac-address 000A.F34C.8499
Switch(config-if)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console

Switch#show port-security
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
               (Count)       (Count)        (Count)
--------------------------------------------------------------------
        Fa0/5        1          1                 0         Shutdown
----------------------------------------------------------------------
Switch#show port-security address
			Secure Mac Address Table
-------------------------------------------------------------------------------
Vlan	Mac Address	Type			Ports		Remaining Age
								(mins)
----	-----------	----			-----		-------------
1	000A.F34C.8499	SecureConfigured	FastEthernet0/5		-
------------------------------------------------------------------------------
Total Addresses in System (excluding one mac per port)     : 0
Max Addresses limit in System (excluding one mac per port) : 1024
Switch#

在这里插入图片描述

验证。用网线把计算机A连接到计算机的第五个端口,ping交换机的IP地址,网络正常。再把计算机B换到交换机的第五个端口,再次ping计算机的IP地址,网络不通。

计算机A ping通:
在这里插入图片描述
计算机B ping 不通
在这里插入图片描述
计算机连接如图:
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值