实验拓扑:

交换机端口安全_交换机端口安全

 

实验目的:掌握交换机基本操作

 

掌握交换机端口安全配置

 

实验需求:配置交换机主机名,密码,网关等。

 

在交换机fa0/3口上面配置接口安全,规定最大学习MAC地址数量为10,其余丢弃。

实验步骤:

 

步骤一:基本配置

主机名,密码等基本配置与路由器相同,在此不做过多讲解。

Switch(config)#ip default-gateway 192.168.1.1

//设置网关地址为192.168.1.1(不设置不能通过IP访问交换机)

Switch(config)#interface vlan 1

Switch(config-if)#ip address 192.168.1.2 255.255.255.0

Switch(config-if)#no shutdown

//设置交换机管理IP地址为192.168.1.2

Switch(config)#int fa0/1

Switch(config-if)#duplex full

Switch(config-if)#speed 100

//手工设置交换机双工模式以及速度

步骤二:设置交换机端口安全

Switch(config-if)#int fa0/3

Switch(config-if)#switchport mode access

//必须先将交换机接口设置为接入接口

Switch(config-if)#switchport port-security maximum 10

//将接口学习的最大MAC地址数量设置为10

Switch(config-if)#switchport port-security violation protect

//将超过最大地址数量的数据帧的动作为丢弃

交换机常见查看命令:

show flash:

查看交换机flash内容

show mac-address-table

产看交换机MAC地址表

show post

查看交换机开机自检信息