小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

配置Steel-Belted Radius 和SQL Server 連接

 林中雁 2011-07-14

配置Steel-Belted Radius 和SQL Server 連接

2007-04-22 10:25:41|  分類: 網(wǎng)絡(luò) |  標(biāo)簽: |字號 訂閱

配置Steel-Belted Radius 和SQL Server 連接

Steel-Belted Radius 是一款多功能的Radius服務(wù)器,可以實(shí)現(xiàn)認(rèn)證、計(jì)費(fèi)等功能;它也可以和多種數(shù)據(jù)庫相連接,實(shí)現(xiàn)其功能。我們就來看一下Steel-Belted Radius 和SQL Server連接的配置:

說明:本文采用的 Steel-Belted Radius版本為5.02.1335,SQL Server版本為SQL Server 2000 簡體中文版。

一、建立系統(tǒng)DSN;

使用ODBC 數(shù)據(jù)源管理器建立連接SQL Server 的系統(tǒng)DSN,命名為LocalServer;

二、配置 Sqlauth.aut 實(shí)現(xiàn)認(rèn)證功能

Steel-Belted Radius 默認(rèn)并不支持SQL Server 連接,需要我們進(jìn)行相應(yīng)的設(shè)置,大部分都是在Sqlauth.aut中完成。以下是一個(gè)已完成的Sqlauth.aut

[Bootstrap]
LibraryName=sqlauth.dll
Enable=1
InitializationString=SQL Server

[Settings]
Connect=DSN=LocalServer;UID=sa;PWD=123456
SQL=SELECT Password,Profile FROM userlist WHERE UserName = %name and Enable = 1
ParameterMarker=?
MaxConcurrent=30
ConcurrentTimeout=30
ConnectTimeout=25
QueryTimeout=25
WaitReconnect=2
MaxWaitReconnect=360
PasswordFormat = 0
DefaultResults = 0

[FailedSuccessResultAttributes]
at Reply-Message ='Please re-enter your password dot '
at Filter-Id ='3'

[Server]
;s1=2
;s2=2

;[Server/s1]
;Connect=DSN=<dsn_name_here>;UID=<username_for_dB>;PWD=<password_for_dB>

;[Server/s2]
;Connect=DSN=<dsn_name_here>;UID=<username_for_dB>;PWD=<password_for_dB>

[Results]
Password=1
Profile=2
;UserName=3/40s
;Alias=2/48

[Failure]
Accept=1
Profile=xyz
FullName=Remote User

各字段含義如下:

Enable :是否啟用SQL Server ;1為是 0為否;
InitializationString:SQL Server 連接的名稱 ,值隨意;
Connect:數(shù)據(jù)庫連接設(shè)置 DSN為我們?yōu)槲覀兊谝徊浇⒌南到y(tǒng)DSN名稱;UID和PWD為數(shù)據(jù)庫連接的用戶名和密碼;
SQL:數(shù)據(jù)庫查詢語句,我們的用戶認(rèn)證就靠它了,其中%name為用戶輸入的用戶名(用戶輸入的密碼為%Password)。如果這條查詢語句有值返回,則用戶驗(yàn)證成功,否則驗(yàn)證失敗,所以我們就可以構(gòu)建查詢語句來實(shí)現(xiàn)用戶驗(yàn)證,例如我就增加了一個(gè)Enable字段來控制用戶驗(yàn)證。
PasswordFormat:密碼類型 0為自適應(yīng);

配置好Sqlauth dot aut,然后重啟Steel-Belted Radius;啟動好后,用admin 連接到服務(wù)器,如果你在server的status中看到 SQL connection established ,恭喜你,你的Steel-Belted Radius已經(jīng)和SQL Server 連接成功了,如果有問題的話,可以在Steel-Belted Radius安裝目錄的Service文件夾中查看日志文件,其中記錄了連接失敗的原因,日志文件是以年月日命名的。

三、配置 Sqlacct.acc 實(shí)現(xiàn)用戶記帳

[Bootstrap]
LibraryName=sqlacct.dll
Enable=1
InitializationString=SQLAcc

[Settings]
Connect=DSN=LocalServer;UID=sa;PWD=123456
ParameterMarker=?
MaxConcurrent=20
ConcurrentTimeout=30
ConnectTimeout=25
QueryTimeout=25
WaitReconnect=2
MaxWaitReconnect=360
;LogLevel=2

;[Server]
;s1=2
;s2=2
;This achieves 50/50 duty

;[Server/s1]
;Connect=DSN=<dns_name_here>;UID=<username_for_dB>;PWD=<password_for_dB>

;[Server/s2]
;Connect=DSN=<dns_name_here>;UID=<username_for_dB>;PWD=<password_for_dB>

[Type]
1=User
2=User
3=User
;Packets of type 1,2, and 3 will be accounted as below

[Type/User]
SQL=INSERT INTO accounting (TransTime, FullName, Authenticator, NASName, NASAddress, Type, PacketsIn, PacketsOut) \
VALUES (%TransactionTime, %FullName/40s, %AuthType/40s, %NASName/40s, %NASAddress, %Type, at Acct-Input-Packets/n, @Acct-Output-Packets/n)


Sqlacct dot acc中大部分配置和前面的Sqlauth.aut 相同,記帳功能同樣也是靠SQL語句完成的,其中各個(gè)變量及其含義可以查看account.ini和 RFC2866   RADIUS 記帳協(xié)議。

通過對以上文件的配置,我們可以實(shí)現(xiàn)簡單的用戶認(rèn)證記帳,各位網(wǎng)友也可以對其修改,實(shí)現(xiàn)其他各種功能

附:各字段的數(shù)據(jù)類型

/xs A text string of length x.
/s indicates a string with the default length of 256
/xb A binary data string of length x. A binary string is different from
an text string in that it is not NULL-terminated and is not
restricted to ASCII characters.
/b indicates a binary data string with the default length of 256.
/n 32-bit integer
/n8 8-bit integer
/n16 16-bit integer
/n32 32-bit integer (same as /n)
/t Timestamp[/size]
  評論這張
轉(zhuǎn)發(fā)至微博
0  分享到:         
閱讀(196)| 評論(0)| 引用 (0) |舉報(bào)

    本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多