• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

H3C S3600系列以太网交换机 命令手册-RELEASE 1510(V1.04)

12-端口安全-端口绑定命令

本章节下载  (224.24 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S3600/S3600-SI/Command/Command_Manual/S3600-SI_CM(V1.04)/200711/317207_30005_0.htm

12-端口安全-端口绑定命令

  录

第1章 端口安全命令... 1-1

1.1 端口安全命令.. 1-1

1.1.1 display mac-address security. 1-1

1.1.2 display port-security. 1-1

1.1.3 mac-address security. 1-3

1.1.4 port-security enable. 1-5

1.1.5 port-security intrusion-mode. 1-6

1.1.6 port-security authorization ignore. 1-7

1.1.7 port-security max-mac-count 1-8

1.1.8 port-security ntk-mode. 1-9

1.1.9 port-security oui 1-10

1.1.10 port-security port-mode. 1-11

1.1.11 port-security timer disableport 1-13

1.1.12 port-security trap. 1-13

第2章 端口绑定... 2-1

2.1 端口绑定命令.. 2-1

2.1.1 am user-bind interface. 2-1

2.1.2 am user-bind. 2-2

2.1.3 display am user-bind. 2-2

 


第1章  端口安全命令

1.1  端口安全命令

1.1.1  display mac-address security

【命令】

display mac-address security [ interface interface-type interface-number ] [ vlan vlan-id ] [ count ]

【视图】

任意视图

【参数】

interface-type:端口类型。

interface-number:端口编号。

vlan-id:VLAN的ID,取值范围为1~4094。

count:显示Security MAC地址的数量。

【描述】

display mac-address security命令用来显示Security MAC地址的相关信息,包括:端口学到的MAC地址、端口所属的VLAN ID、端口当前状态、端口编号、MAC地址的老化时间。

根据该命令的输出信息,用户可以确认当前的配置,有助于故障的监控和诊断。

【举例】

# 显示端口Ethernet1/0/1的Security MAC地址的相关信息。

<H3C> display mac-address security interface Ethernet1/0/1

MAC ADDR         VLAN ID   STATE          PORT INDEX               AGING TIME(s)

0001-0001-0001  1        Security      Ethernet1/0/1         NOAGED

 

  ---  1 mac address(es) found on port Ethernet1/0/1 ---  

1.1.2  display port-security

【命令】

display port-security [ interface interface-list ]

【视图】

任意视图

【参数】

interface-list:以太网端口列表,表示多个以太网端口,表示方式为interface-list={ interface-type interface-number [ to interface-type interface-number ] } & <1-10>。

其中,interface-type为端口类型,interface-number为端口编号。& <1-10>表示前面的参数最多可以输入10次。

【描述】

display port-security命令用来显示端口安全配置的相关信息(包括全局和端口的配置信息)。根据该命令的输出信息,用户可以确认当前的配置,有助于故障的监控和诊断。

  注意:

l      如果不指定interface-list参数,则显示全局和所有端口的配置信息;

l      如果指定了interface-list参数,则显示全局和指定端口的配置信息。

 

【举例】

# 显示全局和所有端口的端口安全配置信息。

<H3C> display port-security

 Equipment port-security is enabled

 AddressLearn trap is Enabled

 Intrusion trap is Enabled

 Dot1x logon trap is Enabled

 Dot1x logoff trap is Enabled

 Dot1x logfailure trap is Enabled

 RALM logon trap is Enabled

 RALM logoff trap is Enabled

 RALM logfailure trap is Enabled

 Vlan id assigned is NULL

 Disableport Timeout: 20 s

 OUI value:

   Index is 5,  OUI value is 00efec

 Ethernet1/0/1 is link-down

   Port mode is Userlogin

   NeedtoKnow mode is needtoknowonly

   Intrusion mode is disableport

   Max mac-address num is 100

   Stored mac-address num is 0

   Authorization is permit

(以下显示信息略)

表1-1 display port-security命令显示信息描述表

字段

描述

Equipment port security is enabled

交换机端口安全特性已经开启

AddressLearn trap is Enabled

MAC地址学习的Trap信息已经打开

Intrusion trap is Enabled

入侵检测的Trap信息已经打开

Dot1x logon trap is Enabled

802.1x用户认证成功的Trap信息已经打开

Dot1x logoff trap is Enabled

802.1x用户下线的Trap信息已经打开

Dot1x logfailure trap is Enabled

802.1x用户认证失败的Trap信息已经打开

RALM logon trap is Enabled

RALM用户认证成功的Trap信息已经打开

RALM logoff trap is Enabled

RALM用户下线的Trap信息已经打开

RALM logfailure trap is Enabled

RALM用户认证失败的Trap信息已经打开

Vlan id assigned is NULL

下发的VLAN为空

Disableport Timeout: 20 s

系统暂时断开端口连接的时间为20秒

OUI value

OUI的值

Ethernet1/0/1 is link-down

端口Ethernet1/0/1的链路状态为down

Port mode is Userlogin

端口安全模式为Userlogin

NeedtoKnow mode is  needtoknowonly

NeedtoKnow特性为needtoknowonly

Intrusion mode is  disableport

入侵检测动作模式为disableport

 Max mac-address num is 100

端口允许接入的最大MAC地址数为100

Stored mac-address num is 0

保存的MAC地址数为0

Authorization is permit

端口将应用RADIUS服务器下发的授权信息

 

1.1.3  mac-address security

【命令】

mac-address security mac-address [ interface interface-type interface-number ] vlan vlan-id

undo mac-address security mac-address [ interface interface-type interface-number ] vlan vlan-id

【视图】

系统视图/以太网端口视图

【参数】

interface-type:端口类型。

interface-number:端口编号。

&  说明:

如果是在系统视图下执行以上命令,则需要配置interface interface-type interface-number参数。

 

vlan-id:VLAN的ID,取值范围为1~4094。

【描述】

mac-address security命令用来添加Security MAC地址。undo mac-address security命令用来删除配置的Security MAC地址。

缺省情况下,系统没有添加Security MAC地址。

&  说明:

只有在全局启用端口安全功能,并且端口配置port-security port-mode autolearn命令之后,才能配置Security MAC地址。

 

【举例】

# 进入系统视图。

<H3C> system-view

System View: return to User View with Ctrl+Z.

# 使能端口的安全功能。

[H3C] port-security enable

# 进入Ethernet1/0/1以太网端口视图。

[H3C] interface Ethernet1/0/1

# 配置端口允许接入的最大Security MAC地址数为100。

[H3C-Ethernet1/0/1] port-security max-mac-count 100

# 配置端口的安全模式为autolearn

[H3C-Ethernet1/0/1] port-security port-mode autolearn

# 将Security MAC地址0001-0001-0001添加到VLAN 1中。

[H3C-Ethernet1/0/1] mac-address security 0001-0001-0001 vlan 1

1.1.4  port-security enable

【命令】

port-security enable

undo port-security enable

【视图】

系统视图

【参数】

【描述】

port-security enable命令用来使能端口安全功能。undo port-security enable命令用来关闭端口安全功能。

缺省情况下,端口安全功能处于关闭状态。

  注意:

当用户使能端口安全特性后,为避免引起冲突,交换机的802.1x认证和MAC地址认证将出现如下一些限制:

l      dot1x port-control命令配置的接入控制的模式将自动转变为auto

l      命令dot1xdot1x port-methoddot1x port-controlmac-authentication不能再进行配置。

 

【举例】

# 进入系统视图。

<H3C> system-view

System View: return to User View with Ctrl+Z.

# 使能端口的安全功能。

[H3C] port-security enable

 Notice: The port-control of 802.1x will be restricted to auto when port-security is enabled.

 Please wait... Done.

1.1.5  port-security intrusion-mode

【命令】

port-security intrusion-mode { disableport | disableport-temporarily | blockmac }

undo port-security intrusion-mode

【视图】

以太网端口视图

【参数】

disableport:表示永久断开端口连接。

disableport-temporarily:表示暂时断开端口连接,经过预先设置的时间之后再启用端口。

blockmac:表示丢弃源MAC地址非法的报文。

&  说明:

用户可以使用port-security timer disableport命令,设置在disableport-temporarily模式下系统暂时断开端口连接的时间。

 

【描述】

port-security intrusion-mode命令用来设置Intrusion Protection特性被触发后,设备采取的相应动作。undo port-security intrusion-mode命令用来取消设置的相应动作。

缺省情况下,系统没有设置Intrusion Protection特性被触发后,设备采取的相应动作。

&  说明:

Intrusion Protection特性是指端口通过检测接收到的数据帧的源MAC地址或802.1x认证的用户名密码,发现非法报文或非法事件,并采取相应的动作,包括暂时断开端口连接、永久断开端口连接或是过滤此MAC地址的报文,保证了端口的安全性。

以下情况会触发Intrsion Protuction特性:

l      当端口禁止MAC地址学习时,收到的源地址为未知MAC地址的报文;

l      当端口允许接入的MAC地址数达到设置的最大值时,收到的源地址为未知MAC地址的报文;

l      用户使用802.1x认证和MAC地址认证失败。

 

当用户配置了port-security intrusion-mode blockmac后,只能通过display port-security命令查看处于Blocked状态的MAC地址信息,且此类MAC地址不能再被配置为静态MAC地址。

【举例】

# 进入系统视图。

<H3C> system-view

System View: return to User View with Ctrl+Z.

# 使能端口的安全功能。

[H3C] port-security enable

# 进入Ethernet1/0/1以太网端口视图。

[H3C] interface Ethernet1/0/1

# 设置端口Ethernet1/0/1的Intrusion Protection特性被触发后,设备采取的安全模式为disableport

[H3C-Ethernet1/0/1] port-security intrusion-mode disableport

1.1.6  port-security authorization ignore

【命令】

port-security authorization ignore

undo port-security authorization ignore

【视图】

以太网端口视图

【参数】

【描述】

port-security authorization ignore命令用来配置当前端口不应用RADIUS服务器下发的授权信息。undo port-security authorization ignore命令用来恢复系统的缺省配置。

缺省情况下,端口将应用RADIUS服务器下发的授权信息。

l              配置port-security authorization ignore后,如果执行display port-security interface命令,将显示“Authorization is ignore”的信息。

l              配置undo port-security authorization ignore后,如果执行display port-security interface,将显示“Authorization is permit”的信息。

【举例】

# 配置端口Ethernet1/0/2不应用RADIUS服务器下发的授权信息。

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] interface Ethernet1/0/2

