[Device] radius scheme eia-radius
[Device-radius-eia-radius] primary authentication <EIA_IP> 1812
[Device-radius-eia-radius] primary accounting <EIA_IP> 1813
[Device-radius-eia-radius] key authentication simple <YourSecretKey>
[Device-radius-eia-radius] key accounting simple <YourSecretKey>
[Device-radius-eia-radius] user-name-format without-domain[Device] domain mac-domain
[Device-isp-mac-domain] authentication lan-access radius-scheme eia-radius
[Device-isp-mac-domain] authorization lan-access radius-scheme eia-radius
[Device-isp-mac-domain] accounting lan-access radius-scheme eia-radius
[Device-isp-mac-domain] quit# 全局开启并指定域
[Device] mac-authentication
[Device] mac-authentication domain mac-domain
# 在连接哑终端的物理接口下开启
[Device] interface GigabitEthernet1/0/1
[Device-GigabitEthernet1/0/1] mac-authentication
[Device-GigabitEthernet1/0/1] quitmac-authentication offline-keep enablearp static <IP> <MAC>),防止终端私自修改 IP 导致冲突或被仿冒攻击。display mac-authentication connection 查看用户的认证状态是否为 Authenticated;也可登录 EIA 控制台,在“在线用户”列表中确认该 MAC 设备是否成功上线。暂无评论
一、组网与原理
终端 → 核心交换机(开启 MAC 认证)→ RADIUS → EIA 服务器
EIA 上预先录入终端 MAC,认证通过才放通
核心上:全局 + 端口开启 mac-authentication,RADIUS 指向 EIA
二、EIA 侧配置(先做)
1. 添加接入设备(核心交换机)
用户 → 接入策略管理 → 接入设备管理 → 接入设备 → 添加
名称:核心交换机
IP:核心的管理 IP
密钥:simple 123456(和交换机一致)
设备类型:H3C
2. 新增 MAC 用户(哑终端)
用户 → 所有用户 → 新增
用户名:001122aabbcc(无分隔、小写)
密码:同用户名
服务:LAN 接入
3. 认证策略
接入策略管理 → 认证策略 → 新建
认证方式:MAC 地址认证
绑定接入设备、VLAN 等
三、核心交换机配置(重点)
1. 基础配置(IP、路由可达 EIA)
bash
运行
system-view
interface Vlan-interface 100 # 管理VLAN
ip address 192.168.1.1 24
# 路由确保能 ping 通 EIA(例:192.168.1.10)
ip route-static 192.168.1.10 32 192.168.1.254
2. 配置 RADIUS 模板(指向 EIA)
bash
运行
radius scheme eia
primary authentication 192.168.1.10 1812 # EIA IP、认证端口
primary accounting 192.168.1.10 1813 # 计费端口
key simple 123456 # 和EIA接入设备密钥一致
user-name-format without-domain # 不带域名发过去
3. 配置 ISP 域(MAC 认证用)
bash
运行
domain mac-auth
authentication lan-access radius-scheme eia
authorization lan-access radius-scheme eia
accounting lan-access radius-scheme eia
4. 全局开启 MAC 认证、指定格式和域
bash
运行
# 全局开启MAC认证
mac-authentication
# MAC账号格式:无分隔、小写(EIA录入要一致)
mac-authentication user-name-format mac-address without-hyphen lowercase
# 绑定认证域
mac-authentication domain mac-auth
5. 接入端口配置(接终端 / 接入交换机)
bash
运行
interface GigabitEthernet 1/0/1
port link-type trunk
port trunk allow-pass vlan 10 # 业务VLAN
undo dot1x # 关闭802.1X,只做MAC
mac-authentication # 端口开启MAC认证
6. 全局 AAA(可选)
bash
运行
aaa
session-lan-access enable
四、验证命令(排查用)
bash
运行
# 查看全局MAC认证状态
display mac-authentication
# 查看端口MAC认证
display mac-authentication interface GigabitEthernet 1/0/1
# 查看RADIUS统计(是否发请求、是否收到accept)
display radius scheme eia statistics
# 查看在线MAC用户
display mac-authentication online-user
五、常见坑
MAC 格式不一致:交换机是 without-hyphen lowercase,EIA 也必须是这个格式,否则认证失败。
密钥不匹配:交换机 radius key 和 EIA 接入设备密钥必须完全一致。
端口没关 dot1x:会和 MAC 冲突,必须 undo dot1x。
VLAN 不通:认证前端口只放 untag/critical VLAN,认证后才切业务 VLAN。
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论