0

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

I would like to set up:

  • vm1 (IP 10.1.1.2/24) <--> xenbr1 (IP 10.1.1.1/24) <--> eth1
  • vm2 (IP 10.1.2.2/24) <--> xenbr2 (IP 10.1.2.1/24) <--> eth2
  • eth1 <--> cable <--> eth2

From inside vm1 (10.1.1.2), I want to be able to ping 10.1.2.2 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, 10.1.1.2) route add -net 10.1.2.0 netmask 255.255.255.0 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 10.1.2.0 netmask 255.255.255.0 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
0

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.