[H3C-Ethernet1/0/2] port-security authorization ignore

1.1.7  port-security max-mac-count

【命令】

port-security max-mac-count count-value

undo port-security max-mac-count

【视图】

以太网端口视图

【参数】

count-value:最大MAC地址数,取值范围为1~1024。

【描述】

port-security max-mac-count命令用来设置端口允许接入的最大MAC地址数,该数值包括通过802.1x认证MAC地址数、通过集中式MAC地址认证的MAC地址数和Security MAC地址数。undo port-security max-mac-count命令用来取消该限制。

缺省情况下,端口允许接入的最大MAC地址数不受限制。

【举例】

# 进入系统视图。

<H3C> system-view

System View: return to User View with Ctrl+Z.

# 使能端口的安全功能。

[H3C] port-security enable

# 进入Ethernet1/0/1以太网端口视图。

[H3C] interface Ethernet1/0/1

# 设置端口允许接入的最大MAC地址数为100。

[H3C-Ethernet1/0/1] port-security max-mac-count 100

1.1.8  port-security ntk-mode

【命令】

port-security ntk-mode { ntkonly | ntk-withbroadcasts | ntk-withmulticasts }

undo port-security ntk-mode

【视图】

以太网端口视图

【参数】

ntkonly:表示只有目的MAC地址是已认证的MAC地址的单播报文才能被成功传送。

