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

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

17-MAC地址认证命令

本章节下载 17-MAC地址认证命令  (157.9 KB)

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

17-MAC地址认证命令


1 MAC地址认证配置命令

1.1  MAC地址认证基本功能配置命令

1.1.1  display mac-authentication

【命令】

display mac-authentication [ interface interface-list ]

【视图】

任意视图

【参数】

interface interface-list:以太网端口列表,表示方式为interface-list={ interface-type interface-number [ to interface-type interface-number ] } &<1-10>。其中interface-type为端口类型,interface-number为端口号。命令中&<1-10>表示前面的参数最多可以重复输入10次。

【描述】

display mac-authentication命令用来显示MAC地址认证相关信息。

【举例】

# 显示MAC地址认证的全局信息。

<device> display mac-authentication

Mac address authentication is Enabled.

 Authentication mode is UsernameAsMacAddress usernameformat with-hyphen lowercase

 Fixed username:mac

 Fixed password:not configured

          Offline detect period is 300s

          Quiet period is 60 second(s).

          Server response timeout value is 100s

          Guest VLAN re-authenticate period is 30s 

          Max allowed user number is 1024

          Current user number amounts to 1

          Current domain: not configured, use default domain

Silent Mac User info:

          MAC ADDR             From Port               Port Index

GigabitEthernet1/0/1 is link-up

  MAC address authentication  is Enabled

  max-auth-num is 256

  Guest VLAN is 2                            

  Authenticate success: 1, failed: 0

  Current online user number is 1

    MAC ADDR         Authenticate state           AuthIndex

   000d-88f8-4e71   MAC_AUTHENTICATOR_SUCCESS     0

……(以下略)

表1-1 display mac-authentication命令显示信息描述表

字段

描述

Mac address authentication is Enabled

MAC地址认证特性已经开启

Authentication mode

MAC地址认证用户名的形式,缺省为采用MAC地址用户名

Fixed username

采用固定用户名时的用户名,缺省为“mac”

Fixed password

采用固定用户名时的密码,缺省未配置

Offline detect period

下线检测定时器,用来设置检测用户是否下线的时间间隔,缺省值为300秒

Quiet period

静默定时器,设置对用户认证失败以后,设备的静默时间,缺省为60秒

Server response timeout value

服务器连接超时定时器,用于设置与RADIUS服务器连接超时时间,缺省为100秒

Guest VLAN re-authenticate period

设备对Guest VLAN内的用户进行重认证的时间间隔,缺省为30秒

Max allowed user number

设备支持的最大用户数,缺省为1024个

Current user number amounts to

当前用户数

Crrent domain

当前使用的域,缺省未配置

Silent Mac User info

静默用户信息。当用户因为输入错误的用户名/密码而未通过MAC地址认证时,设备将该用户设置为静默,静默期间设备不处理该用户的认证请求

GigabitEthernet1/0/1 is link-up

端口GigabitEthernet1/0/1链路处于UP状态

MAC address authentication is Enabled

端口GigabitEthernet1/0/1MAC地址认证特性已开启

max-auth-num

端口允许接入的MAC地址认证用户的最大数量,缺省为256

Guest VLAN

端口的Guest VLAN

Authenticate success: 1, failed: 0

端口上MAC地址认证的统计信息,包括认证通过和认证失败的数目

Current online user number

端口当前的接入用户数

MAC ADDR

端口所连接的远程MAC地址

Authenticate state

端口接入用户的状态,共有四种:

l      MAC_AUTHENTICATOR_CONNECTING:正在连接

l      MAC_AUTHENTICATOR_SUCCESS:认证通过

l      MAC_AUTHENTICATOR_FAILURE:认证失败

l      MAC_AUTHENTICATOR_LOGOFF:已下线

AuthIndex

当前MAC地址在认证端口下的索引值

 

1.1.2  mac-authentication

【命令】

mac-authentication

undo mac-authentication

【视图】

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

【参数】

【描述】

mac-authentication命令用来开启全局或当前端口的MAC地址认证特性。undo mac-authentication命令用来关闭全局或当前端口的MAC地址认证特性。

缺省情况下,全局及所有端口的MAC地址认证特性都处于关闭状态。

在系统视图下使用该命令时,表示开启全局的MAC地址认证特性。在以太网端口视图下使用该命令时,表示开启当前视图所在端口的MAC地址认证特性。

各端口的MAC地址认证状态在全局开启之前可以配置,但不会生效;在全局MAC地址认证开启后,已使能MAC地址认证的端口将立即开始进行认证操作。

 

【举例】

# 开启全局的MAC地址认证特性。

<device> system-view

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

[device] mac-authentication

MAC-Authentication is enabled globally.

# 开启端口GigabitEthernet1/0/1的MAC地址认证特性。

[device] interface GigabitEthernet 1/0/1

[device-GigabitEthernet1/0/1] mac-authentication

1.1.3  mac-authentication interface

【命令】

mac-authentication interface interface-list

undo mac-authentication 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次。

【描述】

mac-authentication interface命令用来开启指定端口上的MAC地址认证特性。undo mac-authentication interface命令用来关闭指定端口上的MAC地址认证特性。

缺省情况下,所有端口的MAC地址认证特性都处于关闭状态。

l    全局MAC地址认证特性开启后,必须再开启端口的MAC地址认证特性,MAC地址认证的配置才能在端口上生效;

l    如果端口开启了MAC地址认证特性,则不能配置该端口的最大MAC地址学习个数(通过命令mac-address max-mac-count配置);反之,如果端口配置了最大MAC地址学习个数,则禁止在该端口上开启MAC地址认证特性。

 

【举例】

# 开启以太网端口GigabitEthernet 1/0/1上的MAC地址认证特性。

<device> system-view

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

[device] mac-authentication interface GigabitEthernet 1/0/1

1.1.4  mac-authentication authmode usernameasmacaddress

【命令】

mac-authentication authmode usernameasmacaddress [ usernameformat { with-hyphen | without-hyphen } { lowercase | uppercase } | fixedpassword password ]

undo mac-authentication authmode usernameasmacaddress [ usernameformat  | fixedpassword ]

【视图】

系统视图

【参数】

usernameformat:设置用户名和密码的输入格式。

with-hyphen:输入用户名密码时使用带有分隔符“-”的MAC地址,例如“00-05-e0-1c-02-e3”。

without-hyphen:输入用户名密码时使用不带有分隔符“-”的MAC地址,例如“0005e01c02e3”。

lowercase:MAC地址格式为小写格式。

uppercase:MAC地址格式为大写格式。

fixedpassword设置MAC地址认证时采用MAC地址用户名形式下的固定密码。

password:表示认证时使用的密码,长度为1~63个字符的字符串。

【描述】

mac-authentication authmode usernameasmacaddress命令用来设置MAC地址认证时采用MAC地址用户名形式。undo mac-authentication authmode命令用来恢复MAC地址认证时采用的用户名形式为缺省情况。

缺省情况下,MAC地址认证时采用的用户名、密码为MAC地址形式。

【举例】

# 设置MAC地址认证时采用的用户名形式为MAC地址用户名,使用带有分隔符的小写格式输入MAC地址作为用户名和密码。

<device> system-view

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

[device] mac-authentication authmode usernameasmacaddress usernameformat with-hyphen lowercase

1.1.5  mac-authentication authmode usernamefixed

【命令】

mac-authentication authmode usernamefixed

undo mac-authentication authmode

【视图】

系统视图

【参数】

【描述】

mac-authentication authmode usernamefixed命令用来设置MAC地址认证时采用固定用户名形式。undo mac-authentication authmode命令用来恢复MAC地址认证时采用的用户名形式为缺省情况。

缺省情况下,系统采用MAC地址用户名进行认证。

