【实验名称】:交换机的端口安全

【实验目的】:掌握交换机的端口安全功能,控制用户的安全接入

【实验地点】:E1A-406

【实验时间】:11月28日

【需求分析】

针对交换机的所有端口,配置最大连接数为 1,针对 PC1 主机的接口进行 IP+MAC 地

址绑定。

【实验拓扑】

wKioL1g9OoLzoWY6AADTQb7BlNY324.png-wh_50

【实验设备】:

交换机一台

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)

【实验结果】:

wKioL1g7oE-wF__sAAA38vyZGO4218.png-wh_50

wKiom1g7oFDjtSNnAABFazBTnNo445.png-wh_50

wKiom1g7oFCg61wtAAA_C2np4AM627.png-wh_50

给每个接口设置的最大接口数为4

给0/3接口绑定IP 为172.28.15.6 MAC地址为c89c.dc22.61c6

给0/10接口绑定IP为172.28.15.6 

此IP的任何MAC地址都能接入


【实验总结】

交换机端口安全功能,是指针对交换机的端口进行安全属性的配置,从而控制用户的安全接入。交换机端口安全主要有两种类项:一是限制交换机端口的最大连接数,二是针对交换机端口进行MAC地址、IP地址的绑定。

限制交换机端口的最大连接数可以控制交换机端口下连的主机数,并防止用户进行恶意的ARP欺骗。

  交换机端口的地址绑定,可以针对IP地址、MAC地址、IPMAC进行灵活的绑定。可以实现对用户进行严格的控制。保证用户的安全接入和防止常见的内网的网络***。如ARP欺骗、IPMAC地址欺骗,IP地址***等。