Prepare for networkd config generation

This commit is contained in:
Samuel Lorch 2023-04-04 23:15:28 +02:00
parent fae889b20e
commit 0aa827b682
4 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,13 @@
[Match]
{{ if .VlanID -}}
OriginalName={{ .Name .VlanID }}
{{- else -}}
MACAddress={{ .Mac }}
{{- end }}
[Link]
{{ if .VlanID -}}
MACAddress={{ .Mac }}
{{ end -}}
{{ if .Alias -}}
Alias={{ .Alias }}
{{- end }}

View file

@ -0,0 +1,5 @@
[NetDev]
Name={{ .Name }}
Kind=vlan
[VLAN]
Id={{ .VlanID }}

View file

@ -0,0 +1,21 @@
[Match]
{{ if .VlanID -}}
OriginalName={{ .Name .VlanID }}
{{- else -}}
MACAddress={{ .Mac }}
{{- end }}
[Network]
LLMNR=no
{{- if and .DHCP4 .DHCP6 }}
DHCP=yes
{{- else if .DHCP4 }}
DHCP=ipv4
{{- else if .DHCP6 }}
DHCP=ipv6
{{- end }}
{{- range .IPs }}
Address={{ . }}
{{- end }}
{{- range .Vlans }}
VLAN={{ VlanIDName . }}
{{- end}}