Classes in DHCP server

Hello,

I’m currently using ISC dhcp server’s classing features (see [1]) on a Linux server to allocate DHCP clients in specified address pools.
For instance:

  • clients with MAC address ending with aa are assigned an address in address pool 192.168.11.10-254,
  • clients with MAC address ending with ab are assigned an address in address pool 192.168.12.10-254,

This allows me to implement simple routing rules depending on Source IP (192.168.11.0/24 use gateway 172.16.1.1, 192.168.12.0/24 use gateway 172.16.1.2, …) avoiding things like PCC as I suppose having a complex allocation when a new device asks for a leave is “not expensive”.

How can I mimic this with a Mikrotik box ?
Thanks

[1] https://www.isc.org/wp-content/uploads/2017/08/dhcp41conf.html#CLIENT%20CLASSING
[2] https://wiki.mikrotik.com/wiki/Manual:PCC

You currently cannot. PCC works on TCP and UDP connections and would not match on any DHCP protocol fields, and the DHCP stuff is handled before the packets are seen by the firewall (you cannot even block the DHCP server by a drop rule in /ip firewall filter). And no classification by DHCPDISCOVER and DHCPREQUEST protocol fields is implemented in /ip dhcp-server itself. So your only options are to relay the DHCP clients’ traffic to another server which has these capabilities, or let the Mikrotik’s server use RADIUS and do the class-based handling on the RADIUS server.