Question How to choose which DHCP to assign IP

beingchris

Junior Member
Sep 6, 2023
5
0
6
Hi,
Our office network have 2 internet Wifi routers attached. Both have their own DHCP servers enabled and both have different IP range (Wifi Router A = 192.168.9.xx & Wifi Router B = 192.168.3.XX)

Sometimes when a laptop connects to Wifi Router A, it gets assign an IP from Wifi Router B. This happens the other way around too.

My issue is that I want to get assigned the IP from Wifi Router A, when I connect to Wifi Router A and not be assigned an IP from the other router.

But how can I make sure that everytime I connect the Wifi to a router, I will get an IP from that same router?
 

mv2devnull

Golden Member
Apr 13, 2010
1,500
145
106
When one sends a broadcast, it goes to all machines in the broadcast domain. Broadcast is "TO=everyone, no IP addresses asked".
That is, when a broadcast enters a switch, it passes the packet out from all other ports.

A "Wifi Router" has DHCP server, wireless AP, and a switch between them. You have connected the switches of two routers with a wire.
Therefore, when a "I need config!" broadcast arrives from one AP, it passes both switches and to both DHCP servers. One of them answers more quickly than the other.

DHCP server config may be able to block clients. For example, that B will never offer config to that laptop, whether it connects to A Wifi or B Wifi -- only DHCP in A can give address to that laptop.


What others have said is to remove (disable) one of the DHCP servers (and corresponding subnet) and have all machines in one subnet. One DHCP server will serve everyone, regardless of connection.

Option B is to not connect the two routers; to have two distinct broadcast domains. Then machines connected to A see only the DHCP in A and machines connected to B see only the DHCP in B.
However, members of subnet A won't see anyone in subnet B and vice versa, unless the routers are set to do port forwarding.
 

beingchris

Junior Member
Sep 6, 2023
5
0
6
As @Tech Junky suggested, also disable DHCP server on 2nd router.
But I still want to preserve the use of the internet connections from both routers (both routers have separate internet subscription accounts, for redundancy support when 1 provider goes down, we can still use the other internet connection)
 

beingchris

Junior Member
Sep 6, 2023
5
0
6
When one sends a broadcast, it goes to all machines in the broadcast domain. Broadcast is "TO=everyone, no IP addresses asked".
That is, when a broadcast enters a switch, it passes the packet out from all other ports.

A "Wifi Router" has DHCP server, wireless AP, and a switch between them. You have connected the switches of two routers with a wire.
Therefore, when a "I need config!" broadcast arrives from one AP, it passes both switches and to both DHCP servers. One of them answers more quickly than the other.

DHCP server config may be able to block clients. For example, that B will never offer config to that laptop, whether it connects to A Wifi or B Wifi -- only DHCP in A can give address to that laptop.


What others have said is to remove (disable) one of the DHCP servers (and corresponding subnet) and have all machines in one subnet. One DHCP server will serve everyone, regardless of connection.

Option B is to not connect the two routers; to have two distinct broadcast domains. Then machines connected to A see only the DHCP in A and machines connected to B see only the DHCP in B.
However, members of subnet A won't see anyone in subnet B and vice versa, unless the routers are set to do port forwarding.
The 2 routers each have separate internet subscription accounts. They are connected physically in our LAN to provide redundancy for when 1 provider goes down, we can still use the other internet connection. The desktops connect to this LAN have static IPs so when 1 provider goes down, I simply change the subnet/gateway IP to working one....its the wifi that I can't control as I still need to switch between internet connections when the need arises...
 

beingchris

Junior Member
Sep 6, 2023
5
0
6
Set different SSID for each router then.

Or buy a dual WAN router and run both wifi routers in AP mode.
yeah the SSID are different...its just that they randomly choose to accept IP given by the other router..
 

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,101
126
yeah the SSID are different...its just that they randomly choose to accept IP given by the other router..
You connected 2 routers together somehow. As @mv2devnull suggested. The DHCP broadcast all over the whole network. The client will always just get IP address randomly from one of the two DHCP. servers.
 

Tech Junky

Diamond Member
Jan 27, 2022
3,430
1,153
106
yeah the SSID are different...its just that they randomly choose to accept IP given by the other router..
Not possible unless you didn't configure them correctly.

This is overly complicated and under configured with dual ISP connections they should be aggregated into a single router. The router then connects to a switch and the to APs.

