We have a LAN with 20 machines on it. They are connected to a switch which also connects to our primary Westell DSL modem for internet access.

The modem does the NATing and is the DHCP server, (so that our internal addresses are 192.168.1.*). We have a backup modem and phone line which is just like the primary except, of course, its IP address to the outside world is different.

The plan is that if the primary line fails, we just move the cable that connects the modem and switch from the primary to the backup modem. It's crude and not exactly real-time but sufficient for our needs.

The question is, when the switch-over is made, what happens to the DHCP assigned addresses? The machines already have addresses, but the backup modem doesn't know about them. So what happens? Will confusion reign on the LAN?

  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 9 '17 at 16:36
up vote 7 down vote accepted

Will confusion reign on the LAN?

Generally, no. The machines that have addresses will still have them, until their lease expires. I'm not sure how smart the Westel DHCPd is, but most will verify an address is not in use before assigning it. You can avoid any possible collisions by setting each router to use a different range of addresses: router 1 -- 192.168.1.100-149, router 2 -- 192.168.1.150-199. When new machines come online or old leases expire, they'll get an address from the currently active router.

(Just remember to not set any host to 100-199.)

  • Be careful of the "verify an address is not in use" model as this is check is typically done by pinging the IP before assigning it out. Many firewalls will block ICMP pings by default and as a result the DHCP server will hand out addresses. – YLearn Jun 12 '13 at 22:54
  • Host-based firewalls rarely block the local subnet. What will create a mess is the dhcp server not doing it at all. – Ricky Beam Jun 13 '13 at 1:02
  • Really depends on the firewall and the actual environment. As for the check, I agree that it is generally a better approach than none at all, but I always try to provide the caveat so people understand this limitation. I always thought an ARP for local subnet addresses would be a better check (but understand a bit more involved to code - two different checks depending on if local or not). – YLearn Jun 13 '13 at 1:09

Assuming the replacement router uses the same internal IP and assigns from the same IP range, this won't be much of a problem. Clients will keep the IP assigned via DHCP and will request a renewal of the DHCP lease after some time. The new router will either honor the renewal or if the IP is assigned to another device refuse it, after which the client will do a discover for a new address.

  • 3
    I would also suggest a short(er) lease time (an hour or less) if the DHCP server allows you to change this and can handle it. This way, the DHCP server on the backup router will learn the leases faster (to avoid IP conflicts) and will resolve any IP conflicts that do occur more quickly. – YLearn Jun 12 '13 at 22:57

Your setup would benefit greatly from a dual-wan router. I would recommend a Cisco RV042. The router acts as the DHCP server for the LAN, and will automatically failover between the two DSL connections.

The DSL modems will need to either be placed into bridged mode, or they will need to provide a different subnet IP than the default. For example, you could program one modem to use 10.10.10.x and the other 10.10.20.x on their LAN ports.

There is no requirement that you place your dhcp server on the nat device, and in your case having it not on the nat device allows you to preserve state across nat device swaps.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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