My computer is running Ubuntu Server 14.04, and is connected to two networks at the same time (i.e., local network A with IP 192.168.1.30, which has access to Internet; and another local network B with IP 10.73.9.30, which does not have an Internet access). Most traffic should go through network A, however, I also need my computer to communicate with other computers in the network B (e.g., 10.84.1.8 -- yes, actually not in the same subnet of network B). I have set
metric in the
/etc/network/interfaces file so that I can set two gateways, but it seems that only the first gateway works, and computers in other subnet of network B (i.e., 10.84.1.8) cannot access my computer (10.73.9.30) at all.
Interestingly, computers in the same subnet of network B (e.g., 10.73.9.3) can access my computer without any problem, and 10.84.1.8 can also access 10.73.9.3 (which is only connected to network B). Therefore, I think the cause of the network issues on my computer is that it is connected to two networks. Here is my
auto lo iface lo inet loopback auto em1 iface em1 inet static metric 0 address 192.168.1.30 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 192.168.1.1 auto em2 iface em2 inet static metric 1 address 10.73.9.30 netmask 255.255.255.0 gateway 10.73.9.1
How can I make the computer use 10.73.9.1 as the default gateway for
10\.*\.*\.* IP addresses?