ntk-withbroadcasts:表示广播报文和目的MAC地址是已认证的MAC地址的单播报文能够被成功传送。

ntk-withmulticasts:表示组播报文、广播报文以及目的MAC地址是已认证的MAC地址的单播报文能够被成功传送。

【描述】

port-security ntk-mode命令用来设置NTK特性被触发后报文的传送模式。undo port-security ntk-mode命令用来取消设置的报文传送模式。

缺省情况下,系统没有设置NTK特性被触发后报文的传送模式。

关于NTK特性被触发的具体条件,请参见表1-2

&  说明:

NTK(Need To Know)特性通过检测从端口发出的数据帧的目的MAC地址,保证数据帧只能被发送到已经通过认证的设备上,从而防止非法设备窃听网络数据。

 

【举例】

# 进入系统视图。

<H3C> system-view

System View: return to User View with Ctrl+Z.

# 使能端口的安全功能。

[H3C] port-security enable

# 进入Ethernet1/0/1以太网端口视图。

[H3C] interface Ethernet1/0/1

# 设置端口Ethernet1/0/1的NTK特性的报文传送模式为ntk-withbroadcasts

[H3C-Ethernet1/0/1] port-security ntk-mode  ntk-withbroadcasts

1.1.9  port-security oui

【命令】