【举例】

# 设置MAC地址认证时采用固定用户名形式。

<device> system-view

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

[device] mac-authentication authmode usernamefixed

1.1.6  mac-authentication authpassword

【命令】

mac-authentication authpassword password

undo mac-authentication authpassword

【视图】

系统视图

【参数】

password:表示认证时使用的密码,长度为1~63个字符的字符串。

【描述】

mac-authentication authpassword命令用来设置MAC地址认证采用固定用户名形式时的密码。undo mac-authentication authpassword命令用来取消设置的密码。

缺省情况下,未配置固定用户名的密码。

【举例】

# 设置固定用户名方式的密码为newmac。

<device> system-view

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

[device] mac-authentication authpassword newmac

1.1.7  mac-authentication authusername

【命令】

mac-authentication authusername username

undo mac-authentication authusername

【视图】

系统视图

【参数】

username:表示认证时使用的用户名,为长度不超过55个字符的字符串。

【描述】

mac-authentication authusername命令用来设置采用固定用户名形式时的用户名。undo mac-authentication authusername命令用来将用户名恢复为系统缺省情况。

缺省情况下,固定用户名形式时的用户名为mac。

【举例】

# 设置固定用户名形式认证的用户名为vipuser。

<device> system-view

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

[device] mac-authentication authusername vipuser

1.1.8  mac-authentication domain

【命令】

mac-authentication domain isp-name

undo mac-authentication domain

【视图】

系统视图

【参数】

isp-name:ISP域名。为不超过128个字符的非空字符串,且不能包括“/”、“:”、“*”、“?”、“<”以及“>”等特殊字符。

【描述】

mac-authentication domain命令用来配置MAC地址认证用户所使用的ISP域。undo mac-authentication domain命令用来恢复MAC地址认证用户所使用的ISP域为缺省情况。

缺省情况下,使用缺省ISP域system。

【举例】

# 配置MAC地址使用的域为cams。

<device> system-view

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

[device] mac-authentication domain cams

1.1.9  mac-authentication timer

【命令】

mac-authentication timer { offline-detect offline-detect-value | quiet quiet-value | server-timeout server-timeout-value }

undo mac-authentication timer { offline-detect | quiet | server-timeout }

【视图】

系统视图

【参数】

offline-detect-value:下线检测定时器的值,用来设置设备检查用户是否已经下线的时间间隔。取值范围1~65535,单位为秒。缺省值为300秒。

quiet-value:静默定时器的值。对用户认证失败以后,设备需要静默一段时间后再处理用户认证请求,在静默期间,设备不处理该用户的认证请求。取值范围1~3600,单位为秒。缺省值为60秒。

server-timeout-value:服务器超时定时器的值。在用户的认证过程中,如果设备同RADIUS 服务器的连接超时,则此次认证失败。取值范围为1~65535,单位为秒。缺省值为100秒。

【描述】

mac-authentication timer命令用来配置MAC地址认证的各项定时器参数。undo mac-authentication timer命令用来将指定的定时器恢复为缺省值。

相关可参考命令display mac-authentication

【举例】

# 设置服务器超时定时器时长为150秒。

<device> system-view

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

[device] mac-authentication timer server-timeout 150

1.1.10  reset mac-authentication

【命令】

