I am trying to configure a private network for use with my Xen VMs, in addition to the public network in use by another of the VMs (VM1, which has its own public IP).

So far, I have the public side working perfectly with a bridged network...

On the host machine:

eth0: 91.x.x.1, gateway: 91.x.x.254
xenbr0: bridged with eth0
VM1 connected to xenbr0, with a new IP address, 91.x.x.2, and gateway 91.x.x.254

On the host machine, I've also created a private dummy ethernet port:


and a bridge via XenServer, pdummy0 (using these instructions http://tipstricks.itmatrix.eu/?p=681)

Everything's working there, as well - the two VMs connected to the bridge can ping each other, as well as the host machine via the private IP.


The last step here, is to have each of those VMs (VM2 & VM3) to be able to see the internet... What routes / IP forwarding do I need to set up to make that happen?

Sample route from VM2, /sbin/route:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   *        U     0      0        0 eth0

enable packet forwarding on your host.

# /sbin/sysctl -w net.ipv4.ip_forward=1

then add forwarding rules on your host iptables rules

# iptables -A FORWARD -s -d 91.x.x.1/24 -j ACCEPT
# iptables -A FORWARD -s 91.x.x.1/24 -d -j ACCEPT

add static routes in your router via console or webui.

#ip route add via 91.x.x.1 
| improve this answer | |

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.