port-security oui OUI-value index index-value

undo port-security oui index id-value

【视图】

系统视图

【参数】

OUI-value:OUI值,由一个完整的MAC地址(十六进制)表示。注意不能为组播地址。

index-value:OUI的索引值,取值范围为1~16。

&  说明:

l      OUI(Organizationally Unique Identifier)是IEEE为不同设备供应商分配的一个全球唯一的标识符,是MAC地址的前24位。

l      在以上命令输入OUI-value参数值时,用户只需要输入一个完整的十六进制MAC地址,设备将自动进行十六进制到二进制的数据转换,并将转换后的二进制数据的前24位作为OUI值。

 

【描述】

port-security oui命令用来设置认证中需要的OUI值。undo port-security oui命令用来取消设置的OUI值。

  注意:

该命令设置的OUI值,只有当命令port-security port-mode设置的端口安全模式为userlogin-withoui时才会生效。

 

相关命令可以参考port-security port-mode

【举例】

# 设置一个MAC地址为00ef-ec00-0000的OUI值,索引号为5。

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] port-security oui 00ef-ec00-0000 index 5

1.1.10  port-security port-mode

【命令】

port-security port-mode mode

undo port-security port-mode

【视图】

以太网端口视图

【参数】

mode:端口的安全模式。关于端口安全模式的具体类型请参见表1-2

【描述】

port-security port-mode命令用来配置端口的安全模式。undo port-security port-mode命令用来恢复端口的正常工作模式。

Port Security特性的主要功能就是通过定义各种安全模式,让设备学习到合法的源MAC地址,以达到相应的网络管理效果。对于不能通过安全模式学习到源MAC地址的报文,将被视为非法报文。

对于端口安全模式的具体描述,请参见表1-2

表1-2 端口安全模式描述表

安全模式类型

描述

特性说明

autolearn

此模式下,端口学习到的MAC地址会转变为Security MAC地址;

当端口下的Security MAC地址数超过port-security max-mac-count命令配置的数目后,端口模式会自动转变为secure模式;

之后,该端口不会再添加新的Security MAC,只有源MAC为Security MAC或已配置的动态MAC的报文,才能通过该端口

在左侧列出的模式下,当设备发现非法报文后,将触发NTK特性和Intrusion Protection特性

