从 Junos OS 14.2 版开始,RADIUS 记帐允许收集有关登录或注销 LAN 的用户的统计数据,并将其发送到 RADIUS 记帐服务器。收集的统计数据可用于一般网络监控,分析和跟踪使用模式,或根据访问的时间或服务类型向用户计费。
要使用 CLI 配置基本 RADIUS 记帐,请执行以下操作:
- 指定交换机将向其转发记帐统计信息的记帐服务器:
[edit access ]
user@router# set profile profile1 radius accounting-server [122.69.1.250 122.69.1.252]
- 定义 RADIUS 记帐服务器:
[edit access]
user@router# set radius-server 122.69.1.250 secret juniper
user@router# set radius-server 122.69.1.252 secret juniper1
- 为访问配置文件启用记帐:
[edit access]
user@router# set profile profile1 accounting
- 配置发送记帐消息和更新时要使用的 RADIUS 服务器:
[edit access]
user@router# set profile profile1 accounting order radius
- 配置要在路由器上收集并转发到计费服务器的统计信息:
[edit access ]
user@router# set profile profile1 accounting accounting-stop-on-access-deny
user@router# set profile profile1 accounting accounting-stop-on-failure
- 显示在路由器上收集的记帐统计信息:
user@router> show network-access aaa statistics accounting
Accounting module statistics
Requests received: 1
Accounting Response failures: 0
Accounting Response Success: 1
Requests timedout: 0
- 使用服务器的地址在 RADIUS 记帐服务器上打开记帐日志,并查看记帐统计信息:
[root@freeradius]# cd /usr/local/var/log/radius/radacct/122.69.1.250
[root@freeradius 122.69.1.250]# ls
detail-20071214
[root@freeradius 122.69.1.250]# vi details-20071214
User-Name = "000347e1bab9"
NAS-Port = 67
Acct-Status-Type = Stop
Acct-Session-Id = "8O2.1x811912"
Acct-Input-Octets = 17454
Acct-Output-Octets = 4245
Acct-Session-Time = 1221041249
Acct-Input-Packets = 72
Acct-Output-Packets = 53
Acct-Terminate-Cause = Lost-Carrier
Acct-Input-Gigawords = 0
Acct-Output-Gigawords = 0
Called-Station-Id = "00-19-e2-50-52-60"
Calling-Station-Id = "00-03-47-e1-ba-b9"
Event-Timestamp = "Sep 10 2008 16:52:39 PDT"
NAS-Identifier = "esp48t-1b-01"
NAS-Port-Type = Virtual
User-Name = "000347e1bab9"
NAS-Port = 67
Acct-Status-Type = Start
Acct-Session-Id = "8O2.1x811219"
Called-Station-Id = "00-19-e2-50-52-60"
Calling-Station-Id = "00-03-47-e1-ba-b9"
Event-Timestamp = "Sep 10 2008 18:58:52 PDT"
NAS-Identifier = "esp48t-1b-01"
NAS-Port-Type = Virtual
变更历史表
是否支持某项功能取决于您使用的平台和版本。 使用 Feature Explorer 查看您使用的平台是否支持某项功能。
14.2
从 Junos OS 14.2 版开始,RADIUS 记帐允许收集有关登录或注销 LAN 的用户的统计数据,并将其发送到 RADIUS 记帐服务器。