Community discussions

 
rene72
just joined
Topic Author
Posts: 12
Joined: Fri Jun 14, 2019 11:35 am

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

Fri Jun 14, 2019 9:24 pm

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,
 
Sob
Forum Guru
Forum Guru
Posts: 4631
Joined: Mon Apr 20, 2009 9:11 pm

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

Fri Jun 14, 2019 10:24 pm

1) Don't enable dynamic leases:
/ip dhcp-server
add address-pool=static-only <other parameters>
2) Select dynamic pool for server and create static leases from another subnet as you need.
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply.
 
rene72
just joined
Topic Author
Posts: 12
Joined: Fri Jun 14, 2019 11:35 am

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

Sat Jun 15, 2019 12:07 pm

1) Don't enable dynamic leases:
/ip dhcp-server
add address-pool=static-only <other parameters>
2) 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
 
sindy
Forum Guru
Forum Guru
Posts: 3810
Joined: Mon Dec 04, 2017 9:19 pm

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

Sat Jun 15, 2019 1:03 pm

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).
Instead of writing novels, post /export hide-sensitive. Use find&replace in your favourite text editor to systematically replace all occurrences of each public IP address potentially identifying you by a distinctive pattern such as my.public.ip.1.
 
mkx
Forum Guru
Forum Guru
Posts: 2932
Joined: Thu Mar 03, 2016 10:23 pm

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

Sat Jun 15, 2019 1:17 pm

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.
BR,
Metod
 
rene72
just joined
Topic Author
Posts: 12
Joined: Fri Jun 14, 2019 11:35 am

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

Sat Jun 15, 2019 9:42 pm

I can set the server static only but I cannot set a pool static and second pool dynamic
 
rene72
just joined
Topic Author
Posts: 12
Joined: Fri Jun 14, 2019 11:35 am

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

Sat Jun 15, 2019 9:43 pm

Any example when its possible would be appreaciated
 
sindy
Forum Guru
Forum Guru
Posts: 3810
Joined: Mon Dec 04, 2017 9:19 pm

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

Sat Jun 15, 2019 10:12 pm

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.
Instead of writing novels, post /export hide-sensitive. Use find&replace in your favourite text editor to systematically replace all occurrences of each public IP address potentially identifying you by a distinctive pattern such as my.public.ip.1.
 
rene72
just joined
Topic Author
Posts: 12
Joined: Fri Jun 14, 2019 11:35 am

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

Sun Jun 16, 2019 1:55 pm

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.

Who is online

Users browsing this forum: Google [Bot] and 87 guests