radius 测试

目前使用radclient来测试模拟计费报文

模拟计费请求

start报文

radclient 127.0.0.1 auto testing123 -f acct_start.txt

acct_start.txt
复制代码
User-Name = 'user3@example.org'
Calling-Station-Id = "00-1C-B3-AA-AA-AA"
Packet-Type=4
Packet-Dst-Port=1813
NAS-Port = 17826193
NAS-IP-Address = 192.0.2.10
Framed-IP-Address = 198.51.100.59
NAS-Identifier = 'nas.example.org'
Acct-Status-Type = Start
Acct-Delay-Time = 1
Acct-Input-Octets = 0
Acct-Output-Octets = 0
Acct-Session-Id = '00000003'
Acct-Unique-Session-Id = '00000003'
Acct-Authentic = RADIUS
NAS-Port-Type = Ethernet
NAS-Port-Id = 'port 001'
Service-Type = Framed-User
Framed-Protocol = PPP
Acct-Link-Count = 0
复制代码

计费更新以及停止报文

acct_update.txt

复制代码
User-Name = 'user4@example.org'
Packet-Type=4
Packet-Dst-Port=1813
NAS-Port = 17826193
NAS-IP-Address = 192.0.2.10
Framed-IP-Address = 198.51.100.59
Called-Station-Id = "00-02-6F-AA-AA-AA:Myeth"
Calling-Station-Id = "00-1C-B3-AA-AA-AA"
NAS-Identifier = 'nas.example.org'
Acct-Status-Type = Interim-Update
Acct-Delay-Time = 1
Acct-Input-Octets = 10
Acct-Output-Octets = 10
Acct-Session-Id = '00000004'
Acct-Unique-Session-Id = '00000004'
Acct-Authentic = RADIUS
Acct-Session-Time = 30
Acct-Input-Packets = 10
Acct-Output-Packets = 10
Acct-Input-Gigawords = 1
Acct-Output-Gigawords = 1
Event-Timestamp = 'Feb  1 2015 08:28:28 WIB'
NAS-Port-Type = Ethernet
NAS-Port-Id = 'port 001'
Service-Type = Framed-User
Framed-Protocol = PPP
Acct-Link-Count = 0
复制代码

acct_stop.txt

复制代码
Packet-Type=4
Packet-Dst-Port=1813
Acct-Session-Id = "4D2BB8AC-00000099"
Acct-Status-Type = Stop
Acct-Authentic = RADIUS
User-Name = "ff:ff:ff:ff:ff"
NAS-Port = 0
Called-Station-Id = "00-02-6F-AA-AA-AA:My Wireless"
Calling-Station-Id = "00-1C-B3-AA-AA-AA"
NAS-Port-Type = Wireless-802.11
Connect-Info = "CONNECT 48Mbps 802.11b"
Acct-Session-Time = 30
Acct-Input-Packets = 25
Acct-Output-Packets = 7
Acct-Input-Octets = 3407
Acct-Output-Octets = 867
Acct-Terminate-Cause = User-Request
复制代码

 

模拟coa请求

coa_auth.txt 请求包内容

//radclient 127.0.0.1:3799 coa testing123  -f coa_auth.txt -x
User-Name=C4-07-2F-85-15-9F
NAS-IP-Address=127.0.0.1
Calling-Station-Id=C4-07-2F-85-15-9F
Benu-ACL-Policy=auth_sla
Benu-QoS-Policy=32M_Full

 

 

 

 

 

 

 

posted @   codestacklinuxer  阅读(68)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
历史上的今天:
2022-08-03 如何找到是哪个rwlock导致竞争 && pthread_rwlock 分析
2022-08-03 路由 rtable dst_entry 数据结构
2021-08-03 stap signal && trace point
点击右上角即可分享
微信分享提示