this is obsolete doc -- see http://doc.nethence.com/ instead

XEN - Route network configuration 

 

 

Dom0 

Stop xend, 

service xendomains stop
service xend stop

 

Switch to the route scripts, 

cd /etc/xen/
vi xend-config.sxp

change, 

(network-script network-route)
(vif-script vif-route)

 

Enable forwarding and apply, 

cd /etc/
mv sysctl.conf sysctl.conf.dist
sed '/^$/d; /^#/d' sysctl.conf.dist > sysctl.conf
cat >> sysctl.conf <<EOF9
net.ipv4.ip_forward=1
net.ipv4.conf.all.proxy_arp=1
net.ipv4.conf.default.proxy_arp=1
EOF9
sysctl -p

 

Start xend, 

service xend start
service xendomains start

or simply restart the machine (to get rid of peth0 if you've been using bridge before), 

shutdown -r now

 

 

domU 

You have to force the ip within guests' configuration, 

vif = [ 'vifname=vifname,ip=XX.XX.XX.XX' ]

 

Once the guest is up and running, use dom0's ip associated with the physical NIC (or bridge, in case of an hybrid network configuration). On a Linux guest, 

ifconfig eth0 GUEST_IP netmask 255.255.255.0 up
route add default gw DOM0_IP

note. if dom0's ip is on another subnet, 

ifconfig eth0 GUEST_IP netmask 255.255.255.255 up
route add -net DOM0_IP netmask 255.255.255.255 dev eth0
route add default gw DOM0_IP

or on a netbsd guest, 

ifconfig eth0 GUEST_IP netmask 255.255.255.0 up
route add default DOM0_IP

note. if dom0's ip is on another subnet (I'm currently troubleshooting this! It doesn't work!), 

ifconfig xennet0 GUEST_IP netmask 255.255.255.255 up
#route add -host DOM0_IP -link xennet0 -iface
route add -host DOM0_IP -link xennet0:DOM0_MAC_ADDRESS -iface
route add default -ifa GUEST_IP DOM0_IP