课程 12
AAA RADIUS
协议
离婚协议模板下载合伙人协议 下载渠道分销协议免费下载敬业协议下载授课协议下载
目 录
13习 题 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13小 结 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
112.6.3 持有Challenge-Response card 的用户 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
102.6.2 用CHAP验证的固定用户 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
92.6.1 用户 Telnet 到特定主机 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
92.6 数据包的传输和使用举例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
52.5 RADIUS包结构 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
52.4 AAA在协议栈中的位置 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
42.3 PAP和CHAP验证 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
42.2 客户服务器模式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
42.1 概述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4第二节 RADIUS协议介绍 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3习 题 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3小 结 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21.1 概述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1第一节 AAA介绍 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1相关资料 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1课程目标 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1课程介绍 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1课程说明 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
AAA RADIUS协议课程12
i
课程说明
课程介绍
本教材对应的产品版本为 路由器VRP1.01版
本文从用户的角度介绍了AAA的一些基本概念和原理 并介绍了AAA的重要
组成部分 RADIUS协议
课程目标
完成本课程学习 学员能够掌握
ü AAA和RADIUS协议的基本工作原理
相关资料
RFC 2138
RFC 2139
路由器配置指导分册
路由器命令参考手册
AAA RADIUS协议课程12
1
第一节 AAA介绍
1.1 概述
图1.1 PSTN,ISDN用户通过路由器上网示意图
用户 lqz, lst 要求得到某些服务(如SLIP, PPP,telnet, rlogin) 但必须通 过
NAS, 由 NAS依据某种顺序与所连服务器通信从而进行验证
注 lst 通过拨号进入NAS, 然后NAS按配置好的验证方式 (如 PPP PAP,
CHAP等)要求lst输入用户名, 密码等信息 lst 端出现提示 用户按提示输入
通过与NAS 的连接 NAS得到这些信息 而后 NAS把这些信息传递给响应
验证或记账的服务器 并根据服务器的响应来决定用户是否可以获得他所要
求的服务
AAA是验证
授权
个人房产授权委托书公司各类授权委托书模版医师授权办法餐饮分店授权书产品代理授权书范本
和记账 Authentication,Authorization,and Accounting 的
简称 它 是运行于NAS上的客户端程序 它提供了一个用来对验证 授权和
记账这三种安全功能进行配置的一致的框架 AAA的配置实际上是对网络安
全的一种管理 这里的网络安全主要指访问控制 包括哪些用户可以访问网
AAA RADIUS协议课程12
2
络服务器 具有访问权的用户可以得到哪些服务 如何对正在使用网络资源
的用户进行记账 下面简单介绍一下验证, 授权,记账的作用
验证 (Authentication): 验证用户是否可以获得访问权 可以选择使用
RADIUS协议
授权(Authorization) : 授权用户可以使用哪些服务
记账(Accounting) :
记录
混凝土 养护记录下载土方回填监理旁站记录免费下载集备记录下载集备记录下载集备记录下载
用户使用网络资源的情况
AAA的实现可采用 RADIUS 协议 RADIUS 是Remote Authentication Dial In
User Service 的简称 用来管理使用串口和调制解调器的大量分散用户
网络接入服务器简称NAS(Network Access Server) 当用户想要通过某个网络
(如电话网)与 NAS建立连接从而获得访问其他网络的权利(或取得使用某些网
络资源的权利)时, NAS起到了过问用户(或这个连接)的作用 NAS负责把用
户的验证 授权 记账信息传递给RADIUS服务器 RADIUS 协议规定了
NAS与RADIUS 服务器之间如何传递用户信息和记账信息
RADIUS服务器负责接收用户的连接请求 完成验证 并把传递服务给用户
所需的配置信息返回给NAS NAS和RADIUS之间的验证信息的传递是通过
密钥的参与来完成的 用户的密码加密以后才在网络上传递 以避免用户的
密码在不安全的网络上被窃取
小 结
AAA是验证 授权和记账 Authentication,Authorization,and Accounting 的
简称 它 是运行于NAS上的客户端程序 它提供了一个用来对验证 授权和
记账这三种安全功能进行配置的一致的框架
习 题
1-1 AAA是如何工作的 ?
AAA RADIUS协议课程12
3
第二节 RADIUS协议介绍
2.1 概述
RADIUS 协议的验证和记账端口号分别为1812和1813
一个网络允许外部用户通过公用网对其进行访问 于是用户在地理上可以极
为分散 大量分散用户通过Modem等设备从不同的地方可以对这个网络进行
随机的访问 用户可以把自己的信息传递给这个网络 也可以从这个网络得
到自己想要的信息 由于存在内外的双向数据流动 网络安全就成为很重要
的问题了 大量的modem形成了Modem pools 对modem pool 的管理就成为
网络接入服务器或路由器的任务 管理的
内容
财务内部控制制度的内容财务内部控制制度的内容人员招聘与配置的内容项目成本控制的内容消防安全演练内容
有:哪些用户是否可以获得访问
权 获得访问权的用户可以允许使用哪些服务 如何对使用网络资源的用户
进行记费 AAA很好的完成了这三项任务
RADIUS通过建立一个唯一的用户数据库 存储用户名 用户的密码来进行
验证; 存储传递给用户的服务类型以及相应的配置信息来完成授权
2.2 客户服务器模式
图2.1 用户 NAS RADIUS 服务器的关系
路由器 或NAS 上运行的AAA程序对用户来讲为服务器端 对RADIUS服
务器来讲是作为客户端 当用户上网时 路由器决定对用户采用何那种验证
方法 下面介绍两种用户与路由器之间(本地验证)的验证方法CHAP和PAP
2.3 PAP和CHAP验证
PAP ( Password Authentication Protocol ) 用户以明文的形式把用户名和他的
密码传递给路由器 NAS根据用户名在NAS端查找本地数据库 如果存在相
AAA RADIUS协议课程12
4
同的用户名和密码表明验证通过,否则表明验证未通过
CHAP Challenge Handshake Authentication Protocol 当用户请求上网时
路由器产生一个16字节的随机码给用户 同时还有一个ID号 本地路由器的
host name 用户端得到这个包后使用自己独用的设备或软件对传来的各域
进行加密 生成一个response传给NAS NAS根据用户名在NAS端查找本地数
据库 得到和用户端进行加密所用的一样的密码 然后根据原来的16字节的
随机码进行加密 将其结果与Response作比较 如果相同表明验证通过 如
果不相同表明验证失败
2.4 AAA在协议栈中的位置
图2.2 路由器协议栈结构
NAS和RADIUS服务器之间传递的是一般几十上百个字节长度的数据 并且
RADIUS要求特别的定时器管理机制 用户可以容忍几十秒的验证等待时间
当处理大量用户时服务器端采用多线程 UDP简化了服务器端的实现过程
TCP是必须成功建立连接后才能进行数据传输的 这种方式在有大量用户使
用的情况下实时性不好 RADIUS要有重传机制和备用服务器机制 它所采
用的定时 TCP不能很好的满足
2.5 RADIUS包结构
图2.3 包
格式
pdf格式笔记格式下载页码格式下载公文格式下载简报格式下载
AAA RADIUS协议课程12
5
Code
1 Access- request
2 Access- accept
3 Access- reject
4 Accounting-request
5 Accounting-response
11 Access-challenge
Identifier 用于匹配请求包和回应包
Length 所有域的长度
Authenticator 16 字节长 用于验证RADIUS服务器传回来的请求以及密码隐
藏算法上 分为 Request authenticator 和 response authenticator
RequestAuth = 16 字节的随机码
ResponseAuth = MD5 Code+ID+Length+RequestAuth+Attribute+Secret
attributes
图2.4 属性格式
Type
1 User-Name
2 User-Password
3 CHAP-Password
4 NAS-IP-Address
5 NAS-Port
6 Service-Type
AAA RADIUS协议课程12
6
7 Framed-Protocol
8 Framed-IP-Address
9 Framed-IP-Netmask
10 Framed-Routing
11 Filter-Id
12 Framed-MTU
13 Framed-Compression
14 Login-IP-Host
15 Login-Service
16 Login-TCP-Port
17 (unassigned)
18 Reply-Message
19 Callback-Number
20 Callback-Id
21 (unassigned)
22 Framed-Route
23 Framed-IPX-Network
24 State
25 Class
26 Vendor-Specific
27 Session-Timeout
28 Idle-Timeout
29 Termination-Action
30 Called-Station-Id
AAA RADIUS协议课程12
7
31 Calling-Station-Id
32 NAS-Identifier
33 Proxy-State
34 Login-LAT-Service
35 Login-LAT-Node
36 Login-LAT-Group
37 Framed-AppleTalk-Link
38 Framed-AppleTalk-Network
39 Framed-AppleTalk-Zone
40 Acct-Status-Type
41 Acct-Delay-Time
42 Acct-Input-Octets
43 Acct-Output-Octets
44 Acct-Session-Id
45 Acct-Authentic
46 Acct-Session-Time
47 Acct-Input-Packets
48 Acct-Output-Packets
49 Acct-Terminate-Cause
50 Acct-Multi-Session-Id
51 Acct-Link-Count
60 CHAP-Challenge
61 NAS-Port-Type
62 Port-Limit
AAA RADIUS协议课程12
8
63 Login-LAT-Port
Length
属性长度
Value
String
Address
Integer
Time
2.6 数据包的传输和使用举例
2.6.1 用户 Telnet 到特定主机
接入服务器 192.168.1.16 发送 Access-Request UDP 数据包到 RADIUS Server
User-nam nemo
Port logging in 3
Code = 1 (Access-Request)
ID = 0
Length = 56
Request Authenticator = {16 octet random number}
Attributes:
User-Name = "nemo"
User-Password = {16 octets of Password padded at end with nulls,
XORed with MD5(shared secret|Request Authenticator)}
NAS-IP-Address = 192.168.1.16
NAS-Port = 3
AAA RADIUS协议课程12
9
RADIUS server 验证了 nemo, 并且发送了 Access-Accept UDP 数据包到接入
服务器 告诉把用户 nemo 登陆到主机 192.168.1.3.
Code = 2 (Access-Accept)
ID = 0 (same as in Access-Request)
Length = 38
Response Authenticator = {16-octet MD-5 checksum of the code (2),
id (0), Length (38), the Request Authenticator from above, the attributes in this
reply, and the shared secret}
Attributes:
Service-Type = Login-User
Login-Service = Telnet
Login-Host = 192.168.1.3
2.6.2 用CHAP验证的固定用户
接入服务器 192.168.1.16 发送一个 Access-Request UDP 数据包到 RADIUS
Server
User-name flopsy
Port logging in 20
Protocol PPP
接入服务器发送的数据包包含属性 Service-Type = Framed user
Framed-Protocol=PPP
暗示 RADIUS server 这个用户要使用PPP服务
Code = 1 (Access-Request)
ID = 1
Length = 71
Request Authenticator = {16 octet random number also used as CHAP challenge}
AAA RADIUS协议课程12
10
Attributes:
User-Name = "flopsy"
CHAP-Password = {1 octet CHAP ID followed by 16 octet CHAP response}
NAS-IP-Address = 192.168.1.16
NAS-Port = 20
Service-Type = Framed-User
Framed-Protocol = PPP
RADIUS server 验证 flopsy, 并发送Access-Accept UDP 数据包到 NAS 告诉
NAS可以 允许PPP服务并从它的动态地址池中分配一个网络地址给用户
Code = 2 (Access-Accept)
ID = 1 (same as in Access-Request)
Length = 56
Response Authenticator = {16-octet MD-5 checksum of the code (2),id (1),
Length (56), the Request Authenticator from above, the attributes in this reply,
and the shared secret}
Attributes:
Service-Type = Framed-User
Framed-Protocol = PPP
Framed-IP-Address = 255.255.255.254
Framed-Routing = None
Framed-Compression = 1 (VJ TCP/IP Header Compression)
Framed-MTU = 1500
2.6.3 持有Challenge-Response card 的用户
NAS 192.168.1.16 发送一个 Access-Request UDP 数据包到 RADIUS Server
User-name mopsy
AAA RADIUS协议课程12
11
Port logging in 7
Code = 1 (Access-Request)
ID = 2
Length = 57
Request Authenticator = {16 octet random number}
Attributes:
User-Name = "mopsy"
User-Password = {16 octets of Password padded at end with nulls,XORed with
MD5(shared secret|Request Authenticator)}
NAS-IP-Address = 192.168.1.16
NAS-Port = 7
RADIUS server 决定盘问mopsy, 发送一个 challenge 串等待对方的回应
RADIUS server
发送 Access-Challenge UDP 数据包到 NAS.
Code = 11 (Access-Challenge}
ID = 2 (same as in Access-Request)
Length = 78
Response Authenticator = {16-octet MD-5 checksum of the code (11),id (2),
length (78), the Request Authenticator from above, the attributes in this reply, and
the shared secret}
Attributes:
Reply-Message = "Challenge 32769430. Enter response at prompt."
State = {Magic Cookie to be returned along with user's response;in this
example 8 octets of data}
用户输入了他的回应 ,NAS 发送一个新的带有用户输入的回应的
Access-Request 给RADIUS server
AAA RADIUS协议课程12
12
Code = 1 (Access-Request)
ID = 3 (Note that this changes)
Length = 67
Request Authenticator = {NEW 16 octet random number}
Attributes:
User-Name = "mopsy"
User-Password = {16 octets of Response padded at end with nulls, XORed with
MD5 checksum of shared secret plus above Request Authenticator}
NAS-IP-Address = 192.168.1.16
NAS-Port = 7
State = {Magic Cookie from Access-Challenge packet, unchanged}
RADIUS server发现用户的回应不正确,于是 RADIUS server 告诉 NAS 拒绝这
个用户的登陆请求
Code = 3 (Access-Reject)
ID = 3 (same as in Access-Request)
Length = 20
Response Authenticator = {16-octet MD-5 checksum of the code (3),id (3),
length(20), the Request Authenticator from above, the attributes in this reply if
any, and the shared secret}
Attributes:
(none, although a Reply-Message could be sent)
小 结
RADIUS管理的内容有:哪些用户是否可以获得访问权 获得访问权的用户可
以允许使用哪些服务 如何对使用网络资源的用户进行记费 RADIUS包的
结构特性决定了RADIUS具有良好的扩展性 能够适应网络未来发展的需要
AAA RADIUS协议课程12
13
习 题
2-1 RADIUS协议是如何完成AAA功能的
2-2 简述CHAP验证的过程?
AAA RADIUS协议课程12
14