Page 1 of 1

Strange /ip/dhcp-server/network entries

Posted: Sun Feb 09, 2025 7:29 pm
by keg415
My configuration after upgrading to routeros 7.17.2 has these commands:
/ip dhcp-server network
add address=10.1.10.0/32 comment=defconf dns-server=10.1.10.1 gateway=\
    10.1.10.1 netmask=24
add address=10.1.10.0/24 comment=defconf dns-server=10.1.10.1 gateway=\
    10.1.10.1 netmask=24
Is this correct?

Re: Strange /ip/dhcp-server/network entries  [SOLVED]

Posted: Sun Feb 09, 2025 7:46 pm
by jaclaz
The first one is "wrong".
address=10.1.10.0/32 with netmask=24 makes no sense, but it is strange that it is the result of an upgrade, or, if it is, there may well be other things you have not noticed.

Re: Strange /ip/dhcp-server/network entries

Posted: Sun Feb 09, 2025 8:40 pm
by anav
Concur plus on my configs netmask=24 does not show up so it may mean you added it manually and if so should be removed.

Re: Strange /ip/dhcp-server/network entries

Posted: Sun Feb 09, 2025 11:56 pm
by keg415
I don't recall adding this manually, and the entry does say defconf. The UI entry shows:
Address: 10.1.10.0
Gateway: 10.1.10.1
Netmask: 24
It appears that not specifying Address: 10.1.10.0/24 causes it to default to 10.1.10.0/32 even though Netmask is 24.
I've removed it.

Re: Strange /ip/dhcp-server/network entries

Posted: Mon Feb 10, 2025 10:46 am
by jaclaz
Yes, if you just put the IP without the /xx as netmask, it will assume /32, but this implies that the entry has been typed/added, and if you didn't do that, it remains strange that the upgrade process created it.

Re: Strange /ip/dhcp-server/network entries

Posted: Mon Feb 10, 2025 7:23 pm
by keg415
OK, thanks. It's possible I created the entry, I just don't recall why I'd have done so.

Re: Strange /ip/dhcp-server/network entries

Posted: Mon Feb 10, 2025 7:31 pm
by rextended
The first one is "wrong".
address=10.1.10.0/32 with netmask=24 makes no sense, but it is strange that it is the result of an upgrade, or, if it is, there may well be other things you have not noticed.
Is not wrong, is just for exactly 10.1.10.0 (/32) that is provided dns-server=10.1.10.1 gateway=10.1.10.1 netmask=24

10.1.10.0 is one address exactly all other addresses, just the use of the address with /30..23 make it special for "some reason"...

You can have a pool and if you want provide, for some reason, to the 10.1.10.52 one different DNS and gateway, you can do it, keeping same netmask...
Single (/32) IP have precedence, more specific pool have precedence over less specific pools.

examples code

/ip dhcp-server network
# the address field really is a CIDR used for IPs interval, is not one address literally...

# to 10.1.10.15 provide this...
add address=10.1.10.15/32 comment=defconf dns-server=10.1.10.2 gateway=10.1.10.2 netmask=24

# from 10.1.10.16 to 10.1.10.32 provide this...
add address=10.1.10.16/28 comment=defconf dns-server=8.8.8.8 gateway=10.1.10.8 netmask=24

# from 10.1.10.0 to 10.1.10.255 provide this...
add address=10.1.10.0/24 comment=defconf dns-server=10.1.10.1 gateway=10.1.10.1 netmask=24

Re: Strange /ip/dhcp-server/network entries

Posted: Mon Feb 10, 2025 11:35 pm
by jaclaz
10.1.10.0? :?
In /24 networks .0 and .255 are not usable, valid are .1 to .254.
In smaller networks, the first and last one should as well not be usable.
It should be a usable host address only on larger than/24 networks i.e. /23, but the /23 Is 10.1.8.0/23 (that ends before 10.1.10.0) or 10.1.10.0/23 where first usable Is 10.1.10.1, so it needs a /22, inside 10.1.8.0/22, 10.1.10.0 is a perfectly valid host address.
Of course It Is entirely possible that It Is some kind of special notation in Mikrotik, similar to how /32 Is used where on other systems /31 Is used.

Re: Strange /ip/dhcp-server/network entries

Posted: Tue Feb 11, 2025 10:20 am
by rextended
10.1.10.0 is a valid address, until is used inside a "LAN"...

If you have, for example, a pool 10.1.10.0/24 (10.1.10.0-10.1.10.255) the pppoe can use 10.1.10.0 and 10.1.10.255 for go out on internet without problems.

Then, that some software are badly written and do not work with .0 and .255, even if they are inside a... /8... is another matter.
In fact there are a lot of "thrown away" addresses on the internet that end with .0 and .255 (~29 Milions)

No one would stop Google from activating a DNS also on 8.8.8.0 or 8.8.8.255
Network and Broadcast are generically just concepts of the local LAN...