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

H3C WX3000系列有线无线一体化交换机交换引擎 命令手册-6PW103

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

本章节下载 11-端口安全-端口绑定命令  (204.83 KB)

docurl=/cn/Service/Document_Software/Document_Center/Wlan/WX/H3C_WX3000/Command/Command_Manual/H3C_WX3000_CM-6PW103/200907/643014_30005_0.htm

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


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地址的当前状态、端口编号、MAC地址的老化时间。

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

【举例】

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

<device> display mac-address security interface GigabitEthernet 1/0/1

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

0001-0001-0001  1        Security      GigabitEthernet1/0/1   NOAGED

 

  ---  1 mac address(es) found on port GigabitEthernet1/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参数,则显示指定端口的配置信息。

 

【举例】

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

<device> 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

 GigabitEthernet1/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

MAC地址认证成功的Trap信息已经打开

RALM logoff trap is Enabled

MAC地址认证用户下线的Trap信息已经打开

RALM logfailure trap is Enabled

MAC地址认证失败的Trap信息已经打开

Vlan id assigned is NULL

下发的VLAN为空

Disableport Timeout: 20 s

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

OUI value

OUI的值

GigabitEthernet1/0/1 is link-down

端口GigabitEthernet1/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 ]

以太网端口视图下:

mac-address security mac-address vlan vlan-id

undo mac-address security [ [ mac-address ] vlan vlan-id ]

【视图】

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

【参数】

mac-address:Security MAC地址,格式为H-H-H。

interface-type interface-number :端口类型和端口编号。

vlan-id:Security MAC地址所属的VLAN,取值范围为1~4094。

【描述】

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

缺省情况下,系统没有配置Security MAC地址。

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

 

【举例】

# 在GigabitEthernet1/0/1端口下将0001-0001-0001作为Securiy MAC地址添加到VLAN 1中。

<device> system-view

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

[device] port-security enable

[device] interface GigabitEthernet 1/0/1

[device-GigabitEthernet1/0/1] port-security max-mac-count 100

[device-GigabitEthernet1/0/1] port-security port-mode autolearn

[device-GigabitEthernet1/0/1] mac-address security 0001-0001-0001 vlan 1

1.1.4  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 命令,将显示“Authorization is ignore”的信息。

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

【举例】

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

<device> system-view

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

[device] interface GigabitEthernet 1/0/2

[device-GigabitEthernet1/0/2] port-security authorization ignore

1.1.5  port-security enable

【命令】

port-security enable

undo port-security enable

【视图】

系统视图

【参数】

【描述】

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

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

当用户启动端口安全功能后,端口的如下配置会被自动恢复为(括弧内的)缺省情况:

