联想天工iSpirit 2948G交换机端口和MAC绑定及端口带宽限制

前段时间接触了联想天工交换机,核心为联想天工iSpirit8800,楼层都为天工iSpirit 2948G,在楼层上做了两个限制,一是将端口与用户的网卡MAC绑定,只有绑定的网卡数据包才能出去,二是限制了每个端口的带宽(防止P2P下载),配置如下:

1、端口与MAC地址绑定

MAC与端口绑定

shiyan#conf t
//进入配置模式
shiyan_config#interface fastEthernet 0/11
//进入交换机11端口配置模式
shiyan_config_f0/11#switchport port-security mode static accept
//打开安全端口的模式
shiyan_config_f0/11#switchport port-security static mac-address 0001.4A22.E728
//设置安全端口的安全MAC
shiyan_config_f0/11#switchport port-security static mac-address 0001.4DFF.EEFD
//设置安全端口的安全MAC
shiyan_config_f0/11#exit
shiyan_config#exit
shiyan#wr
//写入配置
Saving current configuration…
OK!

去除MAC与端口绑定

shiyan#conf t
//进入配置模式
shiyan_config#interface fastEthernet 0/11
//进入交换机11端口配置模式
shiyan_config_f0/11#no switchport port-security static mac-address 0001.4A22.E728
//设置去除安全端口的安全MAC地址
shiyan_config_f0/11#no switchport port-security static mac-address
//设置去除所有安全端口的安全MAC
shiyan_config_f0/11#exit
shiyan_config#exit
shiyan#wr
//写入配置
Saving current configuration…
OK!

只打开端口的安全端口功能(此端口不能上网)

shiyan#conf t
//进入配置模式
shiyan_config#interface fastEthernet 0/11
//进入交换机11端口配置模式
shiyan_config_f0/11#switchport port-security mode static accept
//打开11口的安全端口功能
shiyan_config_f0/11#exit
shiyan_config#exit
shiyan#wr
//写入配置
Saving current configuration…
OK!

打开多端口的安全端口功能(此些端口不能上网)

shiyan#conf t
//进入配置模式
shiyan_config#interface range fastEthernet 0/11 – 20
//进入交换机11-20端口配置模式
shiyan_config_f0/11#switchport port-security mode static accept
//打开11口的安全端口功能
shiyan_config_f0/11#exit
shiyan_config#exit
shiyan#wr
//写入配置
Saving current configuration…
OK!

2、端口带宽限制

通过设置端口的rate-limit参数来限制端口带宽,共有1-32个单位可以设置,每个单位速度为3.3Mbps(约330KB/S)下载速度。端口有进和出的限制,都限制为1,这样上行和下行的带宽共为2个单位,约660KB/S。操作如下:

shiyan#conf t
shiyan_config#interface fastEthernet 0/42
shiyan_config_f0/42#switchport rate-limit 1 ingress
shiyan_config_f0/42#switchport rate-limit 1 egress
//limit单位1-32,每个单位速度为3.3Mbps
shiyan_config_f0/42#exit
shiyan_config#exit
shiyan#wr

2 Comments

  1. 水手说道:

    我有一点不太明白,希望能得到指点:
    为什么mac地址绑定要在核心层?cisco上是说中大型网络里在汇聚层绑mac。
    还有,现在p2p下载防止是不是用厂家定制的比较好?

  2. admin说道:

    没有啊。我写的就是在楼层交换机也就是接入层交换机上做绑定的。

Leave a Reply