一、應(yīng)用
SW端口安全是2層特性,提供兩個方面的保護(hù):
1.可以限定一個接口所能學(xué)習(xí)的MAC地址數(shù)量
2.可以在一個接口靜態(tài)綁定MAC地址
二、配置
swi mode access #啟用端口安全時,必須先設(shè)為access接口
swi port-security #啟用端口安全(默認(rèn)只能學(xué)一個MAC)
switchport port-security mac-address sticky #將動態(tài)學(xué)到的地址粘住,永久使用
switchport port-security violation [protect|restrict|shutdown]#指定行為,默認(rèn)shutdown
switchport port-security aging time 1#(分鐘)設(shè)定多長時間后能重新學(xué)習(xí)MAC地址,也就是設(shè)定現(xiàn)有MAC地址的有效期
errdisable recovery cause psecure-violation #讓err-disable接口自動恢復(fù)
三、查看
show port-security #可以看到哪些接口應(yīng)用了端口安全
show port-security address #可以看到授權(quán)的MAC地址
show port-security interface f0/1 #可以看到接口的具體狀態(tài)
show errdisable #查看err-disable接口
除非注明,肉餅博客文章均為原創(chuàng),轉(zhuǎn)載請以鏈接形式標(biāo)明本文地址
本文地址:http://roubin.me/post/port-security/