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):
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.
How can I configure my DHCP Server so that it works like described in the first image? Thank you in advance for your help!
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.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: