通信人家园

 找回密码
 注册

只需一步,快速开始

短信验证,便捷登录

搜索

军衔等级:

  上等兵

注册:2011-3-52
跳转到指定楼层
1#
发表于 2025-3-26 16:40:36 |只看该作者 |倒序浏览
H3C设备-802.1X认证配置

冒险湾小网工
不积跬步,无以至千里;不积小流,无以成江海。
15 人赞同了该文章
一、组网拓扑

二、组网需求
Client(192.168.10.100)通过 SW1的端口GE1/0/1 接入网络,SW1对该端口接入的用户Client(192.168.10.100)进行 802.1X认证以控制其访问 Internet,具体要求如下:
1、RADIUS 服务器旁路部署,其 IP 地址为172.16.1.100 作为认证/计费服务器。
2、 端口GE1/0/1 下的所有接入用户均需要单独认证,当某个用户下线时,也只有该用户无法使用网络。
3、 认证时,首先进行 RADIUS 认证,如果 RADIUS 服务器没有响应则进行本地认证。
4、所有接入用户都属于同一个 ISP 域gzga。
5、SW1 与 RADIUS 认证服务器交互报文时的共享密钥为 h3c@123、与 RADIUS 计费服务器交互报文时的共享密钥为 h3c@123。
三、配置实现
1、核心交换机SW1配置
(1)接口IP地址配置
interfaceVlan-interface10
ip address192.168.10.1 255.255.255.0
#
interfaceVlan-interface20
ip address172.16.1.1 255.255.255.0
#
interfaceVlan-interface1000
ip address 10.1.1.2255.255.255.252
(2)配置本地用户
# 添加网络接入类本地用户,用户名为admin,密码为明文输入的 admin123。(此处添加的本地
用户的用户名和密码需要与服务器端配置的用户名和密码保持一致,本例中的 admin 仅为示例,
请根据实际情况配置)
#
local-user adminclass network
password cipheradmin123
service-typelan-access # 配置本地用户的服务类型为 lan-access
#
(3)配置 RADIUS 方案
#
radius schemeradius1 # 创建RADIUS 方案 radius1
primaryauthentication 172.16.1.100 #配置主认证radius服务器
primary accounting172.16.1.100 #配置主计费radius服务器
key authenticationcipher h3c@123 #配置SW1与认证radius服务器交互报文共享秘钥
key accountingcipher h3c@123 #配置SW1与计费radius服务器交互报文共享秘钥
user-name-formatwithout-domain #发送给radius服务器的用户名不带域名
nas-ip 172.16.1.1
#
(4) 配置 ISP 域
#创建域 gzga并进入其视图
domain name gzga
# 配置 802.1X 用户使用 RADIUS 方案 radius1 进行认证、授权、计费,并采用 local 作为备选方法
authenticationlan-access radius-scheme radius1 local
authorizationlan-access radius-scheme radius1 local
accountinglan-access radius-scheme radius1 local
(5) 配置 802.1X
interfaceGigabitEthernet1/0/1
port link-modebridge
port access vlan 10
combo enable fiber
dot1x # 开启端口 的802.1X
dot1x port-methodmacbased #配置端口的 802.1X 接入控制方式为 mac-based(该配置可选,因为端口的接入控制在缺省情况下就是基于 MAC 地址的)
dot1xmandatory-domain gzga # 指定端口上接入的 802.1X 用户使用强制认证域 gzga
(6)全局开启802.1X
dot1x
(7)配置默认路由
ip route-static0.0.0.0 0 10.1.1.1
2、出口路由配置R1配置
#
interfaceGigabitEthernet0/0
port link-moderoute
combo enable copper
ip address 10.1.1.1255.255.255.252
#
interfaceGigabitEthernet0/1
port link-moderoute
combo enable copper
ip address200.1.1.2 255.255.255.0
nat outbound 3000
#
acl number 3000name NAT_ACL
description NAT_ACL
rule 0 permit ipsource 192.168.10.0 0.0.0.255
#
ip route-static0.0.0.0 0 200.1.1.1
ip route-static192.168.10.0 24 10.1.1.2
#
3、Internet路由器R2配置
#
interface LoopBack0
ip address100.1.1.1 255.255.255.255
#
interfaceGigabitEthernet0/0
port link-moderoute
combo enable copper
ip address200.1.1.1 255.255.255.0
四、工具软件准备及网卡桥接
1、工具软件
(1)802.1x客户端:iNode智能客户端;


