Community discussions

MikroTik App
 
gdanov
Member Candidate
Member Candidate
Topic Author
Posts: 150
Joined: Thu Jan 17, 2019 1:10 pm

select dhcp network/pool/server based on client identity or option?

Thu Nov 17, 2022 10:36 pm

I have lots of wireless clients using the same SSID. I want to pass different networks(gateway/dns) to different classes of clients. At the moment I do this by fixing the lease to static and dialing in the network ip.
is there way to do it automatically based on client's dhcp configuration?
 
sindy
Forum Guru
Forum Guru
Posts: 10205
Joined: Mon Dec 04, 2017 9:19 pm

Re: select dhcp network/pool/server based on client identity or option?

Fri Nov 18, 2022 12:52 am

You can link a vendor id to an address pool, but that may not be flexible enough.

You can use wireless access list to map the client MAC address to a VLAN (with its own subnet & DHCP server), but with contemporary mobile phones using random MAC addresses it is not much useful any more.

You can also use wpa2-enterprise authentication mode (where the wireless clients authenticate to a RADIUS server by username and password), and it should be possible to let the RADIUS server provide the VLAN ID as well, but I haven't tried that myself yet.
 
gdanov
Member Candidate
Member Candidate
Topic Author
Posts: 150
Joined: Thu Jan 17, 2019 1:10 pm

Re: select dhcp network/pool/server based on client identity or option?

Fri Nov 18, 2022 10:09 am

the devices using random mac address will go to the "default" net and that's OK for my purpose. Point is how to mark the "known" devices to separate nets.
I've got several wifi APs and don't want to assign vlans for now as it is too much work compared to my current primitive solution
 
sindy
Forum Guru
Forum Guru
Posts: 10205
Joined: Mon Dec 04, 2017 9:19 pm

Re: select dhcp network/pool/server based on client identity or option?

Fri Nov 18, 2022 12:30 pm

It's not a big difference whether you let an /ip dhcp-server lease item refer to MAC address (or, more-precisely, client-id) or an /interface wireless access-list or caps-man access-list item. With DHCP lease, you can use also the vendor ID to choose a pool; with /caps-man access-list (not with /interface wireless access-list), you can use MAC address mask, but I guess it doesn't help much as it is similarly rigid like the DHCP vendor-id.

So the only advantage of wireless access list is that you can segment the network using VLANs rather than having all subnets in the same L2 network. If VLANs seem too complicated to you, RADIUS authentication is even more complicated, so not an option either.

One thing you may have missed, in a static DHCP lease, you can still use a pool rather than a particular IP address if you find that useful. But you still need one lease per each "special" client.
 
gdanov
Member Candidate
Member Candidate
Topic Author
Posts: 150
Joined: Thu Jan 17, 2019 1:10 pm

Re: select dhcp network/pool/server based on client identity or option?

Fri Nov 18, 2022 10:03 pm

One thing you may have missed, in a static DHCP lease, you can still use a pool rather than a particular IP address if you find that useful. But you still need one lease per each "special" client.
oh, thank you, that's convenient! didn't notic the drop box.

Who is online

Users browsing this forum: GoogleOther [Bot], Renfrew and 63 guests