本帖最后由 pbceo 于 2012-05-18 00:53 編輯
本人菜鳥一枚,這幾天在搗鼓FreeRADIUS。已經(jīng)根據(jù)網(wǎng)上一些牛人的帖子,成功的在MySQL中添加賬戶和密碼,并能夠用“radtest”命令測試成功。但是最后在交換機(jī)上配置完AAA后,用“test aaa group radius zbx zbx new-code”測試的時候發(fā)現(xiàn)不可達(dá)。拓?fù)淙缦拢菏怯肎NS3模擬cisco的交換機(jī),連接vitrialBox的虛擬網(wǎng)卡(redhat系統(tǒng)的)。
2012-05-17 17 13 19.jpg (28.32 KB, 下載次數(shù): 40)
下載附件
2012-05-17 22:30 上傳
先說說我的機(jī)子環(huán)境和FreeRADIUS的版本:REDhat企業(yè)版5.0;freeradius是freeradius-server-2.1.12的。
一、服務(wù)器中所做的配置如下:
1. 創(chuàng)建radius數(shù)據(jù)庫 create database radius; 2. 導(dǎo)入表 mysql -u root -p radius < /usr/local/etc/raddb/sql/mysql/schema.sql mysql -u root -p radius < /usr/local/etc/raddb/sql/mysql/nas.sql 3. 修改default文件 把authorize{} 、accounting {}中的sql前面的#去掉,并把authorize{} 中的files前加#; 4. 修改sql.conf 這個加上sql 的root和密碼 5. 修改clients.conf文件,路徑/usr/local/etc/raddb/clients.conf client 127.0.0.1 { secret = testing123 shortname = localhost nastype = other } 添加了這個,這是我配置的交換機(jī)的地址。 client 192.168.1.254 { secret = testing123 shortname = radiusclient } client 192.168.1.0/24 { secret = testing123 shortname = private-network } 6. 修改radius.conf,在目錄/usr/local/etc/raddb/radiusd.conf 刪除$INCLUDE sql.conf前的“#” ,使其加載sql.conf 7. 創(chuàng)建數(shù)據(jù)庫的東西 mysql> insert into radgroupreply (groupname,attribute,op,value) values ('user','Auth-Type',':=','Local'); mysql> insert into radgroupreply (groupname,attribute,op,value) values ('user','Service-Type',':=','Framed-User'); 建立用戶信息: mysql> insert into radcheck (username,attribute,op,value) values (zbx','User-Password',':=','zbx'); 將用戶加入組中: mysql> insert into radusergroup (username,groupname) values ('zbx','user'); 8. 測試radius radtest test test localhost 0 testing123【圖片好像有點模糊,就是ACCEPT的。】
2012-05-17 22 27 45.png (12.6 KB, 下載次數(shù): 27)
下載附件
2012-05-17 22:28 上傳
二、交換機(jī)的配置 端口配置,可以互相ping通。
int f0/1
switchport mode access
spanning-tree portfast
int f0/0
switchport mode access
spanning-tree portfast
exit
int vlan 1
ip add 172.16.1.254 255.255.255.0
no shutdown
aaa配置: aaa new-model
aaa authentication login default group radius local
radius-server host 172.16.1.1 key testing123
aaa authorization network default group radius local
dot1x system-auth-control
int f0/0
switch mode access
dot1x port-control auto
配置完成后,測試的時候發(fā)現(xiàn)“AAA server is not reachable”。
我嘗試打開debug aaa authentication 和debug aaa protocol radius,看不太懂debug信息{:2_168:}。不過我覺得沒什么參考價值,因為連接不上服務(wù)器。
也嘗試抓包,只發(fā)現(xiàn)Access-requst的請求包,和返回的icmp的不可達(dá)的包。
在這個過程中,我也打開radius的debug(radiusd -X),一點消息都沒有。
不知道是什么問題呢?請問我該如何配置,讓NAS連接上服務(wù)器?
|