reset mac-authentication statistics [ 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次。

【描述】

reset mac-authentication命令用来清除MAC地址认证的统计信息。当指定interface参数时,表示清除指定端口上的MAC地址认证统计信息;不指定interface参数时,表示清除全局MAC地址认证统计信息。

【举例】

# 清除端口GigabitEthernet 1/0/1上的MAC地址认证统计信息。

<device> reset mac-authentication statistics interface GigabitEthernet 1/0/1

1.2  MAC地址认证增强功能配置命令

1.2.1  mac-authentication guest-vlan

【命令】

mac-authentication guest-vlan vlan-id

undo mac-authentication guest-vlan

【视图】

以太网端口视图

【参数】

vlan-id:为当前端口配置的Guest VLAN的VLAN ID,取值范围为1~4094。

【描述】

mac-authentication guest-vlan命令用来配置当前端口的Guest VLAN,如果端口连接的客户端认证失败,该端口将被加入Guest VLAN,接入用户可以访问Guest VLAN中的网络资源。undo mac-authentication guest-vlan命令用来取消端口的Guest VLAN配置。

缺省情况下,没有配置端口的Guest VLAN。

l    当端口连接的客户端数量大于1时,将不能配置该端口的Guest VLAN。当端口配置了Guest VLAN后,该端口也将只允许一个MAC地址认证用户接入,即使配置的MAC地址认证用户的最大数目限制大于1,也将不会生效。

l    被配置为Guest VLAN的VLAN不能使用undo vlan命令直接删除,必须先删除Guest VLAN配置,才能够删除。undo vlan命令请参见本手册“VLAN”部分的介绍。

l    一个端口只能配置一个Guest VLAN,对应的VLAN必须已经存在,否则将会配置失败。如果需要修改当前端口的Guest VLAN,需要先删除之前的Guest VLAN配置,再重新进行配置。

l    在配置了端口的Guest VLAN后,将不能在此端口开启802.1x认证功能。

l    MAC地址认证的Guest VLAN功能在端口安全开启的情况下不生效。

 

相关配置可参考命令mac-authentication timer guest-vlan-reauth

【举例】

# 配置以太网端口GigabitEthernet1/0/1的Guest VLAN为VLAN4。

<device> system-view

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

[device] interface GigabitEthernet 1/0/1

[device-GigabitEthernet1/0/1] mac-authentication guest-vlan 4

1.2.2  mac-authentication max-auth-num

【命令】

mac-authentication max-auth-num user-number

undo mac-authentication max-auth-num

【视图】

以太网端口视图

【参数】

user-number:端口允许接入的MAC地址认证用户的最大数量,取值范围为1~256。

【描述】

mac-authentication max-auth-num命令用来配置当前端口可以接入的MAC地址认证用户的最大数量,当接入用户到达配置的限制数量时,设备将不会再对之后接入的用户进行认证触发动作,这些用户也就无法正常访问网络。undo mac-authentication max-auth-num用来恢复该配置的缺省值。

缺省情况下,端口允许接入的MAC地址认证用户的最大数量为256个。

l    当端口下同时配置了MAC地址认证用户数量限制和端口安全的用户数量限制时,允许接入的MAC地址认证用户数将为这两种配置中的较小值。端口安全功能的介绍请参见本手册“端口安全”部分。

l    当端口当前有用户在线时,不能配置此端口的MAC地址认证用户的最大数量。

 

【举例】

# 配置以太网端口GigabitEthernet1/0/2最多允许100个MAC地址认证用户接入。

<device> system-view

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

[device] interface GigabitEthernet 1/0/2

[device-GigabitEthernet1/0/2] mac-authentication max-auth-num 100

1.2.3  mac-authentication timer guest-vlan-reauth

【命令】

mac-authentication timer guest-vlan-reauth interval

undo mac-authentication timer guest-vlan-reauth

【视图】

系统视图

【参数】

interval:配置设备对Guest VLAN内的用户进行重认证的时间间隔,取值范围为1~3600,单位为秒。

【描述】

mac-authentication timer guest-vlan-reauth命令用来配置设备对Guest VLAN内的用户进行重认证的时间间隔。undo mac-authentication timer guest-vlan-reauth用来恢复重认证时间间隔为缺省值。

缺省情况下,设备对Guest VLAN内用户进行重认证的时间间隔为30秒。

【举例】

# 配置设备每隔60秒对Guest VLAN内的用户进行重认证。

<device> system-view

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

[device] mac-authentication timer guest-vlan-reauth 60

 

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

新华三官网
联系我们