(2)RADIUS 认证服务器:WinRadius。


2、网卡桥接
(1)SW1的GE1/0/1桥接到虚拟机网卡“本地连接3”,模拟Client(192.168.10.100);

(2)SW1的GE1/0/4桥接到虚拟机网卡“本地连接4”,模拟Radius Server(172.16.1.100);

五、配置Radius Server
1、打开WinRadius软件,点击"设置">"系统"配置NAS秘钥:h3c@123,认证端口1812,计费端口1813;

2、点击"操作">"添加账号"创建账号:admin,密码:admin123,并填写其他用户信息(可选);

六、模拟802.1X认证登录
1、打开iNode智能客户端,输入用户名:admin,密码:admin123,点击"连接",连接成功则表示认证通过,如下图所示;


2、登录WinRadius软件,查看用户认证数据,看是否认证成功;

3、采用ping测试模拟PC上互联网,以192.168.10.100作为源地址,常ping互联网上的100.1.1.1,如下图所示;

4、交换机SW1上的用户802.1X认证日志;

5、使用命令 display dot1xinterface 可以查看端口GE1/0/1 上的802.1X 的配置情况。当 802.1X 用户输入正确的用户名和密码成功上线后,可使用命令 display dot1x connection查看到上线用户的连接情况。
displaydot1x interface GigabitEthernet 1/0/1
Global 802.1Xparameters:
802.1Xauthentication : Enabled
CHAP authentication: Enabled
Max-tx period : 30s
Handshake period :15 s
Quiet timer isabled
Quiet period : 60 s
Supp timeout : 30 s
Server timeout :100 s
Reauth period :3600 s
Max auth requests :2
SmartOn supptimeout : 30 s
SmartOn retrycounts : 3
EAD assistantfunction : Disabled
EAD timeout : 30min
Domain delimiter
Online 802.1X wiredusers : 1
GigabitEthernet1/0/1is link-up
802.1Xauthentication : Enabled
Handshake : Enabled
Handshake reply isabled
Handshake security: Disabled
Unicast trigger isabled
Periodic reauth : Disabled
Port role :Authenticator
Authorization mode: Auto
Port access control: MAC-based
Multicast trigger :Enabled
Mandatory authdomain : gzga
Guest VLAN : Notconfigured
Auth-Fail VLAN :Not configured
Critical VLAN : Notconfigured
Critical voice VLAN: Disabled
Re-authserver-unreachable : Logoff
Max online users :4294967295
SmartOn : Disabled
Max Attempts FailNumber : 0
Send PacketsWithout Tag : Disabled
EAPOL packets: Tx1078, Rx 1057
Sent EAPRequest/Identity packets : 716
EAP Request/Challengepackets: 121
EAP Successpackets: 121
EAP Failurepackets: 120
Received EAPOLStart packets : 121
EAPOL LogOffpackets: 121
EAPResponse/Identity packets : 694
EAPResponse/Challenge packets: 121
Error packets: 0
Online 802.1Xusers: 1
MAC address Authstate
0200-4c4f-4f50Authenticated #认证MAC地址及认证状态
disdot1x connection
Slot ID: 1
User MAC address:0200-4c4f-4f50 #认证MAC
Access interface:GigabitEthernet1/0/1 #接入接口
Username: admin #用户名
Authenticationdomain: gzga #认证所属域
Authenticationmethod: CHAP #认证方法
Initial VLAN: 10
Authorizationuntagged VLAN: N/A
Authorizationtagged VLAN list: N/A
Authorization ACLID: N/A
Authorization userprofile: N/A
Termination action:N/A
Session timeoutperiod: 9999999 s
Online from:2022/01/07 17:29:38
Online duration: 0h0m 18s
Total connections:1


举报本楼

本帖有 4 个回帖,您需要登录后才能浏览 登录 | 注册
您需要登录后才可以回帖 登录 | 注册 |

版规|手机版|C114 ( 沪ICP备12002291号-1 )|联系我们 |网站地图  

GMT+8, 2025-3-31 12:37 , Processed in 0.448980 second(s), 16 queries , Gzip On.

Copyright © 1999-2023 C114 All Rights Reserved

Discuz Licensed

回顶部