Block dynamic dhcp request or assign dynamic dhcp requests an ip from other ip range

Hi,

Two questions I like to test with two scenario’s

  1. I use static dhcp leases (192.168.1.0/26), how can I block all dynamic dhcp requests ?

  2. I use static dhcp leases (192.168.1.0/26) how can I give only dynamic requests a different ip scope (192.168.10.0/24) thats different then static leases scope ?

For scenario 1: I think I must block all unknows mac address but when I add another static lease I must update the block list, only no clue yet howto block a mac address not in the list or is it possible to let the Mikrotik check the static lease list and when mac address is not static mapped it will be blocked. Or is there a better method ?

For scenario 2: Here must the Mikrotik detect if a request is dynamic when yes it gives it a lease address from a pool different as the static ip pool. But same here how to no clue yet.

I hope someone can help me with this.

Best regards,

  1. Don’t enable dynamic leases:
/ip dhcp-server
add address-pool=static-only <other parameters>
  1. Select dynamic pool for server and create static leases from another subnet as you need.

Hi I tryed to add a static pool to my ether1 and a second dynamic pool to ether1 but it doesnt work it gives a message there is already a dhcp server

Error: Couldn’t add new dhcp server - server or relay with such interface already exists

You can only have a single DHCP server per interface, but you can give it a list of pools to use rather than a single one. And you do not need a pool for the static leases (but you do need an “/ip dhcp network” for them).

Drawback of using multiple pools per single DHCP “network” is that all DHCP settings (i.e. gateway, DNS server, …) apart leased IP address are same for all leases served via same DHCP “network”.
They are good if one needs large number of IP addresses for dynamic leases but the address space is not continuous.

If you need different set of “other” DHCP settings, have a look at this post.

I can set the server static only but I cannot set a pool static and second pool dynamic

Any example when its possible would be appreaciated

static-only more or less substitutes “none” here, so when I wrote that you can combine static leases and pools on a single server, it means that you configure at least one pool, the static leases are used automatically even if they don’t fit into any pool.

The /ip dhcp-server network is another case, you need one matching the lease (no matter whether a static one or a dynamic one from a pool) to give the client the default gateway, DNS and other settings based on the subnet to which it fits.

Hi,

Thanx it works now, first I tested the pool and static leases, after that I did configure a pool for dynamic and pointed the dhcp server to that network pool.
The static mappings also still work.