22-集中式MAC地址认证命令
本章节下载 (143.25 KB)
目 录
1.1.1 display mac-authentication
1.1.3 mac-authentication interface
1.1.4 mac-authentication authmode usernameasmacaddress
1.1.5 mac-authentication authmode usernamefixed
1.1.6 mac-authentication authpassword
1.1.7 mac-authentication authusername
1.1.8 mac-authentication domain
1.1.9 mac-authentication timer
1.1.10 reset mac-authentication
【命令】
display 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次。
【描述】
display mac-authentication命令用来显示集中式MAC地址认证的全局信息,包括是否开启集中式MAC地址认证特性、当前各个定时器的值、在线用户个数、处于静默期的MAC地址以及各个接口的MAC认证情况。
【举例】
# 显示集中式MAC地址认证的全局信息。
<H3C> display mac-authentication
mac address authentication is Enabled.
authentication mode is UsernameAsMacAddress
Fixed username:mac
Fixed password:not configured
offline detect period is 300s
quiet period is 60s.
server response timeout value is 100s
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
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 集中式MAC地址认证配置信息描述表
域名 |
描述 |
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秒 |
max allowed user number |
交换机支持的最大用户数,缺省为1024 |
current user number amounts to |
当前用户数 |
current domain |
当前使用的域,缺省未配置 |
Silent Mac User info |
静默用户信息。当用户因为输入错误的用户名/密码而未通过MAC地址认证时,交换机将该用户设置为静默,静默期间交换机不处理该用户的认证请求 |
GigabitEthernet1/0/1 is link-up |
端口GigabitEthernet1/0/1链路处于UP状态 |
MAC address authentication is Enabled |
端口GigabitEthernet1/0/1MAC地址认证特性已开启 |
Authenticate success: 1, failed: 0 |
端口上MAC地址认证的统计信息,包括认证通过和认证失败的数目 |
Current online user number |
端口当前的接入用户数 |
MAC ADDR |
端口所连接的远程MAC地址 |
Authenticate state |
端口接入用户的状态,共有四种: MAC_AUTHENTICATOR_CONNECTING:正在连接 MAC_AUTHENTICATOR_SUCCESS:认证通过 MAC_AUTHENTICATOR_FAILURE:认证失败 MAC_AUTHENTICATOR_LOGOFF:已下线 |
AuthIndex |
当前MAC地址在认证端口下的索引值 |
【命令】
mac-authentication
undo mac-authentication
【视图】
系统视图/以太网端口视图
【参数】
无
【描述】
mac-authentication命令用来启动全局或当前端口的集中式MAC地址认证特性。undo mac-authentication命令用来关闭全局或当前端口的集中式MAC地址认证特性。
缺省情况下,全局及所有端口的集中式MAC地址认证特性都处于关闭状态。
在系统视图下使用该命令时,表示开启全局的集中式MAC地址认证特性。在以太网端口视图下使用该命令时,表示开启当前视图所在端口的集中式MAC地址认证特性。
& 说明:
集中式MAC地址认证特性启动前后,都可以使用命令来配置全局或端口的集中式MAC地址认证特性参数。如果在开启全局集中式MAC地址认证特性前,没有配置全局或端口的集中式MAC地址认证特性参数,则这些参数在运行时均为缺省值。
【举例】
# 开启全局的集中式MAC地址认证特性。
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] mac-authentication
MAC-Authentication is already enabled globally.
# 开启端口GigabitEthernet1/0/1的集中式MAC地址认证特性。
[H3C] interface GigabitEthernet 1/0/1
[H3C-GigabitEthernet1/0/1] mac-authentication
【命令】
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地址认证特性。
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] mac-authentication interface GigabitEthernet 1/0/1
【命令】
mac-authentication authmode usernameasmacaddress [ usernameformat { with-hyphen | without-hyphen } ]
undo mac-authentication authmode
【视图】
系统视图
【参数】
usernameformat:设置用户名和密码的输入格式。
with-hyphen:输入用户名密码时使用带有分隔符“-”的MAC地址,例如“00-05-e0-1c-02-e3”。
without-hyphen:输入用户名密码时使用不带有分隔符“-”的MAC地址,例如“0005e01c02e3”。
【描述】
mac-authentication authmode usernameasmacaddress命令用来设置集中式MAC地址认证的方式为MAC方式。undo mac-authentication authmode命令用来恢复集中式MAC地址认证的认证方式为缺省值。
缺省情况下,集中式MAC地址认证的认证方式为MAC地址方式
【举例】
# 设置集中式MAC地址认证采用MAC地址方式,使用带有分隔符的格式输入MAC地址作为用户名和密码。
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] mac-authentication authmode usernameasmacaddress usernameformat with-hyphen
【命令】
mac-authentication authmode usernamefixed
undo mac-authentication authmode
【视图】
系统视图
【参数】
无
【描述】
mac-authentication authmode usernamefixed命令用来设置集中式MAC地址认证的方式为固定方式。undo mac-authentication authmode命令用来恢复集中式MAC地址认证的认证方式为缺省值。
缺省情况下,系统采用MAC地址方式进行认证。
【举例】
# 设置集中式MAC地址认证采用固定方式。
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] mac-authentication authmode usernamefixed
【命令】
mac-authentication authpassword password
undo mac-authentication authpassword
【视图】
系统视图
【参数】
password:表示认证时使用的密码,长度为1~63个字符的字符串。
【描述】
mac-authentication authpassword命令用来设置集中式MAC地址认证采用固定方式时的密码。undo mac-authentication authpassword命令用来取消设置的密码。
缺省情况下,未配置固定方式时的密码。
【举例】
# 设置固定方式的密码为mac。
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] mac-authentication authpassword mac
【命令】
mac-authentication authusername username
undo mac-authentication authusername
【视图】
系统视图
【参数】
username:长度为1~55个字符的字符串,表示认证时使用的用户名。
【描述】
mac-authentication authusername命令用来设置采用固定方式时的用户名;undo mac-authentication authusername命令用来将用户名恢复为系统缺省值。
缺省情况下,固定方式时的用户名为mac。
【举例】
# 设置固定方式认证的用户名为vipuser。
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] mac-authentication authusername vipuser
【命令】
mac-authentication domain isp-name
undo mac-authentication domain
【视图】
系统视图
【参数】
isp-name:ISP域名。为不超过24个字符的非空字符串,且不能包括“/”、“:”、“*”、“?”、“<”以及“>”等特殊字符。
【描述】
mac-authentication domain命令用来配置集中式MAC地址认证用户所使用的ISP域。undo mac-authentication domain命令用来恢复集中式MAC地址认证用户所使用的ISP域为缺省值。
缺省情况下,未配置认证用户使用的域,使用“default domain”作为ISP域名。
【举例】
# 配置MAC地址使用的域为Cams。
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] mac-authentication domain Cams
【命令】
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 Server的连接超时,交换机将在相应的端口上禁止此用户访问网络。取值范围为1~65535,单位为秒。缺省值为100秒。
【描述】
mac-authentication timer命令用来配置集中式MAC地址认证的各项定时器参数。undo mac-authentication timer命令用来将指定的定时器恢复为缺省值。
相关可参考命令display mac-authentication。
【举例】
# 设置服务器超时定时器时长为150秒。
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] mac-authentication timer server-timeout 150
【命令】
reset mac-authentication statistics [ interface interface-type interface-number ]
【视图】
用户视图
【参数】
interface-type:端口类型。
interface-number:端口编号
【描述】
reset mac-authentication 命令用来清除集中式MAC地址认证的统计信息。当使用interface参数时,表示清除指定端口上的集中式MAC地址认证统计信息;不使用interface参数时,表示清除全局集中式MAC地址认证统计信息。
【举例】
# 清除端口GigabitEthernet 1/0/1上的集中式MAC地址认证统计信息。
<H3C> reset mac-authentication statistics interface GigabitEthernet 1/0/1
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!