summaryrefslogtreecommitdiffstats
path: root/roles/network/templates
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-07-06 01:49:45 +0200
committerAhmed Abdelhalim <[email protected]>2026-07-06 01:49:45 +0200
commit09fbb2b1d86b8ad6671c746f3df997390f7a6293 (patch)
tree24cddc6e7b0ad6c18a320d215e67b9c6970ef246 /roles/network/templates
parent0e7e66f00da0b37ef68cca0d13a1588a30cb9235 (diff)
Fix pve network setup
Diffstat (limited to 'roles/network/templates')
-rw-r--r--roles/network/templates/bridge.nmconnection.j229
-rw-r--r--roles/network/templates/eth0-connection.nmconnection.j212
2 files changed, 39 insertions, 2 deletions
diff --git a/roles/network/templates/bridge.nmconnection.j2 b/roles/network/templates/bridge.nmconnection.j2
new file mode 100644
index 00000000..2e8bf23c
--- /dev/null
+++ b/roles/network/templates/bridge.nmconnection.j2
@@ -0,0 +1,29 @@
+[connection]
+id={{ network_bridge }}
+type=bridge
+interface-name={{ network_bridge }}
+autoconnect=true
+
+[bridge]
+stp=false
+
+[ipv4]
+method=manual
+addresses={{ network_ipv4_address }}/{{ network_ipv4_prefix | default(24) }}
+gateway={{ network_ipv4_gateway }}
+{% if network_ipv4_dns is defined %}
+dns={{ network_ipv4_dns }}
+{% endif %}
+
+[ipv6]
+addr-gen-mode=default
+{% if network_ipv6_address is defined %}
+method=manual
+addresses={{ network_ipv6_address }}
+gateway={{ network_ipv6_gateway }}
+{% if network_ipv6_dns is defined %}
+dns={{ network_ipv6_dns }}
+{% endif %}
+{% else %}
+method=disabled
+{% endif %}
diff --git a/roles/network/templates/eth0-connection.nmconnection.j2 b/roles/network/templates/eth0-connection.nmconnection.j2
index 666b0360..6a6481c4 100644
--- a/roles/network/templates/eth0-connection.nmconnection.j2
+++ b/roles/network/templates/eth0-connection.nmconnection.j2
@@ -2,12 +2,18 @@
id=ethernet
type=ethernet
autoconnect=true
+{% if network_bridge is defined %}
+controller={{ network_bridge }}
+port-type=bridge
+{% endif %}
[ethernet]
cloned-mac-address=permanent
[ipv4]
-{% if network_ipv4_address is defined %}
+{% if network_bridge is defined %}
+method=disabled
+{% elif network_ipv4_address is defined %}
method=manual
addresses={{ network_ipv4_address }}
gateway={{ network_ipv4_gateway }}
@@ -20,7 +26,9 @@ method=auto
[ipv6]
addr-gen-mode=default
-{% if network_ipv6_address is defined %}
+{% if network_bridge is defined %}
+method=disabled
+{% elif network_ipv6_address is defined %}
method=manual
addresses={{ network_ipv6_address }}
gateway={{ network_ipv6_gateway }}