I have a Debian server running Xen 4.4. The server has multiple ethernet interfaces.

I would like to set up:

  • vm1 (IP <--> xenbr1 (IP <--> eth1
  • vm2 (IP <--> xenbr2 (IP <--> eth2
  • eth1 <--> cable <--> eth2

From inside vm1 (, I want to be able to ping and have the traffic go through the cable. The cable will later be replaced with network equipment under test. I do have the above all set up and working, except that from inside a VM there is no route to the other subnet. (Network is unreachable.)

I tried adding a route to one of the VMs, but no luck:

  • (from vm1, route add -net netmask dev eth0

Now ping returns "Destination Host Unreachable." My current thought is to somehow force the routing in Domain0, but it seems like the following would be disastrous:

  • (from Domain0) route add -net netmask dev xenbr1

Is what I am trying to do possible using a single server and hypervisor? Or should I change course and use two physical servers?

  • It's probably possible, but you'll have to deal with some fairly arcane parts of Linux's routing configuration system (tables, etc) in order to override the default routing behaviour of "get it to its destination as quickly as possible".
    – womble
    Sep 14 '15 at 20:54

IP routing means connecting separate IP networks with separate address ranges. This requires a router, ie. an instance that has an interface in each of these networks and forwards packets between them. A simple cable cannot do that. Specifically, the two ends of the cable cannot belong to different IP address ranges.

If you don't actually need your traffic to physically go through the cable you may achieve what you want by creating a third VM on your server that acts as a router and has interfaces in both xenbr1 and xenbr2.

Otherwise you'll have to set up a separate device with two Ethernet interfaces that will act as a router.

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.