From ad3acd5ebe9ca0baafca50310a8f6ad6133f33c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Sun, 11 Oct 2020 14:47:32 +0200 Subject: [PATCH] Add ONE VM networking to netboot image --- debian-build-netboot.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/debian-build-netboot.sh b/debian-build-netboot.sh index e64f1fb..43b0cc9 100755 --- a/debian-build-netboot.sh +++ b/debian-build-netboot.sh @@ -30,14 +30,17 @@ chroot "$chroot_dir" apt-get install -y firmware-bnx2 # SSH server, DNS updates from RAs, LVM2. chroot "$chroot_dir" apt-get install -y openssh-server rdnssd lvm2 +# Network tools. +chroot "$chroot_dir" apt-get install -y vlan bridge-utils + # Useful things for cdist manifests to run properly and humans to be happy. -chroot "$chroot_dir" apt-get install -y lsb-release ca-certificates vim locales bridge-utils +chroot "$chroot_dir" apt-get install -y lsb-release ca-certificates vim locales # Install and extract kernel. chroot "$chroot_dir" apt-get install -y linux-image-amd64 cp "$chroot_dir"/boot/vmlinuz-* "$output_dir/kernel-$basename" -# Deploy SSH keys, set default password. +# Deploy SSH keys. mkdir -p "$chroot_dir/root/.ssh" for user in tfloure; do curl "https://meta.recycled.cloud/~$user.keys" >> "$chroot_dir/root/.ssh/authorized_keys" @@ -60,6 +63,16 @@ auto eth0 allow-hotplug eth0 iface eth0 inet dhcp iface eth0 inet6 auto + +# OpenNebula VM vlan +auto eth0.10 +iface eth0.10 inet6 auto + vlan-raw-device eth0 + +# OpenNebula VM bridge +auto br-vms +iface br-vms inet6 auto + bridge_ports eth0.10 EOF # Build initramfs from generated installation.