Community discussions

MikroTik App
 
danieltnc1981
newbie
Topic Author
Posts: 32
Joined: Sun Jul 16, 2017 1:27 pm

Expand Lan Address

Wed Jun 22, 2022 8:17 am

Good evening everyone.
I have a Mikrotik RB450Gx4 configured in the following way

Headquarters 1:

WAN
LAN - 192.168.1.0/24
DHCP from 192.168.1.10 to 192.168.1.200
40 FIXED IP
VLAN20 - 192.168.20 / 24

This Mikrotik RB450Gx4 is connected in VPN (IPSEC) with 4 locations, all with mikrotik router

Headquarters 2:

WAN
LAN - 192.168.2.0/24
DHCP from 192.168.2.10 to 192.168.2.200

Headquarters 3:

WAN
LAN - 192.168.3.0/24
DHCP from 192.168.2.10 to 192.168.2.200

Headquarters 4:

WAN
LAN - 192.168.4.0/24
DHCP from 192.168.2.10 to 192.168.2.200

Headquarters 5:

WAN
LAN - 192.168.4.0/24
DHCP from 192.168.2.10 to 192.168.2.200

Headquarters 1 communicates with the various offices, and each individual office communicates with Headquarters 1. Everything works correctly.

Unfortunately the expansion of headquarters 1 I find myself with a problem.
I only have 10 free dhcp addresses, and by the end of the year I need more addresses.
Requests?
1)
Could I change the subnetmask? with a / 23
But if I do that, what settings should I change on the Mikrotik? Only those of the LAN, or even the POOLs? Do I risk having problems in the future?

2)
In addition, all fixed IPs, the Subnet Mask will have to be changed there too?
Will I also have to change it at the various locations that are connected in vpn?

What if i used next poll in dhcp on mikrotik?

Someone shed some light on these doubts of mine, thank you
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11593
Joined: Thu Mar 03, 2016 10:23 pm

Re: Expand Lan Address

Wed Jun 22, 2022 3:40 pm

1)
Could I change the subnet mask? with a / 23
But if I do that, what settings should I change on the Mikrotik? Only those of the LAN, or even the POOLs? Do I risk having problems in the future?
Yes, you can change subnet mask to /23. But to avoid overlap with other headquarters' subnets you should also change network address ... so 192.168.1.0/24 -> 192.168.0.0/23. When enlarging the subnet, you have to change subnet masks on all connected devices - if the new subnet includes the whole old subnet, such as in my example, then IP addresses can remain the same. If devices have IP address set statically, then you have to change subnet mask directly on those devices. If devices receive IP settings from DHCP server, then it's enough to change settings on DHCP server and they will propagate eventually.
If you're extending the subnet, then also IP address of gateway can remain the same which will make transition even smoother. In case of 192.168.0.0/23, gateway can still be at 192.168.1.1, only subnet maks needs to be changed.
If you extend the IP subnet the way I suggested, then address pool for DHCP client will likely be fragmented. You can either create another pool with addresses from the new part of address space and set it as next-pool on your current address pool. Or you can replace currently used address range with the 256 newly acquired addresses (ranges=192.168.0.1-192.168.1.0 is a valid setting) if that is enough. Or you can decide to change IP addresses of all devices to make contigous address space for DHCP pool.
You will also have to change subnet mask in all routes (on other headquarters) to allow other subnets to communicate with whole new headquarter1 subnet.

The other possibility is to add a new subnet (e.g. 192.168.100.0/24) and use both subnets in parallel. This solution has a few drawbacks (e.g. all the traffic between both parts of your LAN will flow over router), but has also a benefit of keeping current subnet intact.

The third possibility is to create a new /23 subnet (e.g. 192.168.128.0/23) and then migrate all devices from 192.168.1.0/24 to the new subnet. This solution will be a bit painful (with disturbance during migration) but having free address space around the new subnet will allow for future expansions (according to the first suggestion you could simply extend it to 192.168.128.0/22 ... or, if you keep all addresses from 192.168.129.255 upwards free, you can even extend it to 192.168.128.0/17) relatively pain-free.
2)
In addition, all fixed IPs, the Subnet Mask will have to be changed there too?
Will I also have to change it at the various locations that are connected in vpn?

What if i used next poll in dhcp on mikrotik?
As I mentioned, all subnet masks need to be changed. Without it there will be possibility to introduce routing triangles (device with /24 will send packets to gateway, gateway will send packets to /23 destination, return packets will go back directly). Things should work, but with needless performance hit on router. Unless there's a firewall rule that will block such traffic (being invalid from connection tracking machinery point of view).

At various locations you would have to change either routes or VPN settings (change subnet mask). Settings on other devices are most probably not necessary.

Using next-pool doesn't make any difference regarding needed changes on other locations. It only affects the way you can start utilizing the expanded address space.

Who is online

Users browsing this forum: No registered users and 98 guests