Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
iconNone

Copyright 2016 by Assured Information Security, Inc. Created by Jean-Edouard Lejosne <lejosnej@ainfosec.com>. This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.

...

Here's how to do it (as root), assuming the user is "openxt" and the name of the container is "openxt-custom" (replace <username> by the username). Also note that <ip_c> is the same value as the variable IP_C defined above, based on the user UID:

  • Edit /etc/libvirt/qemu/networks/openxt.xml and add a line for the new container, like:
    <host mac="00:FF:AA:42:01<ip_c-150>:04" name="openxt-custom" ip="192.168.151<ip_c>.104" />
  • Contigure the container itself:
    cat >> /home/lxc/openxt-custom/config <<EOF
    lxc.network.type = veth
    lxc.network.flags = up
    lxc.network.link = openxtbr0<username>br0
    lxc.network.hwaddr = 00:FF:AA:42:01<ip_c-150>:04
    lxc.network.ipv4 = 0.0.0.0/24
    EOF
  • If the container is Debian Squeeze, you need to fix the network, here how I do it (from inside the container):
    sed -i '/^start)$/a        mkdir -p /dev/shm/network/' /etc/init.d/networking

 

TODO MORE TO COME....