h3c radius认证测试

在这里插入图片描述

客户端ssh连接上交换机进行管理,用radius里面的用户名和密码进行登陆

dis current-configuration

vlan 1

vlan 2

interface Vlan-interface1
ip address 192.168.0.105 255.255.255.0

interface Vlan-interface2
ip address 192.168.60.244 255.255.255.0

interface GigabitEthernet1/0/1
port link-mode bridge
combo enable fiber

interface GigabitEthernet1/0/2
port link-mode bridge
port access vlan 2
combo enable fiber

line class aux
user-role network-operator

line class console
user-role network-admin

line class tty
user-role network-operator

line class vty
user-role network-operator

line aux 0
user-role network-operator

line con 0
user-role network-admin

line vty 0 5
authentication-mode scheme
user-role network-operator //这个权限可以改
protocol inbound ssh

ssh server enable //使能要开

radius scheme rad
primary authentication 192.168.60.245
key authentication cipher admin

配置与认证服务器交互报文时的共享密钥为明文 admin
(这个必须要和radius上面的那个系统密钥一样)
[Switch-radius-rad] key authentication simple admin

配置向 RADIUS 服务器发送的用户名携带域名。
[Switch-radius-rad] user-name-format with-domain

radius scheme system
user-name-format without-domain

domain name bb //这个bb要和radius上面的建立的用户名@后面那个一样
authentication login radius-scheme rad
authorization login radius-scheme rad
accounting login none

生成 RSA 密钥对。
[Switch] public-key local create rsa

生成 DSA 密钥对。
[Switch] public-key local create dsa

radius服务器设置

设置-系统-密钥
在这里插入图片描述

增加用户
在这里插入图片描述
在本机上进行测试
这个secret密码也就是第一步建立的那个密钥
在这里插入图片描述

用真机ssh连接测试:

在这里插入图片描述

第二种应用,客户端利用radius上的用户名和密码验证通过后上网,准入常用这个

在这里插入图片描述

接需要认证客户端和另一端接radius的 交换机上配置:

#创建 RADIUS 方案 radius1 并进入其视图。
[SwitchA] radius scheme radius1
New Radius scheme
配置主认证/授权 RADIUS 服务器的 IP 地址。
[SwitchA-radius-radius1] primary authentication 192.168.60.245 1812 key simple admin
配置发送给 RADIUS 服务器的用户名不携带域名。
[SwitchA-radius-radius1] user-name-format without-domain
配置发送 RADIUS 报文的源接口 IP(交换机连接radius的接口IP)。
[SwitchA-radius-radius1] nas-ip 192.168.60.244
[SwitchA-radius-radius1] quit

创建域 test 并进入其视图。
[SwitchA] domain test
配置 802.1X 用户使用 RADIUS 方案 radius1 进行认证、授权方法。
[SwitchA-isp-test] authentication lan-access radius-scheme radius1
[SwitchA-isp-test] authorization lan-access radius-scheme radius1

指定域 test 为缺省的 ISP 域。如果用户在登录时没有提供 ISP 域名,系统将把它归于该缺省的 ISP
域。
[SwitchA] domain default enable test

(4) 配置 802.1X
开启指定端口 Ten-GigabitEthernet1/0/1 的 802.1X 特性。
[SwitchA] interface ten-gigabitethernet 1/0/1
[SwitchA-Ten-GigabitEthernet1/0/1] dot1x

#如果想用单播触发客户端认证,关闭端口 Ten-GigabitEthernet 1/0/1 的 802.1X 的组播触发功能。
[Switch] interface ten-gigabitethernet 1/0/1
[Switch-Ten-GigabitEthernet1/0/1] undo dot1x multicast-trigger

#开启端口 Ten-GigabitEthernet 1/0/1 的 802.1X 的单播触发功能。
[Switch-Ten-GigabitEthernet 1/0/1] dot1x unicast-trigger

#开启端口 Ten-GigabitEthernet 1/0/1 的 802.1X 功能。
[Switch-Ten-GigabitEthernet1/0/1] dot1x

设置接入控制方式(该命令可以不配置,因为端口的接入控制在缺省情况下就是基于 MAC 地址
的)。
[Switch-Ten-GigabitEthernet1/0/1] dot1x port-method macbased
[Switch-Ten-GigabitEthernet1/0/1] quit

配置基于 MAC 地址的接入控制方式(该配置可选,因为端口的接入控制在缺省情况下就是基于
MAC 地址的)。
[SwitchA-Ten-GigabitEthernet1/0/1] dot1x port-method macbased
[SwitchA-Ten-GigabitEthernet1/0/1] quit

开启全局 802.1X 特性。
[SwitchA] dot1x

radius配置

radius上添加用户名和密码,密钥必须和交换机上的admin 一致

第三种 利用radius进行mac地址认证:

在这里插入图片描述

