XEN // Debian & Ubuntu Network Setup

disable network manager

systemctl list-unit-files | grep -i manager
systemctl stop network-manager
systemctl disable network-manager

make sure Debian network scripts are in place

apt install ifupdown net-tools
systemctl status networking
cp -pi /etc/network/interfaces /etc/network/interfaces.no-bridge
vi /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto xenbr0
iface xenbr0 inet static
    address x.x.x.x/xx
    gateway x.x.x.x
    bridge_ports eth0
    #bridge_fd 0
    #bridge_stp off
    #hwaddress ether xx:xx:xx:xx:xx:xx
    #bridge_maxwait 0

auto dummybr0
iface dummybr0 inet static
    address x.x.x.x/xx
    bridge_ports none

Additional notes

old xend

define a decent bridge name (otherwise it is eth0 by default…)

#mv -i /etc/xen/xend-config.sxp /etc/xen/xend-config.sxp.dist
#sed '/^#/d; /^$/d' /etc/xen/xend-config.sxp.dist > /etc/xen/xend-config.sxp
#vi /etc/xen/xend-config.sxp

#(network-script 'network-bridge netdev=xenbr0')

now deal with the newer XL (also see network)

mv -i /etc/xen/xl.conf /etc/xen/xl.conf.dist
vi /etc/xen/xl.conf

#autoballoon="auto"
vif.default.bridge="xenbr0"
vif.default.script="vif-bridge"

netplan

tested on artful/17.10

cp -pi /etc/netplan/01-netcfg.yaml /etc/netplan/01-netcfg.yaml.dist
vi /etc/netplan/01-netcfg.yaml

network:
  version: 2
  renderer: networkd
  ethernets:
   NIC1:
    dhcp4: no
    dhcp6: no
   NIC2:
    dhcp4: no
    dhcp6: no
  bridges:
   pubbr0:
    interfaces:
     - NIC2
    dhcp4: no
    dhcp6: no
   xenbr0:
    interfaces:
     - NIC1
    dhcp4: no
    dhcp6: no
    addresses:
     - x.x.x.x/xx
    gateway4: x.x.x.x

   # parameters:
   #  stp: no
   #  forward-delay: 0

vi /etc/rc.local

echo -n bringing up the public bridge...
ifconfig pubbr0 up && echo done

dpkg -l | grep ifupdown #should be empty
dpkg -l | grep netscript #should be empty
#systemctl restart systemd-networkd.service
netplan generate
netplan apply
ping -c1 opendns.com

HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | NU | HTML5
Copyright © 2022 Pierre-Philipp Braun