switch(Config-Ethernet0/0/1)#switchport port-security maximum 4
//對接口設置mac地址的最大數量限制
switch(Config-Ethernet0/0/1)#switchport port-security mac-address aa-aa-aa-11-11-11
switch(Config-Ethernet0/0/1)#switchport port-security mac-address aa-aa-aa-22-22-22
switch(Config-Ethernet0/0/1)#switchport port-security mac-address aa-aa-aa-33-33-33
//配置端口和mac地址之間的綁定
驗證配置:
switch#show port-security
Security Port MaxSecurityAddr CurrentAddr Security Action
(count) (count)
--------------------------------------------------------------------------------
----
Ethernet0/0/1 4 4 Protect
--------------------------------------------------------------------------------
---
Max Addresses limit per port :128
Total Addresses in System :4
switch#
switch#sh port-security address
Security Mac Address Table
----------------------------------------------------------------------------
Vlan Mac Address Type Ports
1 00-13-20-d9-66-db SecurityConfigured Ethernet0/0/1
1 aa-aa-aa-11-11-11 SecurityConfigured Ethernet0/0/1
1 aa-aa-aa-22-22-22 SecurityConfigured Ethernet0/0/1
1 aa-aa-aa-33-33-33 SecurityConfigured Ethernet0/0/1
----------------------------------------------------------------------------
Total Addresses in System :4
Max Addresses limit in System :128
switch#
//端口所綁定mac地址