summaryrefslogtreecommitdiffstats
path: root/ci/odl/cloud-sh-odl/lxc-network.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/odl/cloud-sh-odl/lxc-network.sh')
-rwxr-xr-xci/odl/cloud-sh-odl/lxc-network.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/ci/odl/cloud-sh-odl/lxc-network.sh b/ci/odl/cloud-sh-odl/lxc-network.sh
new file mode 100755
index 00000000..5a65fa18
--- /dev/null
+++ b/ci/odl/cloud-sh-odl/lxc-network.sh
@@ -0,0 +1,18 @@
+#!/bin/sh -e
+
+DEBIAN_FRONTEND=noninteractive apt-get -qy -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold install lxc < /dev/null
+
+sed -e 's/^USE_LXC_BRIDGE="true"/USE_LXC_BRIDGE="false"/' -i /etc/default/lxc
+service lxc-net restart
+
+ifdown eth0
+mv /etc/network/interfaces.d/eth0.cfg /etc/network/interfaces.d/eth0.cfg.bak
+cat <<-"EOF" > /etc/network/interfaces.d/bridge.cfg
+ auto eth0
+ iface eth0 inet manual
+
+ auto lxcbr0
+ iface lxcbr0 inet dhcp
+ bridge_ports eth0
+ EOF
+ifup eth0 lxcbr0