DHCP Option 82 circuit/remote ID for server leases in v7?

This has been a huge limitation for us for a long time, being unable to do leases via DHCP Option82 parameters
I saw in RouterOS v7 that User Manager has had an overhaul, i’m wondering if its now possible to somehow use this (or just the base DHCP server) to assign addresses based on either the Circuit ID or Remote ID fields?

I see that custom attributes can be set in the User Manager tab, but I think this is in the opposite direction? i.e. these attributes are pushed to the client. They are not read and matched in order to assign an appropriate lease

I’d really like to get away from using a third party DHCP server that literally only exists for us because MikroTik doesn’t seem to support this one thing, even though it will display both fields as read-only parameters on a lease

Perhaps you can use Docker on your Mikrotik model to run exactly a instance of a DHCP Server that supports your needs.

So you do not need an extra device for this job.

This requires learning how to work with docker, setting up a new DHCP server etc. It’s a lot of administrative overhead as I want this to be easily manageable by staff members (even if a simple webpage with API integration and not directly logging into the router)
The really simple straightforward solution is to simply add this to DHCP server lease options, or in user manager. Quite a simple thing to do and doesn’t add a bunch of extra headache points

Agreed, it would be really REALLY nice to just have this option in the DHCP server.

I don’t even need it to be radius backed, I just want to hand out the same IP to clients regardless of their router without having to log in. ie, ‘slot’ and ‘port’ ID in option 82.

couple of use cases.

one, simple PtMP with DHCP Option 82 on the CPE, traditional wISP need w/o having extra software in the mix.

Also, port based DHCP… Consider a network switch with 24 ports. Would be a fantastic use case to pass IPs to specific ports, especially for things like IP cameras. Port 1 is 192.168.10.1/24 gw 254, port 7 is 192.168.10.7/24, or however you want to number it.

Using the container feature it can be done like this with Kea DHCP for example on RB5009 on ether2 to ether8

/file/edit config/dhcp4.json contents
{
    "Dhcp4": {
        "valid-lifetime": 4000, "renew-timer": 1000, "rebind-timer": 2000,
        "subnet4": [{
           "subnet": "192.168.88.0/24",
           "id": 1, "reservations": [
            { "circuit-id": "'MikroTik eth 0/3'", "ip-address": "192.168.88.12" },
            { "circuit-id": "'MikroTik eth 0/4'", "ip-address": "192.168.88.13" },
            { "circuit-id": "'MikroTik eth 0/5'", "ip-address": "192.168.88.14" },
            { "circuit-id": "'MikroTik eth 0/6'", "ip-address": "192.168.88.15" },
            { "circuit-id": "'MikroTik eth 0/7'", "ip-address": "192.168.88.16" },
            { "circuit-id": "'MikroTik eth 0/8'", "ip-address": "192.168.88.17" },
            { "circuit-id": "'MikroTik eth 0/9'", "ip-address": "192.168.88.18" }
        ] }],
        "option-data": [
        { "data": "192.168.88.1", "name": "domain-name-servers" },
        { "data": "192.168.88.1", "name": "routers" }],
        "interfaces-config": { "interfaces": [ "eth0" ], "dhcp-socket-type": "raw" },
        "host-reservation-identifiers": [ "circuit-id" ],
        "loggers": [{ "name": "*", "severity": "DEBUG" }]
    }
}
/container mounts add dst=/kea/config name=MOUNT_KEA src=/config
/interface veth add address=192.168.88.2/24 name=veth1
/interface bridge port add bridge=bridge interface=veth1 trusted=yes
/interface bridge set add-dhcp-option82=yes dhcp-snooping=yes name=bridge 0
/container config set registry-url=https://registry-1.docker.io
/container add cmd="-c /kea/config/dhcp4.json" interface=veth1 logging=yes mounts=MOUNT_KEA name=kea-dhcp4:3.0.1 start-on-boot=yes
/container/start 0

Live view of leases:

/log/print follow where message ~"allocated"

Anyway it would have been much simpler and nicer if the built in DHCP Server allows for matching on circuit-id

I have no interest in adding a docker DHCP server when the mikrotik server can do it. It needs a few tweaks to do it really well.

Nice Solution. Did not know about KEA... Looks nice and fresh. :slight_smile:
BTW: Yes Mikrotik shoud add those options to there DHCP-Server.

1 Like