secure

禁止端口学习MAC地址,只有源MAC为端口已经学习到的Security MAC、已配置的静态MAC或已配置的动态MAC的报文,才能通过该端口

userlogin

对接入用户采用基于端口的802.1x认证

此模式下NTK特性和Intrusion Protection特性不会被触发

userlogin-secure

接入用户必须先通过802.1x认证,认证成功后端口开启,但也只允许认证成功的用户报文通过;

此模式下,端口最多只允许接入一个经过802.1x认证的用户;

当端口从正常模式进入此安全模式时,端口下原有的动态MAC地址表项和已认证的MAC地址表项将被自动删除

在左侧列出的模式下,当设备发现非法报文后,将触发Need To Know特性和Intrusion Protection特性

userlogin-withoui

userlogin-secure类似,端口最多只允许一个802.1x认证用户,但同时,端口还允许一个oui地址的报文通过;

当用户从端口的正常模式进入此模式时,端口下原有的动态MAC地址表项和已认证的MAC地址表项将被自动删除

mac-authentication

基于MAC地址对接入用户进行认证

userlogin-secure-or-mac

表示mac-authenticationuserlogin-secure两种模式只要通过其中一种,即表明认证通过

mac-else-userlogin-secure

表示先进行mac-authentication认证,如果成功则表明认证通过,如果失败则再进行userlogin-secure认证

userlogin-secure-ext

userlogin-secure类似,但端口下的802.1x认证用户可以有多个

userlogin-secure-or-mac-ext

userlogin-secure-or-mac类似,但端口下的802.1x认证用户可以有多个

mac-else-userlogin-secure-ext

mac-else-userlogin-secure类似,但端口下的802.1x认证用户可以有多个

 

缺省情况下,端口没有配置安全模式。

【举例】

# 进入系统视图。

<H3C> system-view

System View: return to User View with Ctrl+Z.

# 使能端口的安全功能。

[H3C] port-security enable

# 进入Ethernet1/0/1以太网端口视图。

[H3C] interface Ethernet1/0/1

# 设置交换机Ethernet1/0/1端口为userlogin模式。

[H3C-Ethernet1/0/1] port-security port-mode userlogin

1.1.11  port-security timer disableport

【命令】

port-security timer disableport timer

undo port-security timer disableport

【视图】

系统视图

【参数】

timer:单位为秒,取值范围为20~300,缺省值为20秒。

【描述】

port-security timer disableport命令用来设置系统暂时断开端口连接的时间。undo port-security timer disableport命令用来恢复系统暂时断开端口连接时间的缺省值。

&  说明:

以上命令设置的时间值,是port-security intrusion-mode命令设置为disableport-temporarily模式时,系统暂时断开端口连接的时间。

 

【举例】

# 设置系统断开端口连接的时间为50秒。

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] port-security timer disableport 50

1.1.12  port-security trap

【命令】

port-security trap { addresslearned | intrusion | dot1xlogon | dot1xlogoff | dot1xlogfailure | ralmlogon | ralmlogoff | ralmlogfailure }*

undo port-security trap { addresslearned | intrusion | dot1xlogon | dot1xlogoff | dot1xlogfailure | ralmlogon | ralmlogoff | ralmlogfailure }*

【视图】

系统视图

【参数】

addresslearned:MAC地址学习。

intrusion:发现入侵报文。

dot1xlogon:802.1x用户上线。

dot1xlogoff:802.1x用户下线。

dot1xlogfailure:802.1x用户认证失败。

ralmlogon:RALM用户上线。

ralmlogoff:RALM用户下线。

ralmlogfailure:RALM用户认证失败。

&  说明:

RALM(RADIUS Authenticated Login using MAC-address)是指基于MAC地址的RADIUS认证。

 

【描述】

port-security trap命令用来打开指定Trap信息的发送开关。undo port-security trap命令用来关闭指定Trap信息的发送开关。

