diff --git a/overlays/wwinit/etc/NetworkManager/system-connections/ww4-managed.ww b/overlays/wwinit/etc/NetworkManager/system-connections/ww4-managed.ww new file mode 100644 index 00000000..b4d64fc1 --- /dev/null +++ b/overlays/wwinit/etc/NetworkManager/system-connections/ww4-managed.ww @@ -0,0 +1,43 @@ +{{- $host := .BuildHost }} +{{- $time := .BuildTime }} +{{- $source := .BuildSource }} +{{- range $devname, $netdev := .NetDevs }} +{{- $filename := print "warewulf-" $devname ".conf" }} +{{- file $filename }} +# This file is autogenerated by warewulf +# Host: {{ $host }} +# Time: {{ $time }} +# Source: {{ $source }} +[connection] +id={{ $devname }} +interface-name={{ $netdev.Device }} +{{ if $netdev.Type -}} +type={{ $netdev.Type }} +{{ end -}} +autoconnect=true + +{{ if $netdev.Hwaddr -}} +{{ if eq $netdev.Type "ethernet" -}} +[ethernet] +mac-address={{ $netdev.Hwaddr }} +{{ end -}} +{{ end -}} + +{{ if $netdev.IpCIDR -}} +[ipv4] +address={{ $netdev.IpCIDR }} +{{ if $netdev.Gateway -}} +gateway={{ $netdev.Gateway }} +{{ end -}} +method=manual +{{ end -}} + +{{/* always autoconfigure ipv6 */}} +[ipv6] +addr-gen-mode=stable-privacy +method=ignore +never-default=true +{{ if $netdev.Ipaddr6 -}} +ipaddr="{{ $netdev.Ipaddr6 }}" +{{ end -}} +{{ end -}}