1.安全动态mac地址
使能端口安全而未能使能sticky mac功能时转换的mac地址
int g0/0/x
port-security enable #默认只允许存在一个mac地址。
port-security aging-time 30 #单位分钟,默认情况下,接口不down,mac地址不老化。
port-security max-mac-num 3 # 修改接口允许存在mac地址数量
2.安全静态mac
使能端口安全时手工配置的静态mac地址
int g0/0/x
port-security mac-address sticky 4564-4564-4877 vlan 1 # 也可不指定,不指定即学习到的自动转换为sticky mac-address
生存时间:永久,接口down,设备重启不消失
3.sticky mac
使能端口安全后又使能sticky mac-address功能转换后得到的mac地址(最常用)
int g0/0/x
port-security enable
port-security mac-address sticky
4.违反规则后的动作
1.restrict
默认动作,丢弃并产生告警日志
2.protect
丢弃报文不告警
3.shutdown
关闭端口
动作配置命令 port-security protect-action shutdown | restrict | protect