-1

Before starting, I would like to mention that my knowledge on networking is very basic. Feel free to suggest improvements for my network setup in any part of my question.

I have searched the site for similar questions and I actually found many, but none of them answered my question.

My setup is very similar to this question. We have two separate floors that each one has its own internet connection and modem-router with WiFi.

Note that both moder-routers are provided by the ISP, thus they do not offer many customization options.

Network details for each floor:

Floor 1:

  • Gateway 192.168.1.1 (modem-router 's ip)
  • DHCP(IPV4 + IPV6) runs on modem-router assigns IPV4 ips in form of 192.168.1.xxx
  • NetMask 255.255.252.0

Floor 2:

  • Gateway 192.168.2.1 (modem-router 's ip)
  • DHCP(IPV4 + IPV6) runs on modem-router assigns IPV4 ips in form of 192.168.2.xxx
  • NetMask 255.255.252.0

NetMask may be wrong - Need consultation

Two networks are connected via a 10/100/1000 switch. The tasks that are performed in the unified network are very simple(file sharing, serving files via DLNA in clients).

For all wired devices I have set up static IPV4 ips and everything works as intented.

The part that I need help is with the wireless clients. I cannot control which gateway will a wireless device use to access the internet.

Explaining this, a device connected to the WiFi modem-router of Floor 1 may get ip from the DHCP of modem-router in Floor 2 and backwards. I am pretty sure that this is caused by the nature of the DHCP which claims that the quicker wins.

I know a solution would be to disable the DHCP in one of the floors, but I assume this will result all devices(with auto DHCP settings) connected to the network to use the internet bandwidth from the floor where the DHCP runs.

Question: So my question is how can I force wireless clients to get ip from the DHCP of the modem-router they are connected?

Edit: Is it doable with the existing hardware?

  • Turn on bridge mode on the second router. – Ipor Sircer Oct 12 '18 at 11:40
  • 1
    Ugh... the better solution would be to get a business-grade multi-wan router that could allow you to implement VLANs and then you could manage your traffic and have the likes of multiple DHCP and routes between the VLANs or a single DHCP with the aid of a DHCP helper... – Kinnectus Oct 12 '18 at 11:51
  • I am not aware what bridge mode is but I am searching right know. @Kinnectus My initial goal is to solve my issue without spending extra money as it's a home network without high expectations. Thanks for your comment though, I will keep it in mind! – leopal Oct 12 '18 at 12:08
  • 1
    Possible duplicate of How to bond two different internet connections – Tim_Stewart Oct 12 '18 at 12:37
  • 1
    So the part that's missing from the question is whether this unpredictable gateway assignment actually causes problems. If both gateways offer identical Internet access, and the same person is responsible for both, it's arguably a mostly valid setup. – grawity Oct 12 '18 at 12:37
0

You're quite right - DHCP typically works on a "fastest wins" basis... it's also usually a bad idea to run multiple DHCP servers on the same network...

Using a netmask of 255.255.252.0 is a bit of a "hack" to let clients communicate with each other, regardless of which pool they are assigned an address from... it's not a great way of dealing with this.


Is it doable with the existing hardware?

No.

So my question is how can I force wireless clients to get ip from the DHCP of the modem-router they are connected?

In the current setup, you can't... does it really matter which internet connection is used?

Either:

  1. The device communicates via WiFi to Router 1, the traffic then goes to the internet
  2. The device communicates via WiFi to Router 1, the traffic goes via Ethernet to Router 2, and off to the internet.

At least you're not going to have WiFi contention issues with this setup.


legend

current route

As drawn above, the WiFi Device is accessing the internet via Router 2, as per your description (Router 2's DHCP response won).

PC 1 can access PC 2 (and vise versa), the Device can access both PCs, and all can access the internet.

You may find that the device's route changes when the DHCP lease renews, and this may cause issues for ongoing connections / sessions...

It's also totally feasible for PC 1 to be routed to the internet via Router 2. In a race like this, the router who is busy may well loose.


Ideally you would at least put a router between the networks allowing them to stand alone with their own broadcast domain (and thus DHCP will be correctly isolated). The new router would facilitate access from one network to another.

In this basic setup, and you will need to be able to configure "static routes" either at every device, or at Router 1 / Router 2.

extra router

For example, we put Router 3's interfaces at addresses 192.168.1.254 and 192.168.2.254 respectively.

If it's possible to provide static routes on Router 1 and Router 2, then they'll look something like this:

  • Router 1: 192.168.2.0/24 access via 192.168.1.254
  • Router 2: 192.168.1.0/24 access via 192.168.2.254

You've indicated that you don't want to purchase anything... Router 3 could be many things from an old PC to a Raspberry Pi.


A more ideal solution is to use a "proper" router that is able to handle multiple WAN interfaces.

This will likely incur quite a bit of additional cost though... so if the previous option is viable (it realistically depends on static routes being configured in at routers), then that may be preferable for you.

Router 1 and Router 2 are put into "bridge mode" - i.e: they are acting purely as a media converter from Ethernet to whatever your ISP provides, and dealing with authentication, etc...

Along with a third Router, you'll need to purchase and WiFi Access Points to maintain the WiFi service, and you'll also need a second cable run between the floors (presuming the ISP feed is fixed, and unless you use VLANs).

extra router with bridge mode

With this topology you get everything you want, with the most optimal implementation. Each floor has separate broadcast domains, Router 3 can likely manage the DHCP pools for each, and you can still access PCs across floors.

As an extra bonus, you can also now chose to share the internet connections between floors for "load balancing" and "failover"... or if you really want you can stick with Floor 1 using Router 1's connection, and Floor 2 using Router 2's connection.

  • I am currently examining the second option(use an old pc or a Pi as router 3). What software should this machine run? Can you please provide any tutorial link on this? – leopal Dec 3 '18 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.