下面是是我交换机配置
sysname C2-9.23
#
domain default enable ac-domain
#
ipv6
#
dot1x
dot1x retry 5
dot1x authentication-method eap
#
mac-authentication
mac-authentication user-name-format mac-address with-hyphen
#
password-recovery enable
#
vlan 1
#
vlan 10
description yjy
#
vlan 20
description tangyun
#
vlan 30
description devmg
#
vlan 40
#
radius scheme 1x-ca
primary authentication 6.6.6.16
primary accounting 6.6.6.16
key authentication cipher $c$3$JkEw+aqEliZT8i5ot69Kg9wupeHImlbI5xEYbqkp4g==
key accounting cipher $c$3$4HdPXihBtw0PFkxz5oxtJcpQR5pQm9ja8W6aOKQ2zw==
user-name-format without-domain
#
domain ac-domain
authentication lan-access radius-scheme 1x-ca
authorization lan-access radius-scheme 1x-ca
accounting lan-access radius-scheme 1x-ca
access-limit disable
state active
idle-cut disable
self-service-url disable
domain mac-auth
access-limit disable
state active
idle-cut disable
self-service-url disable
domain system
access-limit disable
state active
idle-cut disable
self-service-url disable
#
user-group system
group-attribute allow-guest
问题可能出在接口配置缺失或域名剥离不生效。
你提供的配置中没有包含接口部分的配置,这是关键缺失。你需要确认在连接终端的接口下是否启用了802.1X和MAC认证,并且指定了正确的认证域。
示例接口配置(假设连接终端的接口为GigabitEthernet1/0/1):
dot1x domain ac-domain 确保802.1X认证时使用你配置的 ac-domain 域,该域下已设置 user-name-format without-domain。mac-authentication domain mac-auth 可单独指定MAC认证域,该域下不应配置 user-name-format without-domain(MAC地址本身无域名)。即使配置了 without-domain,也建议通过debug或日志确认交换机实际发给RADIUS的用户名。
User-Name 字段的值。如果仍然带有 @xxx,则说明剥离未生效。在RADIUS服务器(如iMC)上查看认证请求日志,确认收到的用户名格式。如果带域名,则交换机侧剥离失败。
| 现象 | 可能原因 | 解决方法 |
|---|---|---|
| 用户名仍带域名后缀 | 接口下未引用 ac-domain,而是使用了默认域或system域 | 在接口下明确指定 dot1x domain ac-domain |
只配置了全局域 domain default enable ac-domain | 全局默认域只影响未指定域的场景,但802.1X有时不继承 | 接口下显式指定更保险 |
RADIUS方案中 user-name-format 未生效 | 该命令需要在RADIUS方案视图下正确配置,且域中引用了该方案 | 检查 radius scheme 1x-ca 下确实有 user-name-format without-domain,并确认 domain ac-domain 下引用了该方案 |
| 客户端强制发送带域名的用户名(如Windows自动添加) | 某些802.1X客户端(如Windows自带的)会默认发送 user@domain | 修改客户端设置或使用iNode客户端,强制发送不带域名的用户名 |
如果你希望MAC认证时不剥离任何内容(MAC地址本身无域名),可以单独建一个域:
你已经配置了 mac-authentication user-name-format mac-address with-hyphen,这会将MAC地址格式化为 xx-xx-xx-xx-xx-xx 形式。请确保RADIUS服务器上存储的MAC地址也是这种格式。
查看接口下生效的配置:
查看认证会话:
测试802.1X认证:使用iNode客户端或Windows自带客户端,输入不带域名的用户名(或带域名,依赖交换机剥离),观察认证结果。
如果仍然失败:将RADIUS方案中的 user-name-format 临时改为 keep-original,然后在客户端输入带域名的用户名测试,如果此时能成功,说明RADIUS期望的就是带域名的用户名。那么你应该保留 keep-original 或调整RADIUS服务器配置。
暂无评论
domain default enable ac-domain
ac-domainradius scheme 1x-ca
user-name-format without-domain
# 单独给 MAC 认证指定一个 不带域名 的域
mac-authentication domain mac-auth
# 进入这个域,让它使用你的 radius 1x-ca
domain mac-auth
authentication lan-access radius-scheme 1x-ca
authorization lan-access radius-scheme 1x-ca
accounting lan-access radius-scheme 1x-ca
# 强制这个域 不携带域名(关键)
user-name-format without-domain
mac-authentication domain mac-auth→ MAC 认证强制使用 mac-auth 域,不使用全局默认域without-domain→ MAC 地址发送给 RADIUS 时,完全不带域名后缀ac-domain(带域名)ac-domain(带域名)ac-domain(不变)display mac-authentication
Mac authentication domain: mac-auth
mac-authentication user-name-format mac-address with-hyphen
aabb-ccdd-eeffmac-authentication user-name-format mac-address plain
aabbccddeeffmac-authentication domain mac-auth
mac-auth 域引用 radius 并关闭域名MAB 用户名立刻不带后缀!暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论