diff --git a/setup.sh b/setup.sh index 3ffbce3..e62a769 100644 --- a/setup.sh +++ b/setup.sh @@ -268,32 +268,14 @@ echo "echo \"Done.\"" >> /mnt/setup-chroot.sh # network configuration should have optional static configuration - not just DHCP, it's very important -echo "" -echo "Writing network interfaces file..." >> /mnt/setup-chroot.sh -macaddr=$(echo $hostname|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/') -mkdir -p /mnt/etc/network && mkdir -p /mnt/etc/network/interfaces.d -echo "auto lo br0" > /mnt/etc/network/interfaces.d/br0 -echo "iface lo inet loopback" >> /mnt/etc/network/interfaces.d/br0 -niclist="" -for nic in "$nics"; do - echo "iface ${nic} inet manual" >> /mnt/etc/network/interfaces.d/br0 - niclist="$niclist $nic" -done -echo "iface br0 inet dhcp" >> /mnt/etc/network/interfaces.d/br0 -echo " post-up ip link set br0 address $macaddr" >> /mnt/etc/network/interfaces/br0 -echo " bridge_ports${niclist}" >> /mnt/etc/network/interfaces/br0 -echo " bridge_stp on" >> /mnt/etc/network/interfaces/br0 -echo " dns-nameservers 127.0.0.53" >> /mnt/etc/network/interfaces/br0 -echo "source-directory /etc/network/interfaces.d" > /mnt/etc/network/interfaces -echo "systemctl unmask networking && systemctl enable networking" >> /mnt/setup-chroot.sh -echo "Done." >> /mnt/setup-chroot.sh +echo "systemctl unmask networking && systemctl enable networking" >> /mnt/setup-chroot.sh # configure docker storage to use zfs mkdir -p /mnt/etc/docker echo "{\"storage-driver\":\"zfs\"}" > /mnt/etc/docker/daemon.json echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /mnt/etc/sysctl.conf -echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /mnt/etc/sysctl.conf +echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /mnt/etc/sysctl.conf echo "net.ipv6.conf.lo.disable_ipv6 = 1" >> /mnt/etc/sysctl.conf echo 'echo ""' >> /mnt/setup-chroot.sh @@ -464,6 +446,28 @@ if ! [ "$?" = "0" ]; then exit $? fi + + +echo "" +echo "Writing network interfaces file..." +macaddr=$(echo $hostname|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/') +mkdir -p /mnt/etc/network && mkdir -p /mnt/etc/network/interfaces.d +echo "auto lo br0" > /mnt/etc/network/interfaces.d/br0 +echo "iface lo inet loopback" >> /mnt/etc/network/interfaces.d/br0 +niclist="" +for nic in "$nics"; do + echo "iface ${nic} inet manual" >> /mnt/etc/network/interfaces.d/br0 + niclist="$niclist $nic" +done +echo "iface br0 inet dhcp" >> /mnt/etc/network/interfaces.d/br0 +echo " post-up ip link set br0 address $macaddr" >> /mnt/etc/network/interfaces/br0 +echo " bridge_ports${niclist}" >> /mnt/etc/network/interfaces/br0 +echo " bridge_stp on" >> /mnt/etc/network/interfaces/br0 +echo " dns-nameservers 127.0.0.53" >> /mnt/etc/network/interfaces/br0 +echo "source-directory /etc/network/interfaces.d" > /mnt/etc/network/interfaces +echo "Done." + + exit 0 # commented out for debugging echo ""