assign _eth0_ to default network interface

This commit is contained in:
Niko Kivel
2021-03-25 12:49:13 +01:00
parent cabf665b4b
commit 5858404f27
2 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
auto eth0
allow-hotplug eth0
iface eth0 inet static
address {{.NetDevs.eth0.Ipaddr}}
netmask {{.NetDevs.eth0.Netmask}}
gateway {{.NetDevs.eth0.Gateway}}
up ifmetric eth0 30

View File

@@ -0,0 +1,11 @@
# /etc/systemd/network/10-persistent-net.link
{{range $devname, $netdev := .NetDevs}}
{{- if $netdev.Default}}
[Match]
MACAddress={{$netdev.Hwaddr}}
[Link]
Name={{$devname}}
{{- end}}
{{end}}