交換機的端口安全,是一種交換機的過濾策略,即為交換機的某個端口綁定一個固定的mac地址,使其他的mac地址訪問的時候觸發策略,down掉端口或者拒絕服務
以下為拓撲圖
交換機配置
enable 進入特權模式
conf t 進入全局配置模式
hostname 修改交換機名
no ip domain-lookup 去除域名解析
interface vlan1 進入vlan1
ip address 192.168.1.1 255.255.255.0 配置vlan1的IP地址(即配置管理地址)
no shutdown 激活端口
exit 返回上一級
interface f0/1 進入接口0/1
shutdown 關閉端口
switchport mode access 修改端口模式
switchport port-security 修改端口為安全模式
switchport port-security 00E0.B0EA.6035 將主機mac地址與端口綁定,此處的mac地址為PC-主機1的地址
switchport port-security maximum 1 設置mac地址的最大數量為1
switchport port-security violation shutdown 設置響應策略,此處為關閉端口
end 返回至特權模式
copy running-config startup-config 保存配置