不同品牌和型號的交換機(jī)配置端口安全功能的方法有所不同,以下是華為、思科、H3C 和 TP - LINK 交換機(jī)的配置方法:
?
- 華為交換機(jī)2
- 配置 VLAN:創(chuàng)建 VLAN 并將接口加入 VLAN。例如,創(chuàng)建 VLAN 10 并將接口 GigabitEthernet1/0/1 加入 VLAN 10,命令如下:
?
plaintext
?
?
?
?
?
vlan 10
quit
interface GigabitEthernet1/0/1
port link - type access
port default vlan 10
quit
?
?
- 配置端口安全功能:使能端口安全功能、Sticky MAC 功能,并設(shè)置接口學(xué)習(xí) MAC 地址數(shù)的上限。例如,使能 GE1/0/1 接口的端口安全功能,使能 Sticky MAC 功能,設(shè)置接口學(xué)習(xí) MAC 地址數(shù)的上限為 1,命令如下:
?
plaintext
?
?
?
?
?
interface GigabitEthernet1/0/1
port - security enable
port - security mac - address sticky
port - security max - mac - num 1
?
?
- 思科交換機(jī)3
- 進(jìn)入接口配置模式:使用命令
Switch# config t
進(jìn)入全局配置模式,然后使用Switch(config)# int fa0/18
進(jìn)入特定接口的配置模式。
- 啟用端口安全:在接口模式下,使用命令
Switch(config - if)# switchport port - security
啟用端口安全功能。
- 配置最大 MAC 地址數(shù):使用命令
switchport port - security maximum 12
配置端口允許的最大 MAC 地址數(shù)量。
- 配置違規(guī)動作:使用命令
switchport port - security violation (protect|restrict|shutdown)
配置當(dāng)端口上 MAC 地址數(shù)超過最大數(shù)量后交換機(jī)的行為。
- 查看端口安全狀態(tài):使用命令
Switch# show port - security address
和Switch# show port - security interface fa0/18
查看交換機(jī)上端口安全的相關(guān)信息。
- H3C 交換機(jī)(以 autoLearn 模式為例)4
- 使能端口安全:在系統(tǒng)視圖下輸入
port - security enable
使能端口安全功能。
- 設(shè)置端口安全模式:進(jìn)入端口視圖,如
interface HundredGigE1/0/1
,然后使用port - security port - mode autolearn
設(shè)置端口安全模式為 autoLearn。
- 設(shè)置最大安全 MAC 地址數(shù):在端口視圖下使用
port - security max - mac - count 64
設(shè)置端口允許學(xué)習(xí)的最大安全 MAC 地址數(shù)。
- 設(shè)置入侵檢測保護(hù)動作:使用
port - security intrusion - mode disableport - temporarily
設(shè)置觸發(fā)入侵檢測特性后的保護(hù)動作為暫時(shí)關(guān)閉端口,并可通過port - security timer disableport 30
設(shè)置關(guān)閉時(shí)間為 30 秒。
- TP - LINK 交換機(jī)(通過 Web 界面配置)6
- 進(jìn)入端口安全配置頁面:登錄交換機(jī) Web 界面,找到 “二層交換” -> “端口管理” -> “端口安全”。
- 選擇端口并設(shè)置參數(shù):選擇要配置的端口,設(shè)置最大學(xué)習(xí)地址數(shù),選擇學(xué)習(xí)模式(如動態(tài)、靜態(tài)、永久),開啟端口安全功能。例如,選擇端口 1,設(shè)置最大學(xué)習(xí)地址數(shù)為 20 個(gè),學(xué)習(xí)模式為永久,開啟端口 1 的端口安全功能。
?
配置端口安全功能時(shí),需根據(jù)實(shí)際網(wǎng)絡(luò)需求和拓?fù)浣Y(jié)構(gòu)進(jìn)行合理規(guī)劃和配置,同時(shí)注意不同功能和命令的兼容性及相互影響。
本網(wǎng)站發(fā)布或轉(zhuǎn)載的文章均來自網(wǎng)絡(luò),其原創(chuàng)性以及文中表達(dá)的觀點(diǎn)和判斷不代表本網(wǎng)站。
本文地址:http://seoheqn.com/news/article/371923/