How to test a Freeradius server login

So you set up your radius server, and you want to make sure that it is authenicationg your users properly.

$radtest username password servername port secret

$radtest clinets-username clients-password (hostname of server) (radtest username password servername port secret) (shared secret between radius client and server)

I would like to note that if set the hostname to somewhere where a radius server does not exist then you will keep on getting output saying “Sending Access-Request of id 27 to 203.65.22.105 port 1812″ this is because the radius server works over UDP so it has no idea if the server received the packets or not, so it just keeps trying.

A successful test looks like this

hostname:~# radtest    username  userpassword hostname.com  1813 sharedsecret
Sending Access-Request of id 60 to 203.65.22.105 port 1812 User-Name = “username”
User-Password = “userpassword”
NAS-IP-Address =203.65.22.105
NAS-Port = 1813
rad_recv: Access-Accept packet from host 203.65.22.105 port 1812, id=60, length=20

A rejected login test looks like this

hostname:~# radtest    username  userpassword hostname.com  1813 sharedsecret
Sending Access-Request of id 60 to 203.65.22.105 port 1812 User-Name = “username”
User-Password = “userpassword”
NAS-IP-Address =203.65.22.105
NAS-Port = 1813
rad_recv: Access-Reject packet from host 208.73.74.68 port 1812, id=80, length=20