add networking config

master
lub 5 years ago
parent c9a36c0225
commit 256c7475b0

@ -0,0 +1,16 @@
#!/bin/bash -e
address=$(ip addr show dev eth0 scope global | grep -F 'inet ' | perl -pe 's#.*inet (.*?) .*#$1#')
gateway=$(echo "$address" | perl -pe 's#\d*/24$/#254#')
# $interface differs from the live system because of different naming schemes
# see https://wiki.debian.org/NetworkInterfaceNames for more details
interface='eno1'
echo "[Match]
Name=$interface
[Network]
Address=$address
Gateway=$gateway" > "/etc/systemd/network/${interface}.network"

@ -44,9 +44,18 @@ esp_uuid=$(blkid --output value "/hardware-setup/hardware/${1}/esp" | head -n1)
sed -i "s/%esp_uuid%/${esp_uuid}/" /etc/fstab
### Docker
### networking
apt-get -y install docker-ce
# generate configs for systemd-networkd.service
# this is template specific
"/hardware-setup/hardware/${1}/network.sh"
# systemd-networkd.service is disabled by default
systemctl enable systemd-networkd.service
# set DNS
echo 'nameserver 1.1.1.1
nameserver 8.8.8.8' > /etc/resolv.conf
### users
@ -67,6 +76,11 @@ for key in /hardware-setup/authorized_keys/*; do
done
### Docker
apt-get -y install docker-ce
### administration tools
apt-get -y install \

Loading…
Cancel
Save