mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-10 18:38:22 +00:00
Prepare for networkd config generation
This commit is contained in:
parent
fae889b20e
commit
0aa827b682
4 changed files with 39 additions and 0 deletions
13
internal/interfaces/template/link.tmpl
Normal file
13
internal/interfaces/template/link.tmpl
Normal 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 }}
|
5
internal/interfaces/template/netdev.tmpl
Normal file
5
internal/interfaces/template/netdev.tmpl
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[NetDev]
|
||||||
|
Name={{ .Name }}
|
||||||
|
Kind=vlan
|
||||||
|
[VLAN]
|
||||||
|
Id={{ .VlanID }}
|
21
internal/interfaces/template/network.tmpl
Normal file
21
internal/interfaces/template/network.tmpl
Normal 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}}
|
Loading…
Add table
Reference in a new issue