Providing dynamic DHCP leases for multiple routers on multiple interfaces

Alan DeKok aland at
Thu Aug 4 13:37:54 UTC 2022

On Aug 3, 2022, at 8:03 PM, Matthew McTague via Freeradius-Users <freeradius-users at> wrote:
> I want to use FreeRADIUS to provide DHCP, using a MySQL database to store information.
> I have multiple MikroTik routers that each have DHCP Relay configured for multiple interfaces, with unique local / source addresses.
> I want to configure an IP pool per interface, and authenticate client devices by mac address.

  What information about the interfaces shows up in the packet?  i.e. Option 82, or... ?

> I see I can configure clients in sites-available/dhcp using their IPv4 addresses, and I think this will allow me to set IP-Pool.Name for each client. In my scenario, these clients would each represent a DHCP Relay configured for a specific interface on a MikroTik router).

  That could work.

> I understand that I can use mods-available/sqlippool to configure IP pools using an SQL table. I like this, it's ideal for my needs.
> Rather than storing these clients in sites-available/dhcp, I would like to store these in MySQL. Is this possible?

  See mods-available/sql.  Clients can be stored in SQL.

> For authenticating by mac address, I understand that I can include sql.authorize in sites-available/dhcp and this will allow me to authenticate using the radcheck and radreply tables.


> Would this plan work, and is this the correct way to achieve my goal?

  That should work.

  As always, test each piece all by itself.  Test one thing at a time.  Read the debug output.

  It feels slow, but it's infinitely faster than randomly changing ten things at the same time, and hoping that it all magically starts working.

  Alan DeKok.

More information about the Freeradius-Users mailing list