add networking config
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"
|
Loading…
Reference in New Issue