Jump to content

Free Radius


Recommended Posts

  • 3 years later...
Posted

I just got this working after about half a day of messing around with it.

 

I believe the entire issue is the installation of the FreeRadius docker does not populate the /etc/raddb folder in your appdata folder. 
So, starting the docker initially with no paths to the specific configuration files is required to copy them to a temporary path.
 

### Create container path "temp"
Container Path: /temp    /mnt/user/appdata/freeradius/raddb/

 

### Start freeradius docker

### Open console and copy any files you want to map. You may not need all of these. 

root@2ee28889069d:/etc/raddb# cp clients.conf /temp/
root@2ee28889069d:/etc/raddb# cp dictionary /temp/
root@2ee28889069d:/etc/raddb# cp radiusd.conf /temp/
root@2ee28889069d:/etc/raddb# cp templates.conf /temp/
root@2ee28889069d:/etc/raddb# cp trigger.conf /temp/
root@2ee28889069d:/etc/raddb# cp mods-config/files/* /temp/mod-config/files/


### Check the file owner and permissions of the copied files. Mine copied over as an SMB share username, except for the mod-config folder. I probably created that manually. 
### This may require tweaking later, but I don't know at this point. The docker would NOT start if the mod-config folder was owned by root:root.

root@unraid:/mnt/user/appdata/freeradius/raddb# ls -la
drwxrwxrwx 1 nobody users   140 Apr  1 10:21 ./
drwxrwxrwx 1 nobody users    10 Apr  1 09:00 ../
-rwxrw-rw- 1 andy   users  8323 Apr  1 10:32 clients.conf*
-rwxrw-rw- 1 andy   users  1420 Apr  1 10:33 dictionary*
drwxr-xr-x 1 root   root     10 Apr  1 10:14 mod-config/
-rwxrw-rw- 1 andy   users 30769 Apr  1 10:33 radiusd.conf*
-rwxrw-rw- 1 andy   users  3470 Apr  1 10:33 templates.conf*
-rwxrw-rw- 1 andy   users  8536 Apr  1 10:33 trigger.conf*

root@unraid:/mnt/user/appdata/freeradius/raddb# chmod -R 755 *
root@unraid:/mnt/user/appdata/freeradius/raddb# ls -la
drwxrwxrwx 1 nobody users   140 Apr  1 10:21 ./
drwxrwxrwx 1 nobody users    10 Apr  1 09:00 ../
-rw-r--r-- 1 nobody users  8323 Apr  1 10:32 clients.conf
-rw-r--r-- 1 nobody users  1420 Apr  1 10:33 dictionary
drw-r--r-- 1 nobody users    10 Apr  1 10:14 mod-config/
-rw-r--r-- 1 nobody users 30769 Apr  1 10:33 radiusd.conf
-rw-r--r-- 1 nobody users  3470 Apr  1 10:33 templates.conf
-rw-r--r-- 1 nobody users  8536 Apr  1 10:33 trigger.conf


### I checked that I was able to see and EDIT the files from an SMB share. 


### Edit docker and add all the paths of the files/folders above
### I could not get the Docker to start if I mapped the entire ./mod-config/files/ folder. I had to map each file individually. I have no idea why. Looking back it might of not been enough permissions (755 needed?)

clients.conf     /etc/raddb/clients.conf            /mnt/user/appdata/freeradius/raddb/clients.conf
radiusd.conf    /etc/raddb/radiusd.conf            /mnt/user/appdata/freeradius/raddb/radiusd.conf
trigger.conf    /etc/raddb/trigger.conf            /mnt/user/appdata/freeradius/raddb/trigger.conf
templates.conf    /etc/raddb/templates.conf        /mnt/user/appdata/freeradius/raddb/templates.conf
dictionary        /etc/raddb/dictionary            /mnt/user/appdata/freeradius/raddb/dictionary
authorize        /etc/raddb/mods-config/files/authorize    /mnt/user/appdata/freeradius/raddb/mod-config/files/authorize
accounting        /etc/raddb/mods-config/files/accounting    /mnt/user/appdata/freeradius/raddb/mod-config/files/accounting
dhcp            /etc/raddb/mods-config/files/dhcp        /mnt/user/appdata/freeradius/raddb/mod-config/files/dhcp
pre-proxy        /etc/raddb/mods-config/files/pre-proxy    /mnt/user/appdata/freeradius/raddb/mod-config/files/pre-proxy


### Edit the configurations as required for your configuration
### At minumum you will need to edit clients.conf and add your private-network and radius secret:

client private-network-lab {
    ipaddr        = 10.99.99.0/24
    secret        = testing123
}

 

### and add a user in the mod-config/files/authorize file

radius-test-username    Cleartext-Password := "radius-test-password"
    Reply-Message := "Hello, %{User-Name}"

 

### Stop the docker. Note doing a "service freeradius restart" resulted in a "unable to bind port" error in the /var/log/freeradius/radius.log/


### Start the docker

Command execution
docker run
  -d
  --name='freeradius-server'
  --net='bridge'
  --privileged=true
  -e TZ="America/Chicago"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="unraid"
  -e HOST_CONTAINERNAME="freeradius-server"
  -e 'Community_Applications_Conversion'='true'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.icon='https://www.gravatar.com/avatar/47f82cdfc3878e38017d7dd458a0b55d?s=120&r=g&d=404'
  -p '1812:1812/udp'
  -p '1813:1813/udp'
  -v '/mnt/user/appdata/freeradius/raddb/clients.conf':'/etc/raddb/clients.conf':'rw,slave'
  -v '/mnt/user/appdata/freeradius/raddb/radiusd.conf':'/etc/raddb/radiusd.conf':'rw,slave'
  -v '/mnt/user/appdata/freeradius/raddb/trigger.conf':'/etc/raddb/trigger.conf':'rw,slave'
  -v '/mnt/user/appdata/freeradius/raddb/templates.conf':'/etc/raddb/templates.conf':'rw,slave'
  -v '/mnt/user/appdata/freeradius/raddb/dictionary':'/etc/raddb/dictionary':'rw,slave'
  -v '/mnt/user/appdata/freeradius/raddb/mod-config/files/':'/etc/raddb/mods-config/files/':'rw,slave' 'freeradius/freeradius-server'
874f2ab4edaec5edf4e20b1c67797e976eeb7d74e19b60dde4208499a58afe31

The command finished successfully!



This finally got it running for me. I haven't seen any posts of other people getting this to work. I refused to be defeated, LOL.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...