Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Debian wheezy networking bridge, xen

Configuring external (and internal) networking, Debian Wheezy and Xen

External network

Dom0

auto eth0
iface eth0 inet static
  bridge_ports peth0
  address XXX.XXX.XXX.XXX
  netmask 255.255.255.0
  gateway XXX.XXX.XXX.XXX
  • Use the following when configuring your DomU's /etc/xen/domain.cfg. Note: Vif MAC address must start with 00:16:3e
vif = [ 'bridge=eth0,mac=00:16:3e:xx:xx:xx' ]  # (vif mac setup works only with the beginning of 00:16:3e!, change xx:xx:xx to valid mac-address characters, 0-9 and a-f)

DomU

  • Edit /etc/network/interfaces
auto eth0
iface eth0 inet static
 address XXX.XXX.XXX.XXX
 gateway XXX.XXX.XXX.XXX
 netmask 255.255.255.0

Interal network (DomU <-> DomU, no external connectivity)

Dom0

  • Edit /etc/network/interfaces
auto xenbr1
iface xenbr1 inet static
  address 10.0.0.1
	netmask 255.255.255.0
	bridge_stp off
	bridge_waitport 0
	bridge_fd 0
  • Use the following when configuring your DomU's /etc/xen/domain.cfg. Note: Vif MAC address must start with 00:16:3e
vif = [ 'bridge=xenbr1,mac=00:16:3e:xx:xx:xx' ]  # (vif mac setup works only with the beginning of 00:16:3e!)

DomU

  • Edit /etc/network/interfaces
auto eth0
iface eth0 inet static
 address 10.0.0.2
 netmask 255.255.255.0

Using external and internal networking

Dom0

When you have your eth0 and xenbr1, configure your DomUs /etc/xen/domain.cfg to handle both:

vif         = [ 'mac=00:16:3e:xx:xx:xx,bridge=xenbr1', 'mac=00:16:3e:xx:xx:xx,bridge=eth0']

DomU

Now your internal network for DomU will be eth0 and the external eth1, edit /etc/network/interfaces:

auto eth0
iface eth0 inet static
 address 10.0.0.X
 netmask 255.255.255.0

auto eth1
iface eth1 inet static
 address XXX.XXX.XXX.XXX
 gateway XXX.XXX.XXX.XXX
 netmask 255.255.255.0
Owner

bivald commented Jun 1, 2013

Also, comment out any networking-script in your xend config. Wheezy don't need them and they will be removed soon (buggy)

Owner

bivald commented Jun 1, 2013

You can also try to add it via script instead, this actually works better for me:

brctl addbr xenbr1
brctl stp xenbr1 off
brctl setfd xenbr1 0
ip link set xenbr1 up
ifconfig xenbr1 up 10.0.0.1 netmask 255.255.255.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment