Via Cà Matta 2 - Peschiera Borromeo (MI)
+39 02 00704272
info@synaptica.info

Manage two gateway in the same network

Manage two gateway in the same network

We have two internet connection, the servers must use by default router A, clients machine use router B. All the computer have to be reachable in the local network.
We cannot modify configuration of router B that expose DHCP.
Our “not so elegant” solution is to map router A in the same network of router B (obviously we have to turn off DHCP of router A) with an ip not in range of the dhcp pool of router B.

The client configuration doesn’t change, clients configured with DHCP still using router B for accessing the net.
The server configuration uses the ip by the dhcp but have to overwrite gateway and dns configuration.
This can be done, according to your OS, in the following way

    Ubuntu

when the machine accepts DHCP configuration old dns is overwritten, to give priority to our dns edit /etc/dhcp3/dhclient.conf and add the following line
prepend domain-name-servers x.x.x.x, y.y.y.y;
where x.x.x.x and y.y.y.y are the IPs of the DNS servers.
then your /etc/network/interfaces must look like this:
auto eth0
iface eth0 inet dhcp
up route del default
up route add default gw z.z.z.z

where z.z.z.z is the ip of the router A.

    Windows

Go in the properties of your lan connection and do the settings like in the following images (according to your network IPs)

Configurations to overwrite gateway and dns in Windows

Una risposta.

  1. Ivan ha detto:

    Impostando la doppia metrica anche su Win si riescono a connettere più gateway… un po come le eth virtuali per linux.

Lascia un commento