Installing
How does pyrad2 work
pyrad2 allows you to build servers and clients for the RADIUS protocol.
It is not meant to be a standalone implementation like FreeRADIUS, but rather as a tool to allow you to build your own server and client.
RADIUS Concepts
Dictionary
For the purpose of using pyrad2, the most important concept is the Dictionary. The dictionary is an actual file on the filesystem.
Note
Dictionary files are textfiles with one command per line.
RADIUS uses dictionaries to define the attributes that can be used in packets. The Dictionary class stores the attribute definitions from one or more dictionary files and allows Server/Client to understand what an attribute code means.
Here's an example of how it looks:
You can find a reference dictionary file here. Another dictionary is provided here with FreeRADIUS vendor-specific attributes.
For our example, download both files and place it into your project folder.
When you see code like this:
You are actually passing a path to a file (or a file-like object) called dictionary
, so make sure the file you pass is accessible from your code and it's a valid dictionary file.