The initial post sounded more like Daisy chained routers than dual ISP. The two routers physically shouldn't be connected to each other if you have two connections. A<>A router and B<>B router unless you rethink things and do it properly.

The cheapest option would probably be feed both ISP connections into a L3 switch and then connect that to a firewall to secure things and then a switch to feed the APs. DHCP would reside on the firewall and feed the clients the info they need.

The firewall should have routes and possibly vlans per ISP connection depending on how you need traffic to route. Default will send traffic down the fastest path i.e. highest bandwidth.
 

beingchris

Junior Member
Sep 6, 2023
5
0
6
Not possible unless you didn't configure them correctly.

This is overly complicated and under configured with dual ISP connections they should be aggregated into a single router. The router then connects to a switch and the to APs.

The initial post sounded more like Daisy chained routers than dual ISP. The two routers physically shouldn't be connected to each other if you have two connections. A<>A router and B<>B router unless you rethink things and do it properly.

The cheapest option would probably be feed both ISP connections into a L3 switch and then connect that to a firewall to secure things and then a switch to feed the APs. DHCP would reside on the firewall and feed the clients the info they need.

The firewall should have routes and possibly vlans per ISP connection depending on how you need traffic to route. Default will send traffic down the fastest path i.e. highest bandwidth.
Thanks for the info man, yeah I guess another hardware is needed if I want to retain both ISP for redundancy sake. I thought I could get away by just plugging the routers in due to my beginner level knowledge for networking.
 

mv2devnull

Golden Member
Apr 13, 2010
1,500
145
106
You can websearch for "redundant gateway" and find something like: https://en.wikipedia.org/wiki/First-hop_redundancy_protocol
Alas, the "Wifi Routers" are unlikely to support such protocols.

The point in those protocols is that one doesn't have to edit the config every client (wired and laptop) when one uplink dies. For all of them there is only one router.

If you do get a physical router that can handle two WAN connections, then it will hide details of those from the client machines (just like those protocols do).
Obviously one gateway device is "a single point of failure", but as long as the ISP connections are clearly less reliable than the router, that is a lesser risk.
 
  • Like
Reactions: beingchris

JackMDS

Elite Member
Super Moderator
Oct 25, 1999
29,472
387
126
Or you can teach the Users the ""outrages difficult act"" of clicking on the Wireless in the taskBar and choose the Network to connect to.


:cool:
 
Feb 25, 2011
16,800
1,474
126
You can websearch for "redundant gateway" and find something like: https://en.wikipedia.org/wiki/First-hop_redundancy_protocol
Alas, the "Wifi Routers" are unlikely to support such protocols.

The point in those protocols is that one doesn't have to edit the config every client (wired and laptop) when one uplink dies. For all of them there is only one router.

If you do get a physical router that can handle two WAN connections, then it will hide details of those from the client machines (just like those protocols do).
Obviously one gateway device is "a single point of failure", but as long as the ISP connections are clearly less reliable than the router, that is a lesser risk.
Quite a few home-grade "premium" routers (the >$100 ASUS and Netgear models, for sure) do support multiple/failover WAN connections. It's a feature of quite a few of the open source router firmwares, and most newer SoCs have the VLAN-assignable switch ports needed to make it work. (Cheaper routers just don't wire them up that way, or they turn the feature off in order to differentiate their product stack.)

But in all the years I've had broadband, I've had only one ISP outage I noticed, but probably half a dozen bricked routers, so if I were running stuff out of my home where uptime was important, I'd probably settle for one ISP connection and keep a spare router around.

For most people, I think a dead router or cable modem is a pleasant diversion from an evening that would otherwise have involved spending too much time on the internet.
 

Fallen Kell

Diamond Member
Oct 9, 1999
6,041
432
126
But in all the years I've had broadband, I've had only one ISP outage I noticed, but probably half a dozen bricked routers, so if I were running stuff out of my home where uptime was important, I'd probably settle for one ISP connection and keep a spare router around.
Yeah, but on that note, a business that is relying on running something critical in their office that needs a constant connection to the internet should be running through a fully redundant setup in the first place. I.E. there should be two network interfaces/ports on the system/server connected to two different switches with LACP or similar load sharing/redundancy protocol and those two switches/routers should also have redundant connections to each other and each should have connection out to the 2 different ISP's (with you having 2 IP's on each ISP so that both can be connected to via two devices).
 
Last edited: