Router – How to get the connected wireless router’s DHCP server not of another router’s in the same network

dhcprouterwifi

I have two internet connections and three separate wireless routers on the same network. The two dlink routers are serving one internet connection and the speedport the other internet connection.

My problem is that when I connect to my first dlink router via wifi, it gets the speedport router's DHCP server. I would expect the connected router's DHCP server to win the DHCP request broadcasting race. Is there anything I could do for this to happen?

Connecting to the second dlink router that is a newer router it gets its DHCP server correctly. Maybe changing the first dlink router to the model of the other dlink could solve the problem, in the firmware update changelog for this model there is nothing related to DHCP…

It is important that there is a local server on the network that has to be accessible no matter to which wifi one is connected – this is why I don't want to give separate subnets for the routers.

Note: I know that this subject in the form of multiple DHCP servers on the same network already exists here, but here I have a specific question to wifi router's DHCP race conditions. If there is an option in router settings that could make the router's DHCP server to win the race for DHCP response or the validation that newer routers handles this as expected.

Best Answer

It seems like you are asking for something completely different from what you really need. What I read from your question is that you have some number of independent routers connected to different ISPs and as long as those are not interconnected with each other, the network works as intended.

Now you want one server to be reachable from each network, so you try to join the LAN side of all your routers in order for this server to be on all of the LANs. That can work if you are very careful with your configuration, but it is overly complicated for what you are trying to accomplish.

Instead don't join the LANs together. Instead connect the server to all of them either by installing enough network interfaces in the server itself, or by installing a VLAN capable switch between this server and the routers.

In order for this to work reliably, the LAN side of each router must use different IP addresses, otherwise the server won't know which LAN each client belongs to. If you are using IPv6 this part is guaranteed to be satisfied by any standards compliant router. If you are using IPv4 you most likely have to manually configure the IP prefix on the LAN side of each router to not be overlapping. If you are using dual stack on all the routers, you can save yourself some trouble by configuring the server with IPv6.

If you for some reason need the server to be on the same IP address seen from all clients, that can be achieved as well. Choose one of the IP addresses assigned to this server to be canonical. On all the other routers configure one entry in the routing table specifying an IP address of the server as gateway to the canonical IP address of the server.

For example if the server is connected to three LANs with IP addresses 172.16.0.7, 172.17.0.7, and 172.18.0.7. You might choose to use 172.16.0.7 as the canonical IP address which clients are supposed to use. The router connected directly to 172.16.0.7 does not need any additional route. But the router connected to 172.17.0.7 would think that 172.16.0.7 is on the WAN. To fix that create a routing table entry indicating that there is a route to 172.16.0.7 using 172.17.0.7 as gateway. On the last router create a route to 172.16.0.7 using 172.18.0.7 as gateway.

Related Topic