From 9d958647d5034eff94f9d05120348e3380129504 Mon Sep 17 00:00:00 2001 From: lub Date: Wed, 29 Jan 2020 23:09:55 +0100 Subject: [PATCH] fix network setup of ax51 --- hardware/hetzner_ax51-nvme/network.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hardware/hetzner_ax51-nvme/network.sh b/hardware/hetzner_ax51-nvme/network.sh index 71ae36a..350fc83 100755 --- a/hardware/hetzner_ax51-nvme/network.sh +++ b/hardware/hetzner_ax51-nvme/network.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -address=$(ip address show dev eth0 scope global | grep -F 'inet ' | perl -pe 's#.*inet (.*?) .*#$1#') +address=$(ip address show dev eth0 scope global | grep -F 'inet ' | perl -pe 's#.*inet (.*?)/.*#$1#') gateway=$(ip route list dev eth0 default | perl -pe 's#.*via ##') # $interface differs from the live system because of different naming schemes @@ -12,5 +12,8 @@ echo "[Match] Name=$interface [Network] -Address=$address -Gateway=$gateway" > "/etc/systemd/network/${interface}.network" \ No newline at end of file +Gateway=$gateway + +[Address] +Address=${address}/32 +Peer=${gateway}/32" > "/etc/systemd/network/${interface}.network" \ No newline at end of file