Community discussions

MikroTik App
 
anv
newbie
Topic Author
Posts: 31
Joined: Mon Jul 04, 2011 5:19 pm
Location: Spain

[solved]DHCP assigning IPs out of the pool

Fri Sep 02, 2016 11:03 am

I have dhcp server configured to lease ips in the range 192.168.30.x but sometimes it assigns ips like 192.168.29.x

The dhcp server uses pool "dhcp"
Pool dhcp is 192.168.30.42-192.168.30.90 and next pool is pool1
Pool pool1 is 192.168.30.15-192.168.30.20 and next pool is pool2
Pool pool2 is 192.168.30.25-192.168.30.33 and next pool is pool3
Pool pool3 is 162.168.30.120-192.168.30.159 and next pool is "none".

All the pools has ips in the range 192.168.30.x but sometimes dhcp assigns ips in the range 192.168.29.x

An example from system log:

Time Sep/02/2016 09:10:02
Buffer memory
Topics
dhcp
info
Message dhcp1 assigned 192.168.29.232 to 84:38:38:DD:FC:9D


Any ideas of what is wrong please?
Last edited by anv on Fri Sep 02, 2016 4:14 pm, edited 1 time in total.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10506
Joined: Mon Jun 08, 2015 12:09 pm

Re: DHCP assigning IPs out of the pool

Fri Sep 02, 2016 11:48 am

It looks like you have a second server, dhcp1, maybe it is configured somewhere on a bridged network?
 
anv
newbie
Topic Author
Posts: 31
Joined: Mon Jul 04, 2011 5:19 pm
Location: Spain

Re: DHCP assigning IPs out of the pool

Fri Sep 02, 2016 11:59 am

It looks like you have a second server, dhcp1, maybe it is configured somewhere on a bridged network?
But the mikrotik records in its log it is assigning hte IP, and the IP appears in the leases list of the mikrotik...
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: DHCP assigning IPs out of the pool

Fri Sep 02, 2016 12:19 pm

post an export... maybe wrong netmask definition?
 
anv
newbie
Topic Author
Posts: 31
Joined: Mon Jul 04, 2011 5:19 pm
Location: Spain

Re: DHCP assigning IPs out of the pool

Fri Sep 02, 2016 12:34 pm

post an export... maybe wrong netmask definition?
But... the dhcp server should serve ips only in the range configured in the pools...

Here the relevant parts of the export:
/ip address
add address=192.168.30.200/24 comment=LAN interface=ether13-lan network=\
    192.168.30.0
add address=192.168.31.200/24 interface=ether13-lan network=192.168.31.0
/ip pool
add name=pool3 ranges=162.168.30.120-192.168.30.159
add name=ovpn-pool ranges=10.168.30.2-10.168.30.254
add name=pool2 next-pool=pool3 ranges=192.168.30.25-192.168.30.33
add name=pool1 next-pool=pool2 ranges=192.168.30.15-192.168.30.20
add name=dhcp next-pool=pool1 ranges=192.168.30.42-192.168.30.90
/ip dhcp-server
add address-pool=dhcp disabled=no interface=ether13-lan name=dhcp1
 
pe1chl
Forum Guru
Forum Guru
Posts: 10506
Joined: Mon Jun 08, 2015 12:09 pm

Re: DHCP assigning IPs out of the pool

Fri Sep 02, 2016 2:05 pm

But the mikrotik records in its log it is assigning hte IP, and the IP appears in the leases list of the mikrotik...
Yes but it says it is using server dhcp1 while you post the config for dhcp (without 1)
 
anv
newbie
Topic Author
Posts: 31
Joined: Mon Jul 04, 2011 5:19 pm
Location: Spain

Re: DHCP assigning IPs out of the pool

Fri Sep 02, 2016 2:12 pm

But the mikrotik records in its log it is assigning hte IP, and the IP appears in the leases list of the mikrotik...
Yes but it says it is using server dhcp1 while you post the config for dhcp (without 1)
Hummm... dhcp1 is the name of the dhcpserver. The name of the pool is "dhcp".

/ip dhcp-server
add address-pool=dhcp disabled=no interface=ether13-lan name=dhcp1
 
Rudios
Forum Veteran
Forum Veteran
Posts: 977
Joined: Mon Mar 11, 2013 12:58 pm
Location: The Netherlands

Re: DHCP assigning IPs out of the pool

Fri Sep 02, 2016 3:48 pm

...
Unless you made a typo with pasting here, your pool3 has a very strange range

/ip pool
add name=pool3 ranges=162.168.30.120-192.168.30.159
 
anv
newbie
Topic Author
Posts: 31
Joined: Mon Jul 04, 2011 5:19 pm
Location: Spain

Re: DHCP assigning IPs out of the pool

Fri Sep 02, 2016 4:14 pm

...
Unless you made a typo with pasting here, your pool3 has a very strange range

/ip pool
add name=pool3 ranges=162.168.30.120-192.168.30.159

AHHH!! Thank you. This must be the problem!!
 
Rudios
Forum Veteran
Forum Veteran
Posts: 977
Joined: Mon Mar 11, 2013 12:58 pm
Location: The Netherlands

Re: DHCP assigning IPs out of the pool

Fri Sep 02, 2016 4:16 pm

...
Unless you made a typo with pasting here, your pool3 has a very strange range

/ip pool
add name=pool3 ranges=162.168.30.120-192.168.30.159

AHHH!! Thank you. This must be the problem!!
Could be, although it is very weird that the router 'chooses' to assign 192.168.29.x and not anything starting between 162 and 192...
anyway I hope you can solve your problem.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10506
Joined: Mon Jun 08, 2015 12:09 pm

Re: DHCP assigning IPs out of the pool

Fri Sep 02, 2016 5:10 pm

Could be, although it is very weird that the router 'chooses' to assign 192.168.29.x and not anything starting between 162 and 192...
anyway I hope you can solve your problem.
Probably he took his device from another of his networks where it received that 192.168.29 address from another router,
and now he connects to this router, the device asks if it can get a lease for that address, the router looks in its pools
and decides "why not?" and issues the address.
I would expect this to happen only when 192.168.29.x is a valid address on the interface, which is kind of strange when the
main pools are all on 192.168.30.x, but maybe the network is layed out like that? Or there is a bug, in that the DHCP
server issues addresses from a pool even when they are outside the subnet of the interface. Questionable if that even
can be called a bug, or is just punishment for incorrect configuration. :-)
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: [solved]DHCP assigning IPs out of the pool

Mon Sep 05, 2016 12:18 pm

 /ip pool
add name=pool3 ranges=162.168.30.120-192.168.30.159
The typo in that pool makes the range huge, including in fact that IP in the pool:
# ipcalc 162.168.30.120-192.168.30.159

deaggregate 162.168.30.120 - 192.168.30.159
162.168.30.120/29
162.168.30.128/25
162.168.31.0/24
162.168.32.0/19
162.168.64.0/18
162.168.128.0/17
162.169.0.0/16
162.170.0.0/15
162.172.0.0/14
162.176.0.0/12
162.192.0.0/10
163.0.0.0/8
164.0.0.0/6
168.0.0.0/5
176.0.0.0/4
192.0.0.0/9
192.128.0.0/11
192.160.0.0/13
192.168.0.0/20
192.168.16.0/21
192.168.24.0/22
192.168.28.0/23
192.168.30.0/25
192.168.30.128/27

Who is online

Users browsing this forum: GoogleOther [Bot], kleshki, n5n5 and 30 guests