Table of Contents

UPDATED 2021 -Limiting Simultaneous Sessions

Why implement it

There is a catch

Check if enabled

vi /etc/freeradius/3.0/mods-config/sql/main/mysql/queries.conf
#######################################################################
# Simultaneous Use Checking Queries
#######################################################################
# simul_count_query     - query for the number of current connections
#                       - If this is not defined, no simultaneous use checking
#                       - will be performed by this module instance
# simul_verify_query    - query to return details of current connections
#                               for verification
#                       - Leave blank or commented out to disable verification step
#                       - Note that the returned field order should not be changed.
#######################################################################
simul_count_query = "\
        SELECT COUNT(*) \
        FROM ${acct_table1} \
        WHERE username = '%{SQL-User-Name}' \
        AND acctstoptime IS NULL"
 
#simul_verify_query = "\
#       SELECT \
#               radacctid, acctsessionid, username, nasipaddress, nasportid, framedipaddress, \
#               callingstationid, framedprotocol \
#       FROM ${acct_table1} \
#       WHERE username = '%{SQL-User-Name}' \
#       AND acctstoptime IS NULL"
#20.04
service freeradius stop
service freeradius start

Applying the limit

You can also add this to a Profile Component

See the limit in action