0

I have two independent ISP connections connected to two separate routers. I am just curious what will happen If I connected the two routers to a single switch and then connected a computer to one of the switch's port. Will this setup even work, If so Which connection will my Computer use? Can I build a backup internet system out of this?

(Router : TP-LINK TL-WR840N )

1 Answer 1

1

It'll technically work, but it is not a good idea at all.

  • When you connect two DHCP servers to the same subnet using a switch, a client will get offers from both and will usually choose the first offer that arrives, ignoring the rest. So depending on the routers themselves, either the "faster" router wins most of the time, or it'll be mostly random as to which one wins. There will be no automatic failover – once a client gets an address lease, it'll keep using it.

  • When you connect two IPv6 SLAAC capable routers to the same subnet using a switch, a client will get advertisements from both and will usually accept all of them; it will have multiple IPv6 addresses (belonging to all subnets at once) and multiple default gateways. Current systems will treat all gateways as equivalent, only differing in priority, i.e. they will expect any gateway to handle packets for any prefix. Additionally, they will only fail over if the gateway itself is down, not if its uplink is down.

  • If a router has DHCP and IPv6 SLAAC services disabled, then it's just a passive device and connecting it to a switch has no immediate effect – unless hosts are manually configured to use it, in which case of course there won't be any automatic failover. (Assuming it has an unique IP address of course.)

  • Although... when you connect two routers with the same IP address to the same subnet using a switch, then a client will get ARP responses from both and (again) will usually choose the first one that arrives – AFAIK. However, unlike with DHCP above, it's quite possible that the client's ARP cache will keep switching between the two devices randomly – so if the routers don't provide completely identical uplink, then all connections will keep breaking randomly.

The usual method of implementing automatic failover is to put a single router in front of both connections and let it deal with the switching. (Many router firmwares have a "multi-WAN" or "failover" feature; check if yours does.) This will still cause connections to break during switchover, but at least it'll be predictable.

4
  • 1
    I'm sure this exact answer has already been written multiple times on multiple threads somewhere, but I can't seem to find any straightforward version. Mar 13, 2019 at 7:02
  • What about the data transmission? Which router will handle the data transmission? Is that the router from which the computer got its IP from? Mar 15, 2019 at 16:24
  • @SivaManasan: For outgoing IPv4 traffic: Yes, hosts pick up the address of the "default gateway" from the DHCP lease. So whenever a host accepts a DHCP lease from router A, it'll get the "default gateway = router A" information from the same lease at the same time. Mar 15, 2019 at 16:28
  • @SivaManasan: For outgoing IPv6 traffic: Hosts will usually get independent addresses from both routers and (with current operating systems) will accept both routers as equally-capable "default gateways". If one router sets a higher 'priority' value in its ICMPv6 Router Advertisements, then hosts will use that router; if they're both equal-priority, then it's probably random choice. (Ideally operating systems would map each gateway to the address it advertises, but that is unfortunately very rare. Technically possible on Linux though.) Mar 15, 2019 at 16:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .