第14章端口安全配置本章主要讲述了迈普系列交换机支持的端口安全功能以及详细的配置信息。
章节主要内容:z端口安全介绍z端口安全配置z监控与维护14.1端口安全介绍端口安全一般应用在接入层。
它能够对使用交换机端口的主机进行限制,允许某些特定的主机访问网络,而其他主机均不能访问网络。
端口安全功能将用户的MAC地址、IP地址、VLAN ID以及PORT号四个元素灵活绑定,杜绝非法用户接入网络,从而保证网络数据的安全性,并保证合法用户能够得到足够的带宽。
用户可以通过三种规则来限制可以访问网络的主机,这三种规则分别是MAC规则,IP规则和 MAX 规则,MAC规则又分为三种绑定方式:MAC绑定,MAC+IP绑定,MAC+VID绑定;IP规则可以针对某一IP也可以针对一系列IP;MAX规则用以限定端口可以“自由学习”到的(按顺序)最多MAC地址数目,这个地址数目不包括MAC规则和IP规则产生的合法MAC地址。
如果端口仅配置了拒绝规则,没有配置MAX规则,其他报文均不能转发(通过允许规则检查的例外)。
对于配置permit的MAC规则和IP 规则系统将在端口LinkUp和端口安全使能时主动将配置写入二层转发表或发送ARP请求报文(详细见配置命令),这三种规则的配置如下:(1)MAC规则MAC绑定:(config-port- xxx)#port-security permit mac-address 0050.bac3.bebd(config-port- xxx)#port-security deny mac-address 0050.bac3.bebdMAC+VID绑定:(config-port- xxx)#port-security permit mac-address 0050.bac3.bebd vlan-id 100(config-port- xxx)#port-security deny mac-address 0050.bac3.bebd vlan-id 100MAC+IP绑定:(config-port- xxx)#port-security permit mac-address 0050.bac3.bebd ip-address 128.255.1.1(config-port- xxx)#port-security deny mac-address 0050.bac3.bebd ip-address 128.255.1.1(2)IP规则(config-port- xxx)#port-security permit ip-address 128.255.1.1(config-port- xxx)#port-security deny ip-address 128.255.1.1(config-port- xxx)#port-security permit ip-address 128.255.1.1 to 128.255.1.63(config-port- xxx)#port-security deny ip-address 128.255.1.1 to 128.255.1.63(3)MAX规则(config-port- xxx)#port-security maximum 50注:如果一个MAC地址或IP地址是被deny掉的,即使这时未达到MAX的上限,该主机也不能通讯。
注:端口安全不能与802.1X共同启用。
14.2端口安全配置本节主要内容:z端口安全配置命令基本描述z端口安全启用与关闭z配置MAC绑定z配置MAC+VLAN绑定z配置MAC+IP绑定z配置IP规则z配置MAX规则z配置地址老化时间z配置静态地址老化z配置错误处理模式14.2.1基本指令描述命令描述配置模式port-security {enable|disable} 端口启用/关闭端口安全config-port- xxx,config-port-range,config-link-aggregation-xport-security permit|deny mac-address {mac-address} 配置端口MAC规则config-port- xxx,config-port-range,config-link-aggregation-xport-security permit|denymac-address {mac-address} vlan-id {vlanId}配置端口MAC+VLAN规则config-port- xxx,config-port-range,config-link-aggregation-xport-security permit|denymac-address {mac-address} ip-address {ip-address}配置端口MAC+IP规则config-port- xxx,config-port-range,config-link-aggregation-xport-security permit|deny ip-address {ip-address}[to {ip-address}]配置端口IP规则config-port- xxx,config-port-range,config-link-aggregation-xport-security maximum {0-4000}配置端口MAX规则config-port- xxx,config-port-range,config-link-aggregation-xport-security aging time {0-1440 }配置端口MAC地址老化时间config-port- xxx,config-port-range,config-link-aggregation-xport-security aging static 启用端口静态地址老化config-port- xxx,config-port-range, config-link-aggregation-xport-security violation {protect|restrict|shutdown} 配置错误处理模式config-port- xxx,config-port-range,config-link-aggregation-xport-security该命令在端口启用或者关闭端口安全功能。
port-security {enable|disable}语法描述enable 启用端口安全disable 关闭端口安全【缺省情况】disableport-security permit|deny mac-address该命令配置端口的MAC绑定规则,相关的no命令删除该规则。
port-security {permit|deny mac-address mac-address}no port-security {permit|deny mac-address mac-address}语法描述permit 规则执行动作为允许deny 规则执行动作为拒绝mac-address 规则应用的mac地址【缺省情况】无注:对于permit规则系统将其配置MAC地址和端口配置的默认VID一起写入二层转发表(MAC Address表)。
port-security permit|deny mac-address mac-address vlanId该命令设置端口的MAC+VLAN绑定规则,相关的no命令删除该规则。
port-security {permit|deny mac-address mac-address vlan-id vlanId}no port-security {permit|deny mac-address mac-address vlan-id vlanId}语法描述permit 规则执行动作为允许deny 规则执行动作为拒绝mac-address 规则应用的mac地址vlan-id 与mac地址绑定的vlan号【缺省情况】无注:对于permit规则系统将其配置MAC地址和VID一起写入二层转发表(MAC Address表)。
port-security permit|deny mac-address mac-address ip-address该命令配置端口的MAC+IP绑定规则,相关的no命令删除该规则。
port-security {permit|deny mac-address mac-address ip-address ip-address}no port-security {permit|deny mac-address mac-address ip-address ip-address}语法描述permit 规则执行动作为允许deny 规则执行动作为拒绝mac-address 规则应用的mac地址ip-address 与mac地址绑定的IP地址【缺省情况】无注:对于permit规则系统将跟据配置的IP地址并在端口的默认VLAN域内从本端口发送ARP 请求报文port-security permint|deny ip-address该命令配置端口的IP规则,相关的no命令删除该规则。
port-security {permint|deny ip-address start-ip-address[to end-ip-address]}no port-security {permint|deny ip-address start-ip-address[to end-ip-address]}语法描述permit 规则执行动作为允许deny 规则执行动作为拒绝start-ip-address 规则应用的起始IP地址end-ip-address 规则应用的结束IP地址【缺省情况】无如果只增加某一个IP地址规则,可以不使用[to end-ip-address]部分注:对于permit规则和IP地址为单地址时系统将跟据配置的IP地址并在端口的默认VLAN域内从本端口发送ARP请求报文port-security maximum该命令配置端口的MAX规则,相关的no命令删除该规则。
port-security maximum {0-4000}no port-security maximum语法描述0-4000 MAX规则的地址数【缺省情况】0port-security aging time该命令配置端口的地址老化时间(分钟),相关的no命令将该配置设置为1分钟。
port-security aging time {0-1440}no port-security aging time语法描述0-1440 老化时间,0表示不进行老化。