Merge pull request #1071 from riederd/main

Enable creating a bonding network interface
This commit is contained in:
Christian Goll
2024-02-07 09:00:40 +01:00
committed by GitHub
4 changed files with 40 additions and 2 deletions

View File

@@ -12,9 +12,17 @@
id={{ $connection_id }}
interface-name={{ $netdev.Device }}
{{ if $netdev.Type -}}
{{ if eq $netdev.Type "bond-slave" -}}
slave-type=bond
{{- $conn := split $connection_id "_" }}
{{- $master := index $conn 0 }}
master={{ $master }}
type=ethernet
{{ else }}
type={{ $netdev.Type }}
{{ end -}}
autoconnect=true
{{ end -}}
{{ end -}}
{{ if $netdev.Hwaddr -}}
{{ if eq $netdev.Type "ethernet" -}}
@@ -26,6 +34,22 @@ mtu={{ $netdev.MTU }}
{{ end -}}
{{ end -}}
# bond
{{ if eq $netdev.Type "bond" -}}
[ethernet]
{{ if $netdev.MTU -}}
mtu={{ $netdev.MTU }}
{{ end -}}
[bond]
downdelay=0
miimon=100
mode=802.3ad
xmit_hash_policy=layer2+3
updelay=0
{{ end -}}
{{ if eq $netdev.Type "infiniband" -}}
[infiniband]
transport-mode=datagram
@@ -34,7 +58,7 @@ mtu={{ $netdev.MTU }}
{{ end -}}
{{ end -}}
{{ if $netdev.IpCIDR -}}
{{ if and ($netdev.IpCIDR) (ne $netdev.Type "bond-slave") -}}
[ipv4]
address={{ $netdev.IpCIDR }}
{{ if $netdev.Gateway -}}