LXC and Networking in Debian Jessie

  1. Follow https://wiki.debian.org/LXC
  2. and https://wiki.debian.org/LXC/LibVirtDefaultNetwork as libvirt is so easy
  3. Use a config file like this for the lxc:
    1. # Template used to create this container: /usr/share/lxc/templates/lxc-debian
      # Parameters passed to the template: -r jessie
      # For additional config options, please look at lxc.container.conf(5)
      lxc.network.type = empty
      lxc.rootfs = /home/mike/tmp/lxc/crashplan/rootfs

      # Common configuration
      lxc.include = /usr/share/lxc/config/debian.common.conf

      # Container specific configuration
      lxc.mount = /home/mike/tmp/lxc/crashplan/fstab
      lxc.utsname = crashplan
      lxc.arch = amd64
      lxc.autodev = 1
      lxc.kmsg = 0
      lxc.network.type = veth
      lxc.network.flags = up
      lxc.network.link = virbr0
      lxc.network.hwaddr = 00:FF:AA:00:00:01
      lxc.network.ipv4 = 0.0.0.0/24
      lxc.start.auto = 1
      lxc.network.script.up = /home/mike/tmp/lxc/crashplan/ifup.sh
      lxc.network.script.down = /home/mike/tmp/lxc/crashplan/ifdown.sh

  4. Use the attached networking scripts to appropriately setup the nat forwarding.
  5. config ifdown.sh ifup.sh