| 1 |
= Simultaneous-Use checking |
| 2 |
|
| 3 |
There are a whole lot of pieces which have to work together for |
| 4 |
`Simultaneous-Use` to work. In this guide, we assume that user |
| 5 |
sessions are stored in SQL. |
| 6 |
|
| 7 |
For `Simultaneous-Use` to work. the server needs to know who is |
| 8 |
online, which means that accounting must be configured and working. |
| 9 |
Start off by checking the basics, independent of `Simultaneous-Use`. |
| 10 |
|
| 11 |
If you are using EAP, you may also need to configure the |
| 12 |
`inner-tunnel` virtual server, and the `session` section there. Be |
| 13 |
also careful to correctly handle the difference between the "outer" |
| 14 |
User-Name, and the "inner-tunnel" User-Name. |
| 15 |
|
| 16 |
As always, start off with reading the debug output, and use that |
| 17 |
information to answer a few questions. |
| 18 |
|
| 19 |
== Did the user get Access-Accept? |
| 20 |
|
| 21 |
*No* - Fix that. Make sure that the user can be authenticated! |
| 22 |
|
| 23 |
*Yes* - FreeRADIUS told the NAS to allow the user online. This usually |
| 24 |
works, but perhaps the NAS disagreed, and still dropped the user. It happens. |
| 25 |
|
| 26 |
The only way you know that a user is actually online is to check the |
| 27 |
accounting data. So we will do that next. |
| 28 |
|
| 29 |
== Did the server then get an Accounting-Request for that user? |
| 30 |
|
| 31 |
*No* - The NAS isn't sending accounting packets, Simultaneous-Use will never work. |
| 32 |
|
| 33 |
Go fix the NAS so that it sends accounting packets. |
| 34 |
|
| 35 |
*Yes* - The NAS is telling FreeRADIUS that it allowed the user online, |
| 36 |
and the user has an active session. We now have to see where that data is stored. |
| 37 |
|
| 38 |
== Did the accounting data go into the radacct table? |
| 39 |
|
| 40 |
As always, Read the debug output. |
| 41 |
|
| 42 |
*No* - There is nothing in the debug output about radacct? Configure the server to write accounting data to SQL |
| 43 |
|
| 44 |
ou can use `radclient` to send fake accounting packets for testing. |
| 45 |
Use a real accounting packet as a template for input to `radclient`, |
| 46 |
but change the `User-Name` so that the tests don't affect real users. |
| 47 |
|
| 48 |
|
| 49 |
*Yes* - You see successful `INSERT` or `UPDATE` lines in `radacct`. That's good! |
| 50 |
|
| 51 |
== One last check |
| 52 |
|
| 53 |
Double-check the radacct database using an SQL client. Just to be sure that the data is really there. |
| 54 |
|
| 55 |
== It is now set up correctly to track user sessions |
| 56 |
|
| 57 |
If all that works, then the server is set up correctly to authenticate |
| 58 |
users, and to store their data in SQL. This is the foundation for |
| 59 |
`Simultaneous-Use`. |
| 60 |
|
| 61 |
== Set Simultaneous-Use |
| 62 |
|
| 63 |
Then, configure the server to set `Simultaneous-Use=1`. That tells the server to enforce `Simultaneous-Use`. That configuration can go into the `files` module, `sql`, or whereever else you want. |
| 64 |
|
| 65 |
You will also need to configure the `default` virtual server to check session data in SQL. Look for `Simultaneous-Use` in `sites-available/default`. Uncomment the line containing `sql` |
| 66 |
|
| 67 |
== Double check that a user can still log in! |
| 68 |
|
| 69 |
Go through all of the above steps _again_, checking that the user can |
| 70 |
log in, and that the server is receiving accounting packets. |
| 71 |
|
| 72 |
This time, also look for the debug output to contain: |
| 73 |
|
| 74 |
``` |
| 75 |
# Executing section session from file ... |
| 76 |
session { |
| 77 |
``` |
| 78 |
|
| 79 |
That shows it is checking the `session` database. If all goes well, the next few lines after that should show that it is checking `sql`. |
| 80 |
|
| 81 |
If the above text doesn't appear, then the server isn't getting told to set `Simultaneous-Use = 1`. You will have to fix that before going to the next step. |
| 82 |
|
| 83 |
If the user has not logged in yet, you will see an `Access-Accept`. Otherwise, if the user already has an active session, the server should say that the user is being rejected due to multiple logins. |