【實驗名稱】:交換機的端口安全
【實驗目的】:掌握交換機的端口安全功能,控制用戶的安全接入
【實驗地點】:E1A-406
【實驗時間】:11月28日
【需求分析】
針對交換機的所有端口,配置最大連接數爲 1,針對 PC1 主機的接口進行 IP+MAC 地
址綁定。
【實驗拓撲】
【實驗設備】:
交換機一臺
PC機一臺
直連網線一臺
【實驗內容】:
第一步: 配置交換機端口的最大連接數限制
S3750#configure terminal
S3750(config)#interface range fastethernet 0/1-23
S3750(config-if-range)#switchport port-security
S3750(config-if-range)#switchport port-secruity maximum 1
S3750(config-if-range)#switchport port-secruity violation shutdown
第二步:驗證 交換機端口的最大連接數限制
S3750#sh port-security
Secure Port MaxSecureAddr(count) CurrentAddr(count) Security Action
------------------------ -------------------- ------------------ ---------------
FastEthernet 0/1 1 0 Shutdown
FastEthernet 0/2 1 0 Shutdown
FastEthernet 0/3 1 0 Shutdown
FastEthernet 0/4 1 0 Shutdown
FastEthernet 0/5 1 0 Shutdown
FastEthernet 0/6 1 0 Shutdown
FastEthernet 0/7 1 0 Shutdown
FastEthernet 0/8 1 0 Shutdown
FastEthernet 0/9 1 0 Shutdown
FastEthernet 0/10 1 0 Shutdown
FastEthernet 0/11 1 0 Shutdown
FastEthernet 0/12 1 0 Shutdown
FastEthernet 0/13 1 0 Shutdown
FastEthernet 0/14 1 0 Shutdown
FastEthernet 0/15 1 0 Shutdown
FastEthernet 0/16 1 0 Shutdown
FastEthernet 0/17 1 0 Shutdown
FastEthernet 0/18 1 0 Shutdown
FastEthernet 0/19 1 0 Shutdown
FastEthernet 0/20 1 0 Shutdown
FastEthernet 0/21 1 0 Shutdown
FastEthernet 0/22 1 0 Shutdown
FastEthernet 0/23 1 0 Shutdown
S3750#show port-security interface fastEthernet 0/1
Interface : FastEthernet 0/1
Port Security : Enabled
Port status : up
Violation mode : Shutdown
Maximum MAC Addresses : 1
Total MAC Addresses : 0
Configured MAC Addresses : 0
Aging time : 0 mins
SecureStatic address aging : Disabled
第三步:配置交換機端口的MAC與IP地址綁定
查看主機的IP和MAC地址信息
在主機上打開CMD命令提示符窗口,執行ipconfig /all命令
配置交換機端口的地址綁定
S3750#configure terminal
S3750(config)#interface fastethernet 0/3
S3750(config-if)#switchport port-security
S3750(config-if)#switchport port-security mac-address 0006.1bde.13b4 ip-address 172.16.1.55
第四步:查看地址安全綁定配置
S3750#sh port-security address all
Vlan Port Arp-Check Mac Address IP Address Type Remaining Age(mins)
---- ----------------------- ---------- -------------- --------------- ---------- -------------------
1 FastEthernet 0/3 Disabled 0006.1bde.13b4 172.16.1.55 Configured -
S3750#sh port-security address interface fa0/3
Vlan Mac Address IP Address Type Port Remaining Age(mins)
---- --------------- --------------- ---------- ----------------------- -------------------
1 0006.1bde.13b4 172.16.1.55 Configured FastEthernet 0/3 -
第五步:配置交換機端口的IP地址綁定
S3750(config)#int fastEthernet 0/2
S3750(config-if)#switchport port-security ip-address 10.1.1.1
S3750#show port-security address all
Vlan Port Arp-Check Mac Address IP Address Type Remaining Age(mins)
【實驗結果】:
給每個接口設置的最大接口數爲4
給0/3接口綁定IP 爲172.28.15.6 MAC地址爲c89c.dc22.61c6
給0/10接口綁定IP爲172.28.15.6
如下圖所示: