RADIUSサーバ - shima-jun/mywiki GitHub Wiki
RADIUS
- インストール
- firewall
- RADIUSサーバ設定
- デバック環境テスト
- パケットキャプチャ
1.インストール
[root@ms1 ~]# dnf install freeradius freeradius-utils freeradius-ldap
メタデータの期限切れの最終確認: 2:47:44 時間前の 2021年06月07日 14時01分05秒 に実施しました。
依存関係が解決しました。
=============================================================================
パッケージ Arch バージョン Repo サイズ
=============================================================================
インストール:
freeradius x86_64 3.0.20-3.module_el8.3.0+476+0982bc20 appstream 1.1 M
freeradius-ldap x86_64 3.0.20-3.module_el8.3.0+476+0982bc20 appstream 118 k
freeradius-utils
x86_64 3.0.20-3.module_el8.3.0+476+0982bc20 appstream 242 k
依存関係のインストール:
perl-DBI x86_64 1.641-3.module_el8.1.0+199+8f0a6bbd appstream 740 k
モジュールストリームの有効化中:
freeradius 3.0
perl-DBI 1.641
~~~~~~~~~~~~~~~~省略~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
インストール済み:
freeradius-3.0.20-3.module_el8.3.0+476+0982bc20.x86_64
freeradius-ldap-3.0.20-3.module_el8.3.0+476+0982bc20.x86_64
freeradius-utils-3.0.20-3.module_el8.3.0+476+0982bc20.x86_64
perl-DBI-1.641-3.module_el8.1.0+199+8f0a6bbd.x86_64
完了しました!
2.firewall
[root@ms1 cur]# firewall-cmd --add-service=radius --permanent success [root@ms1 cur]# firewall-cmd --reload success
3.RADIUSサーバ設定
- /etc/raddb/site-enabledにある、default及びinner-tunnelファイルをLDAP有効化
- /etc/raddb/mods-availableにある、ldapファイルを修正
- server=‘IPアドレス’
- port = 389
- identity = 'cn=Directory Manager’
- password = パスワード - base_dn = 'dc=example08,dc=jp‘
- ldapファイルをmods-enabledディレクトリへシンボリックリンク
- users、dictionaryをLDAP対応にする
- clients.confは自PCのIPアドレスを登録
/etc/raddb/site-enabledにある、default及びinner-tunnelファイルをLDAP有効
●/etc/raddb/sites-enabled/default ※ 以下の項目のコメントアウトを外してください。
authorize {
ldap
authenticate {
Auth-Type LDAP {
ldap
}
post-auth {
ldap
●/etc/raddb/sites-enabled/inner-tunnel
※ 以下を編集してください。
listen {
ipaddr = *
※ 以下のコメントアウトを外してください。
authorize {
ldap
authenticate {
Auth-Type LDAP {
ldap
}
post-auth {
ldap
/etc/raddb/mods-availableにある、ldapファイルを修正
上記
ldapファイルをmods-enabledディレクトリへシンボリックリンク
[root@ms1 mods-enabled]#ln -s ./../mods-enabled/ldap
[root@ms1 mods-enabled]# ll
~~~~~~~~~省略~~~~~~~~~
lrwxrwxrwx 1 root root 30 6月 8 09:50 ldap -> /etc/raddb/mods-available/ldap
~~~~~~~~~省略~~~~~~~~~
(グループをradiusdに変えてもいいかも)
users、dictionaryをLDAP対応にする
[root@ms1 raddb]# vi users
※最後に追記
##追加
DEFAULT Auth-Type := LDAP
Fall-Through = 1
[root@ms1 raddb]# diff dictionary dictionary.org
50,52d49
<
< ##追加
< VALUE AUTH-Type LADP 5
clients.confは自PCのIPアドレスを登録
[root@ms1 raddb]# diff clients.conf clients.conf.org
269,279d268
<
<
< ###追加
< client new1 {
< ipaddr = 10.1.4.8
< secret = test1
< }
< client new2 {
< ipaddr = 10.2.141.142
< secret = test2
< }
正式な書き方
client [IPアドレス]{
secret = 'word'
shortname = 'IPアドレスやドメイン(任意の内容で〇)
}
4.デバック環境テスト
RADIUSサーバのデバックモード
[root@ms1]#radiusd -X
5.パケットキャプチャ
No. | Time | Soruce | Destination | Protocol | Length | Info |
---|---|---|---|---|---|---|
1 | 0.000000 | 自PCIP | RADIUSサーバIP | RADIUS | 92 | Access-Request id=25 |
2 | 0.000886 | RADIUSサーバIP | LDAPサーバIP | LDAP | 73 | unbindRequest(2) |
18 | 0.020540 | RADIUSサーバIP | LDAPサーバIP | LDAP | 215 | searchRequest(2) "dc=example08,dc=jp" wholeSubtree |
19 | 0.021504 | LDAPサーバIP | RADIUSサーバIP | LDAP | 599 | searchResEntry(2) "uid=pncuser,ou=people,dc=example00,dc=jp" |
20 | 0.021632 | LDAPサーバIP | RADIUSサーバIP | LDAP | 80 | searchResDone(2) success [1 result] |
31 | 0.105394 | LDAPサーバIP | RADIUSサーバIP | LDAP | 80 | bindResponse(3) success |
32 | 0.105713 | RADIUSサーバIP | LDAPサーバIP | LDAP | 180 | modifyRequest(2) "uid=example,ou=people,dc=example00,dc=jp" |
33 | 0.108687 | LDAPサーバIP | RADIUSサーバIP | LDAP | 80 | modifyResponse(2) success |
35 | 0.108956 | RADIUSサーバIP | LDAPサーバIP | RADIUS | 62 | Access-Accept id=25 |