l    802.1x认证(关闭)、端口接入控制方式(macbased、端口接入控制模式(auto);

l    MAC地址认证(关闭)。

且以上配置不能再进行手动配置,只能随端口安全模式的改变由系统配置。

 

【举例】

# 启动端口的安全功能。

<device> system-view

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

[device] 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.6  port-security intrusion-mode

【命令】

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

undo port-security intrusion-mode

【视图】

以太网端口视图

【参数】

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

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

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

【描述】

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地址。

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

 

【举例】

# 设置端口GigabitEthernet1/0/1的Intrusion Protection特性被触发后,设备采取的相应的动作为disableport

<device> system-view

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

[device] interface GigabitEthernet 1/0/1

[device-GigabitEthernet1/0/1] port-security intrusion-mode disableport

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地址数不受限制。

l    在端口安全模式为macAddressOrUserLoginSecureExt时,用户控制最多有n个认证用户接入网络,当n个认证用户全部接入网络且其中有MAC地址认证用户时,如果希望对MAC地址认证用户再进行802.1x认证,就必须设置最大MAC地址数至少为n+1。同样,在端口安全模式为macAddressOrUserLoginSecure时,就必须设置最大MAC地址数至少为2。

l    在端口安全模式为macAddressAndUserLoginSecureExt时,如果用户希望最多有n个认证用户全部接入网络且第n个用户为802.1x用户,就必须设置最大MAC地址数至少为n+1。同样,在端口安全模式为macAddressAndUserLoginSecure时,就必须设置最大MAC地址数至少为2。

 

【举例】

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

<device> system-view

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

[device] port-security enable

[device] interface GigabitEthernet 1/0/1

[device-GigabitEthernet1/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命令用来配置端口Need To Know特性。undo port-security ntk-mode命令用来恢复缺省配置。

缺省情况下,没有配置端口Need To Know特性,即所有报文都可成功发送。

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

l    目前设备不支持设置Need To Know特性为ntkonly

 

【举例】

# 设置端口GigabitEthernet1/0/1的NTK特性为ntk-withbroadcasts

<device> system-view

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

[device] port-security enable

[device] interface GigabitEthernet 1/0/1

[device-GigabitEthernet1/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地址(十六进制)表示。注意不能为组播MAC地址。

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

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

 

【描述】

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

缺省情况下,未设置认证中需要的OUI值。

l    该命令设置的OUI值,只有当端口安全模式为userLoginWithOUI时才会生效。

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

 

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

【举例】

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

<device> system-view

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

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

1.1.10  port-security port-mode

【命令】

port-security port-mode  { autolearnmac-and-userlogin-secure | mac-and-userlogin-secure-ext | mac-authenticationmac-else-userlogin-securemac-else-userlogin-secure-ext | secureuserlogin | userlogin-secureuserlogin-secure-extuserlogin-secure-or-macuserlogin-secure-or-mac-ext | userlogin-withoui }

undo port-security port-mode

【视图】

以太网端口视图

【参数】

autolearn:设置端口安全模式为autoLearn模式。

mac-and-userlogin-secure:设置端口安全模式为macAddressAndUserLoginSecure模式。

mac-and-userlogin-secure-ext:设置端口安全模式为macAddressAndUserLoginSecureExt模式。

mac-authentication:设置端口安全模式为macAddressWithRadius模式。

mac-else-userlogin-secure:设置端口安全模式为macAddressElseUserLoginSecure模式。

mac-else-userlogin-secure-ext:设置端口安全模式为macAddressElseUserLoginSecureExt模式。

secure:设置端口安全模式为secure模式。

userlogin:设置端口安全模式为userLogin模式。

userlogin-secure:设置端口安全模式为userLoginSecure模式。

userlogin-secure-ext:设置端口安全模式为userLoginSecureExt模式。

userlogin-secure-or-mac:设置端口安全模式为macAddressOrUserLoginSecure模式。

userlogin-secure-or-mac-ext:设置端口安全模式为macAddressOrUserLoginSecureExt模式。

userlogin-withoui:设置端口安全模式为userLoginWithOUI模式。

【描述】

port-security port-mode命令用来配置端口的安全模式。undo port-security port-mode命令用来恢复缺省情况。

缺省情况下,端口处于noRestriction模式,此时该端口处于无限制状态。

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

【举例】

# 设置设备GigabitEthernet1/0/1端口为userlogin模式。

<device> system-view

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

[device] port-security enable

[device] interface GigabitEthernet 1/0/1

[device-GigabitEthernet1/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。

【描述】

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

缺省情况下,系统暂时断开端口连接的时间为20秒。

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

 

【举例】

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

<device> system-view

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

[device] 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:MAC地址认证成功上线。

ralmlogoff:MAC地址认证用户下线。

ralmlogfailure:MAC地址认证失败。

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信息发送开关。

<device> system-view

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

[device] port-security trap intrusion

 


2 端口绑定

2.1  端口绑定命令

2.1.1  am user-bind

【命令】

系统视图下:

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

以太网端口视图下:

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地址值。

interface-type:端口类型。

interface-number:端口编号。

【描述】

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

进行绑定操作后,设备只对从该端口收到的指定MAC地址和IP地址的用户发出的报文进行转发。

缺省情况下,未将用户的MAC地址和IP地址绑定到指定端口上。

对同一个MAC地址和IP地址,系统只允许在端口上进行一次绑定操作。

 

【举例】

# 在系统视图下将MAC地址为00e0-fc00-5101,IP地址为10.153.1.1的合法用户与端口GigabitEthernet1/0/1进行绑定。

<device> system-view

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

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

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

<device> system-view

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

[device] interface GigabitEthernet 1/0/2

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

2.1.2  display am user-bind

【命令】

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

【视图】

任意视图

【参数】

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

interface-type:端口类型。

interface-number:端口编号。

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

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

【描述】

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

【举例】

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

<device> display am user-bind

Following User address bind have been configured:

  Mac                   IP                    Port

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

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

 Unit 1:Total 2 found, 2 listed.

 

 Total: 2 found.

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

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

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

 

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

新华三官网
联系我们