对交换机的端口进行安全配置,可以防止IP地址的冲突,防止内部网络攻击和破坏行为,可以为每台电脑分配固定的IP。
下面为交换机所有的端口配置最大连接数为1,对F0/3进行IP + MAC地址绑定。
配置交换机端口的最大连接数限制:
S3750#conf t
S3750(config)#int range f 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
使用show port-security查看配置好的端口最大连接数限制:
S3750#sh port-security
S3750#show port-security int f 0/1
配置交换机端口的MAC与IP地址绑定:
S3750#conf t
S3750(config)#int f 0/2
S3750(config-if)#switchport port-security
S3750(config-if)#switchport port-security mac-address 0006.1bde.13b4 ip-address 172.16.1.23
查看地址安全绑定配置:
S3750#show port-security address all
配置交换机端口的IP地址绑定:
S3750(config)#int fastEthernet 0/3
S3750(config-if)#switchport port-security ip-address 10.1.1.1