Chinaunix首页 | 论坛 | 博客
  • 博客访问: 78138
  • 博文数量: 19
  • 博客积分: 1415
  • 博客等级: 上尉
  • 技术积分: 202
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-24 17:26
个人简介

Linux、Python爱好者,推广者。

文章分类

全部博文(19)

文章存档

2015年(1)

2011年(1)

2010年(2)

2009年(15)

我的朋友

分类: LINUX

2009-05-09 17:28:04

参考网站:http://www.ibm.com/developerworks/cn/linux/l-radius/

http://blog.chinaunix.net/u/2830/showart_402921.html

正常安装radis

tar zxvf freeradius-server-2.1.4.tar.gz         - extract it with gunzip and tar

./configure

make

make install                              - run this command as root

radiusd or                                - start RADIUS server

radiusd -X                                - start RADIUS server in debug mode

 

修改/usr/local/etc/raddb/sites-available/default

authorize {

        files

}

其他不修改。

修改/usr/local/etc/raddb/clients.conf如下:

client 127.0.0.1 {

        secret          = testing123

        shortname = localhost

        nastype = other

}

client 192.168.0.153 {

        secret          = testing123

        shortname = cisco  //交接机的主机名

        nastype = other

}

修改/usr/local/etc/raddb/users

test User-Password := "123456"

        Reply-Message = "Hello test",

        cisco-avpair ="shell:priv-lvl=15"

本机测试:radtest

Usage: radtest user passwd radius-server[:port] nas-port-number secret [ppphint] [nasname]

[root@pdc ~]# radtest test 123456 localhost:1812 50022 testing123

Sending Access-Request of id 244 to 127.0.0.1 port 1812

        User-Name = "test"

        User-Password = "123456"

        NAS-IP-Address = 192.168.0.145

        NAS-Port = 50022

rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=244, length=71

        Reply-Message = "This is cisco switch 2950"

        Cisco-AVPair = "shell:priv-lvl=1"

 

交换机的设置:

AAA

interface Vlan1

 ip address 192.168.0.153 255.255.255.0

aaa new-model

aaa authentication login default group radius local

aaa authorization exec default group radius if-authenticated

 

radius-server host 192.168.0.145 auth-port 1812 acct-port 1813    //192.168.0.145radiusip

radius-server key testing123

line vty 0 4

login authentication default

测试:

telnet 192.168.0.153

Username: test

Password:123456

Hello test

cisco#

阅读(1903) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~