From 04fe4e50692586fee13b487b02fef4831757f77d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zolt=C3=A1n=20Felleg?= Date: Fri, 8 Nov 2019 15:33:42 +0100 Subject: [PATCH] Updated efg.pm (networking fixes), added rebootall.sh script. --- scripts/rebootall.sh | 8 ++++++++ sources/efg.pm/config | 7 +++++-- sources/efg.pm/firstboot/01_setupnetworking.sh | 8 ++++---- sources/vhost1.usr/etc/{ => lxc}/lxc.conf | 0 sources/vhost2.usr/etc/{ => lxc}/lxc.conf | 0 5 files changed, 17 insertions(+), 6 deletions(-) create mode 100755 scripts/rebootall.sh rename sources/vhost1.usr/etc/{ => lxc}/lxc.conf (100%) rename sources/vhost2.usr/etc/{ => lxc}/lxc.conf (100%) diff --git a/scripts/rebootall.sh b/scripts/rebootall.sh new file mode 100755 index 0000000..3284811 --- /dev/null +++ b/scripts/rebootall.sh @@ -0,0 +1,8 @@ +#!/bin/sh + + +lxc-ls -1 --running | while read CONTAINER +do + echo "Rebooting $CONTAINER" + lxc-attach --name $CONTAINER -- reboot +done diff --git a/sources/efg.pm/config b/sources/efg.pm/config index 45d40e5..f953548 100644 --- a/sources/efg.pm/config +++ b/sources/efg.pm/config @@ -8,11 +8,14 @@ lxc.mount.auto = proc:rw sys:ro lxc.net.0.type = veth lxc.net.0.flags = up lxc.net.0.link = brh-dev +lxc.net.0.name = eth0 lxc.net.0.hwaddr = 02:0c:18:03:ad:fe -lxc.net.1.type = phys +lxc.net.1.type = veth lxc.net.1.flags = up -lxc.net.1.link = bonde-dev +lxc.net.1.link = bre-dev +lxc.net.1.name = eth1 +lxc.net.0.hwaddr = 02:0c:18:03:28:92 lxc.cgroup.devices.allow = lxc.cgroup.devices.deny = diff --git a/sources/efg.pm/firstboot/01_setupnetworking.sh b/sources/efg.pm/firstboot/01_setupnetworking.sh index 2c140ad..8802b65 100755 --- a/sources/efg.pm/firstboot/01_setupnetworking.sh +++ b/sources/efg.pm/firstboot/01_setupnetworking.sh @@ -17,15 +17,15 @@ done [ $WAITED -eq 1 ] && echo CONNECTION_DEVICES_UP=$(nmcli --terse connection show | grep -v ':$' | wc -l) -#while [ $CONNECTION_DEVICES_UP -lt 2 ] -while [ $CONNECTION_DEVICES_UP -lt 1 ] +#while [ $CONNECTION_DEVICES_UP -lt 1 ] +while [ $CONNECTION_DEVICES_UP -lt 2 ] do sleep 1 nmcli --terse connection show CONNECTION_DEVICES_UP=$(nmcli --terse connection show | grep -v ':$' | wc -l) done -EXTERNAL_DEVICE=efg +EXTERNAL_DEVICE=eth1 PERIMETER_DEVICE=eth0 CONNECTIONS=$(nmcli --terse connection show | wc -l) @@ -55,7 +55,7 @@ nmcli connection show nmcli connection add \ connection.autoconnect yes \ - connection.id dynamic \ + connection.id external \ connection.interface-name $EXTERNAL_DEVICE \ connection.type 802-3-ethernet \ ipv4.addresses "192.168.65.1/24, 194.149.40.146/28, 194.149.40.147/28, 194.149.40.148/28, 194.149.40.149/28, 194.149.40.150/28" \ diff --git a/sources/vhost1.usr/etc/lxc.conf b/sources/vhost1.usr/etc/lxc/lxc.conf similarity index 100% rename from sources/vhost1.usr/etc/lxc.conf rename to sources/vhost1.usr/etc/lxc/lxc.conf diff --git a/sources/vhost2.usr/etc/lxc.conf b/sources/vhost2.usr/etc/lxc/lxc.conf similarity index 100% rename from sources/vhost2.usr/etc/lxc.conf rename to sources/vhost2.usr/etc/lxc/lxc.conf -- 2.54.0