缺省情况下,Trap信息的发送开关处于关闭状态。

&  说明:

该过程使用了设备的Device Tracking特性。Device Tracking特性是指当端口有特定的数据包(由非法入侵,用户不正常上下线等原因引起)传送时,设备将会发送Trap信息,便于用户对这些特殊的行为进行监控。

 

当使用display port-security查看全局信息时,系统将显示哪些Trap信息发送开关已经打开。

相关命令可以参考display port-security

【举例】

# 打开发现入侵报文的Trap信息发送开关。

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] port-security trap intrusion

 


第2章  端口绑定

2.1  端口绑定命令

2.1.1  am user-bind interface

【命令】

am user-bind mac-addr mac-address ip-addr ip-address interface interface-type interface-number

undo am user-bind mac-addr mac-address ip-addr ip-address interface interface-type interface-number

【视图】

系统视图

【参数】

mac-address:绑定的MAC地址值。

ip-address:绑定的IP地址值。

interface-type:端口类型。

interface-number:端口编号。

【描述】

am user-bind interface命令用来将合法用户的MAC地址和IP地址绑定到指定的端口上。undo am user-bind interface命令用来取消MAC地址和IP地址与指定端口的绑定。

进行绑定操作后,只有合法用户的报文才能通过端口。

&  说明:

对同一个MAC地址,系统只允许进行一次绑定操作。

 

【举例】

# 将MAC地址为00e0-fc00-5101,IP地址为10.153.1.1的合法用户与端口Ethernet1/0/1进行绑定。

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] am user-bind mac-addr 00e0-fc00-5101 ip-addr 10.153.1.1 interface Ethernet1/0/1

2.1.2  am user-bind

【命令】

am user-bind mac-addr mac-address ip-addr ip-address

undo am user-bind mac-addr mac-address ip-addr ip-address

【视图】

以太网端口视图

【参数】

mac-address:绑定的MAC地址值。

ip-address:绑定的IP地址值。

【描述】

am user-bind命令用来将合法用户的MAC地址和IP地址绑定到当前的端口上。undo am user-bind命令用来取消MAC地址和IP地址与当前端口的绑定。

进行绑定操作后,只有合法用户的报文才能通过端口。

&  说明:

对同一个MAC地址,系统只允许进行一次绑定操作。

 

【举例】

# 将MAC地址为00e0-fc00-5102,IP地址为10.153.1.2的合法用户与端口Ethernet1/0/2进行绑定。

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] interface Ethernet1/0/2

[H3C-Ethernet1/0/2] am user-bind mac-addr 00e0-fc00-5102 ip-addr 10.153.1.2

2.1.3  display am user-bind

【命令】

display am user-bind [ interface interface-type interface-number | mac-addr mac-addr | ip-addr ip-addr ]

【视图】

任意视图

【参数】

interface:显示指定端口的绑定信息。

interface-type:端口类型。

interface-number:端口编号。

mac-addr mac-addr显示指定MAC地址的绑定信息。

ip-addr ip-addr:显示指定IP地址的绑定信息。

【描述】

display am user-bind命令用来显示端口绑定的配置信息。

【举例】

# 显示当前系统端口绑定的配置信息。

<H3C> display am user-bind

Following User address bind have been configured:

  Mac                   IP                    Port

  00e0-fc00-5101        10.153.1.1            Ethernet1/0/1

  00e0-fc00-5102        10.153.1.2            Ethernet1/0/2

 Unit 1:Total 2 found, 2 listed.

 

 Total: 2 found.

以上显示信息表示,设备Unit 1当前总共有两条端口绑定的配置:

l              MAC地址00e0-fc00-5101、IP地址10.153.1.1已经与端口Ethernet1/0/1进行了绑定;

l              MAC地址00e0-fc00-5102、IP地址10.153.1.2已经与端口Ethernet1/0/2进行了绑定。

 

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们