Open the file /etc/xen/xend-config.sxp
and make sure that the parameter
network-script
correspont to:
(network-script
'network-bridge-xhn0')
Add at the end of /etc/network/interfaces
the following lines:
auto xenbr0
iface xenbr0 inet manual
then remove all the lines refering to
xhn0
and add:
auto xhn0
iface xhn0 inet manual
Create the file
/etc/xen/scripts/network-bridge-xhn0
and write
the following lines into it:
#!/bin/bash /etc/xen/scripts/network-bridge "$@" netdev=eth0 bridge=xenbr0 /sbin/ifconfig xhn0 up /usr/sbin/brctl addif xenbr0 xhn0
and make it executable using the command chmod +x /etc/xen/scripts/network-bridge-xhn0
Reboot the machine. At the next startup
eth0
and
xhn0 will be linked together
Configure the domU associating a vif
interface to the bridge xenbr0, by adding
bridge=xenbr0
to the vif options.
Example:
vif = [ 'bridge=xenbr0,mac=00:06:3E:1A:93:C3'
]
Start the virtual machine:
xm create <virtual_machine_name>
You can see the interfaces that are linked by the bridge executing the command brctl show
To connect the machines with the physical network you need to assign IP addresses that are in the same network class