I would like to configure my DHCP Server (Windows Server 2008 R2) so that it assigns to each host two gateways. The client should use the gateway which is closer (less number of hops). I can do this manually on the client itself by setting the 'automatic metric' (see print-screen):

Advance IP Settings

But on the DHCP server if I define the router in the Scope-Settings it will use Gateway depending on the priority which is given by the position in the settings.

DHCP Settings - Router

How can I configure my DHCP Server so that it works like described in the first image? Network Thank you in advance for your help!

  • 3
    What do you mean by "less number of hops"? Gateway is always located in the same subnet as the host. – Somescout Nov 6 '14 at 14:42
  • 6
    Switches don't decrement the TTL as they aren't routing the traffic, they're switching the traffic. The network hosts don't even know that the switches exist, so no "hops" are involved. – joeqwerty Nov 6 '14 at 14:48
  • 2
    1. Each set of hosts on each side would still only have one default gateway. 2. If the provider is connecting the two locations at layer 2 then again, no "hops" are involved. – joeqwerty Nov 6 '14 at 14:52
  • 3
    As @joeqwerty mentioned, it is important to note that switches have nothing to do with the routing. If you are just looking into the most efficient path at the switching level, look into implementing STP;; but be clear that it will work independently of any routing functions. – Get-HomeByFiveOClock Nov 6 '14 at 14:53
  • 1
    If hosts located at considerable distance it may be a good idea to separate them to different subnets. Still, if you really want it, you can try using DHCP Option 82 (dhcp relay option). – Somescout Nov 6 '14 at 15:01

OK. So you want all of the traffic to go out the closest gateway, but you can't get there from here. It's all the same layer 2/3 network so there's no way to prioritize the gateways so that clients use the closest one. If you use different subnets on each side then that presents the wrinkle of having to route traffic between the two subnets so you'd then need to throw a router in the mix, which would necessitate the need to turn the layer 2 connection into a layer 3 connection. IMO, leave it as it is. Define both gateways in DHCP using the DG that you prefer for the traffic to go through at the top of the list, knowing that clients on the other side have a longer trip.

  • Correct me if I'm wrong, but done this way all hosts would access the Internet through only one of the gateways until that gateway failed. Wouldn't that leave one of the Internet connections quiet, wasting its available bandwidth? – I say Reinstate Monica Nov 7 '14 at 2:16
  • Yes. That's basically what I said in my answer. – joeqwerty Nov 7 '14 at 5:10
  • If you want to load balance your internet on 2 WAN connections then you should do this on your gateway rather than on the stations themselves. – JustAGuy Oct 12 '15 at 11:37

The real question is how do I provide two routes to the Internet and ensure my hosts always use the fastest path to get there?

The case for routing. You have two locations, each with its own Internet connection. Hosts at each location are best served by using their site's route to the Internet. The two locations are also connected by a single link. This path allows hosts in site A talk to hosts in site B and vice-versa. It can also be leveraged to provide each site with an alternate route to the Internet (lucky you).

The proper way to configure this network is to put a router at each site, connect each site's Internet connection to its respective router, and then connect the two routers via the existing site-to-site link.

How it works. Each site needs its own subnetwork address, but each site's hosts will always use their location's route to the Internet, and when a site's Internet connection fails, the routers do their job and begin routing traffic to the other site's router which in turn forwards it to the Internet.

Is this worth all the trouble? Yes, for several reasons:

  1. Faster Internet. You'll take advantage of the aggregate bandwidth of both of your Internet connections, not just one.
  2. Faster site-to-site link. Your location-to-location link won't be used by one site's hosts for Internet traffic, freeing up the bandwidth for other uses.
  3. Less failover delay. If a host is configured with two gateways and the one in use goes down, the client will experience a delay before trying the other gateway. The potential for this to continue exists as long as the gateway is down. Moving the failover responsibility to the router consolidates this delay into a single point in time, and once it's done, it's done.
  4. Host compatibility. Some hosts won't let you configure multiple gateways. If the one they're using fails, that host can't access the Internet until the gateway comes back up or you re-configure the host.
  5. No double work. You'll end up using routers anyway if you have problems assigning hosts two gateways.

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.