配置 RADIUS 方案。
system-view
[SwitchA] radius scheme 2000
New RADIUS scheme.
[SwitchA-radius-2000] primary authentication 192.168.60.245 1812 key simple admin
[SwitchA-radius-2000] user-name-format without-domain
[SwitchA-radius-2000] quit

配置 ISP 域的 AAA 方案。
[SwitchA] domain domain2
[SwitchA-isp-domain2] authentication lan-access radius-scheme 2000
[SwitchA-isp-domain2] authorization lan-access radius-scheme 2000
[SwitchA-isp-domain2] quit

#开启端口 Ten-GigabitEthernet1/0/1 的 MAC 地址认证特性。
[SwitchA] interface ten-gigabitethernet 1/0/1
[SwitchA-Ten-GigabitEthernet1/0/1] mac-authentication
[SwitchA-Ten-GigabitEthernet1/0/1] quit

配置 MAC 地址认证用户所使用的 ISP 域。
[SwitchA] mac-authentication domain domain2

配置 MAC 地址认证的下线定时器和静默定时器。即交换机每隔 180 秒就对用户是否下线进行检
测;并且当用户认证失败时,需等待 3 分钟后才能对用户再次发起认证。
[SwitchA] mac-authentication timer offline-detect 180
[SwitchA] mac-authentication timer quiet 180

配置 MAC 地址认证用户名格式:使用带连字符的 MAC 地址作为用户名与密码,其中字母小写。
[SwitchA] mac-authentication user-name-format mac-address with-hyphen lowercase

#开启全局 MAC 地址认证特性。
[SwitchA] mac-authentication

RADIUS server的配置
以 Host 的 MAC 地址作为用户名,创建 RADIUS 用户并进入 RADIUS 服务器用户视图
system-view
[SwitchB] radius-server user 68-05-ca-06-55-7b
指定用户的密码为明文 123456。
[SwitchB-rdsuser-68-05-ca-06-55-7b] password simple 123456
[SwitchB-rdsuser-68-05-ca-06-55-7b] quit

配置 RADIUS 客户端 IP 为 192.168.60.244,共享密钥为明文 admin。
[SwitchB] radius-server client-ip 1192.168.60.244 key simple admin

### H3C 设备与 FreeRADIUS 服务器集成配置 #### 配置概述 为了实现H3C设备与FreeRADIUS服务器之间的成功集成,需完成两部分的主要工作:一是设置H3C路由器作为客户端向FreeRADIUS发送认证请求;二是确保FreeRADIUS服务端能够处理这些请求并返回适当响应。 #### H3C 设备侧配置 在H3C MSR系列路由器上启用802.1X接入控制功能,并指定使用Radius协议进行身份验证: ```shell [H3C]aaa [H3C-aaa]local-user admin password simple Admin@123 [H3C-aaa]local-user admin service-type telnet terminal [H3C-aaa]radius scheme 1xallpermit [H3C-aaa-radius-1xallpermit]primary authentication 192.168.1.100 // RADIUS Server IP Address [H3C-aaa-radius-1xallpermit]primary accounting 192.168.1.100 // RADIUS Server IP Address [H3C-aaa-radius-1xallpermit]key authentication cipher H3c.com@123 // Shared Secret Key [H3C-aaa-radius-1xallpermit]key accounting cipher H3c.com@123 // Shared Secret Key [H3C-aaa-radius-1xallpermit]user-name-format without-domain // 用户名格式不带域名 [H3C-aaa-radius-1xallpermit]quit [H3C-aaa]domain system [H3C-isp-system]authentication lan-access radius-scheme 1xallpermit [H3C-isp-system]authorization lan-access radius-scheme 1xallpermit [H3C-isp-system]accounting lan-access radius-scheme 1xallpermit [H3C-isp-system]quit ``` 上述命令序列定义了一个名为`1xallpermit`的Radius方案,并将其应用于系统的LAN访问认证、授权以及计费过程[^1]。 #### FreeRADIUS 服务器侧配置 对于FreeRADIUS服务器而言,在默认安装完成后需要编辑其配置文件来支持特定于项目的参数调整。特别是当涉及到OTP(一次性密码)或其他形式的身份验证增强措施时,可能还需要额外修改模块加载列表和服务监听端口等选项。 针对测试环境中的挑战模式用户(如otp_test),应确认FreeRADIUS已正确重启并且正在侦听用于接收来自H3C设备发出的Challenge Request报文的数据包所对应的UDP端口,默认情况下此端口号为2000而非标准的1812[^2]。 ```bash service freeradius restart ``` 通过以上步骤可以建立起基本的功能连接,使得H3C网络设备可以通过预设的安全通道同后台运行着FreeRADIUS软件的服务主机交互,从而达成基于用户名/密码或者其他更复杂机制下的远程登录保护目的。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

项目工程师余工

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值