Здесь показаны различия между двумя версиями данной страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
сервис_freeradius [2017/12/12 16:00] val [Настройка c использованием текстовых файлов] |
сервис_freeradius [2020/04/23 17:00] val [Тестирование сервера] |
||
---|---|---|---|
Строка 4: | Строка 4: | ||
===== Инсталляция сервера ===== | ===== Инсталляция сервера ===== | ||
- | ==== Debian 9 ==== | + | !!! Ставится 2-3 минуты !!! |
+ | ==== Debian 9, 10 ==== | ||
<code> | <code> | ||
root@server:~# apt install freeradius | root@server:~# apt install freeradius | ||
Строка 27: | Строка 28: | ||
</code> | </code> | ||
- | ==== FreeBSD ==== | ||
- | <code> | ||
- | [server:~] # pkg install freeradius | ||
- | </code><code> | ||
- | [server:~] # cat /etc/rc.conf | ||
- | </code><code> | ||
- | ... | ||
- | radiusd_enable=yes | ||
- | </code><code> | ||
- | [server:~] # cd /usr/local/etc/raddb/ | ||
- | </code> | ||
- | ==== Windows ==== | ||
- | * [[http://freeradius.net/]] | ||
- | * [[http://val.bmstu.ru/unix/billing/FreeRADIUS.net-1.1.7-r0.0.2.exe]] | ||
===== Настройка сервера ===== | ===== Настройка сервера ===== | ||
Строка 49: | Строка 36: | ||
<code> | <code> | ||
- | server# cat sites-available/default | ||
- | </code><code> | ||
- | authorize { | ||
- | ... | ||
- | # unix | ||
- | files | ||
- | accounting { | ||
- | ... | ||
- | radutmp | ||
- | ... | ||
- | session { | ||
- | ... | ||
- | radutmp | ||
- | ... | ||
- | </code><code> | ||
server# cat clients.conf | server# cat clients.conf | ||
</code><code> | </code><code> | ||
Строка 76: | Строка 48: | ||
shortname = switch | shortname = switch | ||
} | } | ||
- | </code><code> | ||
- | server# cat mods-available/radutmp | ||
- | </code><code> | ||
- | ... | ||
- | check_with_nas = no | ||
- | ... | ||
</code><code> | </code><code> | ||
server# :> users | server# :> users | ||
Строка 94: | Строка 60: | ||
# Service-Type = NAS-Prompt-User, | # Service-Type = NAS-Prompt-User, | ||
# cisco-avpair = "shell:priv-lvl=15" | # cisco-avpair = "shell:priv-lvl=15" | ||
+ | |||
+ | student Cleartext-Password := "password" | ||
401 Cleartext-Password := "401", Simultaneous-Use := 1 | 401 Cleartext-Password := "401", Simultaneous-Use := 1 | ||
402 Cleartext-Password := "402", Simultaneous-Use := 1 | 402 Cleartext-Password := "402", Simultaneous-Use := 1 | ||
+ | |||
+ | 403 Cleartext-Password := "403", Simultaneous-Use := 2 | ||
+ | |||
+ | </code><code> | ||
+ | server# cat radiusd.conf | ||
+ | </code><code> | ||
+ | ... | ||
+ | log { | ||
+ | ... | ||
+ | auth = yes | ||
+ | ... | ||
+ | </code><code> | ||
+ | server# cat sites-available/default | ||
+ | </code><code> | ||
+ | authorize { | ||
+ | ... | ||
+ | # unix | ||
+ | files | ||
+ | accounting { | ||
+ | ... | ||
+ | radutmp | ||
+ | ... | ||
+ | session { | ||
+ | ... | ||
+ | radutmp | ||
+ | ... | ||
+ | </code><code> | ||
+ | server# cat mods-available/radutmp | ||
+ | </code><code> | ||
+ | ... | ||
+ | check_with_nas = no | ||
+ | ... | ||
</code> | </code> | ||
+ | |||
==== Настройка с использованием mysql ==== | ==== Настройка с использованием mysql ==== | ||
Строка 143: | Строка 144: | ||
===== Запуск сервера ===== | ===== Запуск сервера ===== | ||
- | ==== FreeBSD ==== | + | ==== Debian/Ubuntu ==== |
<code> | <code> | ||
- | [server:~] # service radiusd start | + | root@server:~# service freeradius restart |
</code> | </code> | ||
- | ==== Debian/Ubuntu ==== | + | ==== FreeBSD ==== |
<code> | <code> | ||
- | root@server:~# service freeradius restart | + | [server:~] # service radiusd start |
</code> | </code> | ||
Строка 159: | Строка 160: | ||
</code> | </code> | ||
- | Сервис FreeRADIUS.net | ||
===== Тестирование сервера ===== | ===== Тестирование сервера ===== | ||
Строка 170: | Строка 170: | ||
$ radtest user1 rpassword1 127.0.0.1 0 testing123 | $ radtest user1 rpassword1 127.0.0.1 0 testing123 | ||
- | $ echo "User-Name=401,User-Password=401,NAS-IP-Address=127.0.0.1,NAS-Port=0" | radclient localhost auth testing123 | + | # tail -f /var/log/freeradius/radius.log |
- | $ echo "User-Name=401,Acct-Session-Id=6000006B,Acct-Status-Type=Start,NAS-IP-Address=127.0.0.1,NAS-Port=0"| radclient localhost acct testing123 | + | $ echo "User-Name=401,User-Password=401,NAS-IP-Address=127.0.0.1" | radclient localhost auth testing123 |
- | $ echo "User-Name=401,Acct-Session-Id=6000006B,Acct-Status-Type=Stop,NAS-IP-Address=127.0.0.1,NAS-Port=0"| radclient localhost acct testing123 | + | $ echo "User-Name=401,Acct-Session-Id=6000006B,Acct-Status-Type=Start,NAS-IP-Address=127.0.0.1,NAS-Port=401402"| radclient localhost acct testing123 |
+ | |||
+ | # radwho -R | ||
+ | |||
+ | $ echo "User-Name=401,Acct-Session-Id=6000006B,Acct-Status-Type=Stop,NAS-IP-Address=127.0.0.1,NAS-Port=401402"| radclient localhost acct testing123 | ||
</code> | </code> | ||
Строка 226: | Строка 230: | ||
<code> | <code> | ||
- | server# cat eap.conf | + | freeradius2# cat eap.conf |
+ | |||
+ | freeradius3# cat mods-available/eap | ||
</code><code> | </code><code> | ||
... | ... | ||
Строка 232: | Строка 238: | ||
... | ... | ||
</code><code> | </code><code> | ||
- | server# cat modules/mschap | + | freeradius2# cat modules/mschap |
+ | |||
+ | freeradius3# cat mods-available/mschap | ||
+ | freeradius3# cat mods-available/preprocess | ||
</code><code> | </code><code> | ||
... | ... |