Unverified Commit 8300ee13 authored by devrandom's avatar devrandom Committed by boklm
Browse files

Use lxcbr0 as bridge

parent e1675e2e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -209,10 +209,10 @@ Recent distributions allow lxc-execute / lxc-start to be run by non-priviledged

If you have a runaway `lxc-start` command, just use `kill -9` on it.

The machine configuration requires access to br0 and assumes that the host address is `10.0.2.2`:
The machine configuration requires access to lxcbr0 and assumes that the host address is 10.0.3.1 .  If lxc does not configure lxcbr0 on boot, you can do so manually:

    sudo brctl addbr br0
    sudo ifconfig br0 10.0.2.2/24 up
    sudo brctl addbr lxcbr0
    sudo ifconfig lxcbr0 10.0.3.1/24 up

## Tests

+0 −6
Original line number Diff line number Diff line
@@ -19,12 +19,6 @@ usage() {
  --arch A    build architecture A (e.g. i386) instead of amd64
  --lxc       use lxc instead of kvm
  --vbox      use VirtualBox instead of kvm

  The MIRROR_HOST environment variable can be used to change the
  apt-cacher host.  It should be something that both the host and the
  target VM can reach.  It may be set to 127.0.0.1, in which case it will be
  changed to 10.0.2.2 on the guest (or GITIAN_HOST_IP if it is defined)
  10.0.2.2 is the host IP as visible from the guest under qemu networking.
EOF
}

+4 −3
Original line number Diff line number Diff line
@@ -23,9 +23,10 @@ lxc.cgroup.devices.allow = c 254:0 rwm
lxc.mount.entry=proc ROOTFS/proc proc nodev,noexec,nosuid 0 0
lxc.mount.entry=sysfs ROOTFS/sys sysfs defaults  0 0

# Container with network virtualized using a pre-configured bridge named br0 and
# veth pair virtual network devices
# On the host, run: ifconfig br0 up 10.0.2.2
# Container with network virtualized using a pre-configured bridge named lxcbr0
# and veth pair virtual network devices.
# On the host, run (lxc might already have done this):
#     ifconfig lxcbr0 up 10.0.3.1
# Alternatively, you can use another IP range for the bridge interface, in this case set
# the environment variables GITIAN_HOST_IP and LXC_GUEST_IP appropriately.
lxc.network.type = veth
+10 −1
Original line number Diff line number Diff line
#!/bin/bash

set -e

wd=`pwd`

if [ -z "$LXC_GUEST_IP" ]; then
    LXC_GUEST_IP=10.0.2.5
    LXC_GUEST_IP=10.0.3.5
fi

if [ -z "$LXC_BRIDGE" ]; then
    LXC_BRIDGE=lxcbr0
fi

if ifconfig $LXC_BRIDGE > /dev/null 2>&1; then
    true
else
    echo "Must configure $LXC_BRIDGE - check the README"
    exit 1
fi

sed "s;ROOTFS;$wd/target-$LXC_SUITE-$LXC_ARCH;;s;ARCH;$LXC_ARCH;g;;s;GUESTIP;$LXC_GUEST_IP;g;s;GUESTLINK;$LXC_BRIDGE;g" < etc/lxc.config.in > var/lxc.config
+2 −0
Original line number Diff line number Diff line
#!/bin/sh

set -e

. gconfig

TUSER=${DISTRO:-ubuntu}