The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

    • @Hannah_Hart95 Een dikkie dik, net wat ouder dan die van @MintheG en Eeega. 59 minutes ago
    • RT @Rijksoverheid: Zet je fietsverlichting aan, dat valt lekker op! Wel zo veilig, zeker nu het vroeg donker wordt. Maar hoe zit het ook al… 1 hour ago
    • RT @kenshirriff: A PC power supply may look like a boring metal box, but there's a lot of interesting circuitry in it. My power supply died… 4 hours ago
    • RT @zorgenzo: Zie nu reclame bericht 🦠 gedragsregels van Overheid op TV.. “Afstand 1,5 meter nemen is opgeheven…”. Waarom die reclame bl… 4 hours ago
    • @kreule_yvonne Ik deed dat nog steeds en blijf het zeker tot na het voorjaar doen. 5 hours ago
  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,482 other followers

Mikrotik – splitting your local LAN so you can assign different gateways and DNS servers by the DHCP server

Posted by jpluimers on 2017/06/09

When you want your Mikrotik DHCP Server handout different gateways (or DNS/WINS/NTP/.. servers and other settings), many of the answers tell you to fiddle with the DHCP networks like DHCP Server different gateways – MikroTik RouterOS [WayBack] but lack concrete examples, so here we go elaborating a lot on DHCP server with static leases – MikroTik RouterOS [WayBack]:

DHCP on a Mikrotik starts with one or more DHCP servers each services on a certain interface from an address pool:

In my case, the pool spans most of a /24 network leaving some room for non-DHCP configured hosts at the bottom and top of the /24 range:

The DHCP server hands out addresses from that pool either static or dynamic as you can make each entry static using the Make Static button:

With a static entry, you can change other options (and revert to dynamic by pressing the Remove button) like the Address or Server:

Back to the DHCP server: it matches the address handed out by the pool (either static or dynamic) with the configured DHCP networks and based on the match the DHCP server will send specific information the gateway/DNS/WINS/NTP servers and other options from the DHCP network to the client.

Most configurations start out with just one configured DHCP network which means they have one set of gateway/DNS/WINS/NTP servers and other options:

The trick to get multiple sets of gateway/DNS/WINS/NTP servers and other DHCP options is two-fold:

  1. Split the DHCP network into multiple subnets
  2. Use static DHCP leases to force certain hosts in certain subnets

An important thing to remember here: be sure to care for IP addresses that were handed out but after the split fall into the “reserved” part of a network (the network address at the bottom and broadcast address at the top of each subnet) and re-assign any of those addresses

So i used wanted to split my local network into a few sub-networks: one /25 and two /26 networks.

For this I used ipcalc (an online version is at IP Calculator / IP Subnetting aka which I mentioned before in Getting the IP addresses of gmail MX servers – via Super User – dig isn’t enough.

I used these to split up the network

Note I could have split them in four /26 subnets but that meant going from 254 hosts back to 248 (62+62+62+62). Now I go back to 250 (126 + 62 + 62) hosts:

Address:          11000000.10101000.01000111 .00000000
Netmask: = 24    11111111.11111111.11111111 .00000000
Wildcard:             00000000.00000000.00000000 .11111111
Network:       11000000.10101000.01000111 .00000000 (Class C)
Broadcast:        11000000.10101000.01000111 .11111111
HostMin:          11000000.10101000.01000111 .00000001
HostMax:        11000000.10101000.01000111 .11111110
Hosts/Net: 254                   (Private Internet)


Netmask: = 25  11111111.11111111.11111111.1 0000000
Wildcard:             00000000.00000000.00000000.0 1111111
Network:       11000000.10101000.01000111.0 0000000 (Class C)
Broadcast:        11000000.10101000.01000111.0 1111111
HostMin:          11000000.10101000.01000111.0 0000001
HostMax:        11000000.10101000.01000111.0 1111110
Hosts/Net: 126                   (Private Internet)

Netmask: = 26  11111111.11111111.11111111.11 000000
Wildcard:              00000000.00000000.00000000.00 111111
Network:     11000000.10101000.01000111.10 000000 (Class C)
Broadcast:        11000000.10101000.01000111.10 111111
HostMin:        11000000.10101000.01000111.10 000001
HostMax:        11000000.10101000.01000111.10 111110
Hosts/Net: 62                    (Private Internet)
Network:     11000000.10101000.01000111.11 000000 (Class C)
Broadcast:        11000000.10101000.01000111.11 111111
HostMin:        11000000.10101000.01000111.11 000001
HostMax:        11000000.10101000.01000111.11 111110
Hosts/Net: 62                    (Private Internet)

Subnets:   3 
Hosts:     250

Since ipcalc cannot do that in one step, I’ve done 2 steps.

Going from 254 to 250 hosts means these addresses cannot be used any more:


Luckily I didn’t have these in use, so now my DHCP networks are these:

Which now I can experiment getting the second gateway working correctly by moving a static DHCP lease into the 3rd network (, in this case from dynamic into static:

And after some waiting:

Turned into:


PS: one of my external nets:

$ ipcalc
Address:       00100101.10011001.11110011.11110 010
Netmask: = 29 11111111.11111111.11111111.11111 000
Wildcard:              00000000.00000000.00000000.00000 111
Network:    00100101.10011001.11110011.11110 000
HostMin:       00100101.10011001.11110011.11110 001
HostMax:       00100101.10011001.11110011.11110 110
Broadcast:       00100101.10011001.11110011.11110 111
Hosts/Net: 6                     Class A
Address:        00100101.10011001.11110011.11110 010
Netmask: = 29  11111111.11111111.11111111.11111 000
Wildcard:               00000000.00000000.00000000.00000 111
Network:     00100101.10011001.11110011.11110 000 (Class A)
Broadcast:        00100101.10011001.11110011.11110 111
HostMin:        00100101.10011001.11110011.11110 001
HostMax:        00100101.10011001.11110011.11110 110
Hosts/Net: 6 


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: