I have a virtual environment with 3 virtual machines on one host. One of my virtual machines has 2 network interface.

I need the virtual machine with two interfaces to connect to two different networks.

HERE is the topology enter image description here

My host host has an

ip netmask gateway

The 3 virtual machines have the ip addresses

ip netmask gateway

ip netmask gateway

ip netmask gateway

now i added the following setup to the virtual machine to allow it to communicate to another network. address netmask

I added the line below to the file /etc/iproute2/rt_tables

1 rt2

I then run the following commands.

 ip route add dev eth1 src table rt2

 ip route add default via dev eth1 table rt2

 ip rule add from table rt2

 ip rule add to table rt2

The ip I am trying to reach is and I want only that one ip to be accessed via this route.

For some reason when i try ping the ip after the above configuration i get destination unreachable.

I can reach the server without the above configuration going through the gateway however there is an unnecessary number of nodes between my node and the other node which sometimes causes trouble.

Is there something wrong with my steps?

I followed the steps here

I found another similar question here

Which seems to suggest i am heading in the correct direction.

  • 1
    If you reword your question so as to not require extraordinary mental effort to parse, that would probably help. – MikeyB Apr 14 '14 at 6:37
  • I have added an image to assist – sqwale Apr 14 '14 at 10:24

If your VM 1 has an IP in the network then there's no need for any route to communicate with, since both hosts are in the same network.

You must ensure that the host with IP is in the same switching domain and has a 24 bit subnet mask, i.e.

If it's not the case please provide more info about the switching config and the IP configuration of host

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.