--- Begin Message ---
Signed-off-by: Guillaume <09couplet.bit...@icloud.com>
---
src/PVE/LXC/Setup/CentOS.pm | 12 ++++++++----
.../system-connections/eth0.nmconnection.exp | 2 ++
.../system-connections/eth0.nmconnection.exp | 2 ++
.../system-connections/eth1.nmconnection.exp | 2 ++
.../system-connections/eth2.nmconnection.exp | 2 ++
5 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/PVE/LXC/Setup/CentOS.pm b/src/PVE/LXC/Setup/CentOS.pm
index 06b4dac..42119ea 100644
--- a/src/PVE/LXC/Setup/CentOS.pm
+++ b/src/PVE/LXC/Setup/CentOS.pm
@@ -229,8 +229,8 @@ sub setup_netork_with_networkmanager {
my $header = "[connection]\nid=$d->{name}\nuuid=" . UUID::uuid() .
"\ntype=ethernet\ninterface-name=$d->{name}\n";
my $data = '';
+ $data .= "[ipv4]\n";
if ($d->{ip} && $d->{ip} ne 'manual') {
- $data .= "[ipv4]\n";
if ($d->{ip} eq 'dhcp') {
$data .= "method=auto\n";
} else {
@@ -245,10 +245,12 @@ sub setup_netork_with_networkmanager {
}
$data .= "dns=" . join(',', @nameserversv4) . "\n" if
@nameserversv4;
$data .= "dns-search=" . join(' ',
PVE::Tools::split_list($searchdomains)) . "\n" if @nameserversv4 &&
$searchdomains;
- }
+ } else {
+ $data .= "method=disabled\n";
+ }
+ $data .= "[ipv6]\n";
if ($d->{ip6} && $d->{ip6} ne 'manual') {
- $data .= "[ipv6]\n";
if ($d->{ip6} eq 'auto' || $d->{ip6} eq 'dhcp') {
$data .= "method=auto\n";
} else {
@@ -266,7 +268,9 @@ sub setup_netork_with_networkmanager {
}
$data .= "dns=" . join(',', @nameserversv6) . "\n" if
@nameserversv6;
$data .= "dns-search=" . join(' ',
PVE::Tools::split_list($searchdomains)) . "\n" if @nameserversv6 &&
$searchdomains;
- }
+ } else {
+ $data .= "method=disabled\n";
+ }
next unless $data;
$self->ct_file_set_contents($filename, $header . $data, 0600);
diff --git
a/src/test/test-centos10-001/etc/NetworkManager/system-connections/eth0.nmconnection.exp
b/src/test/test-centos10-001/etc/NetworkManager/system-connections/eth0.nmconnection.exp
index 25a907d..3bf5d2d 100644
---
a/src/test/test-centos10-001/etc/NetworkManager/system-connections/eth0.nmconnection.exp
+++
b/src/test/test-centos10-001/etc/NetworkManager/system-connections/eth0.nmconnection.exp
@@ -7,3 +7,5 @@ interface-name=eth0
method=auto
dns=127.0.0.1
dns-search=example.com
+[ipv6]
+method=disabled
diff --git
a/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth0.nmconnection.exp
b/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth0.nmconnection.exp
index c6c5417..49b0aed 100644
---
a/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth0.nmconnection.exp
+++
b/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth0.nmconnection.exp
@@ -10,3 +10,5 @@ gateway=11.0.0.1
routes=11.0.0.1
dns=127.0.0.1
dns-search=example.com
+[ipv6]
+method=disabled
diff --git
a/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth1.nmconnection.exp
b/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth1.nmconnection.exp
index a99b707..271f928 100644
---
a/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth1.nmconnection.exp
+++
b/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth1.nmconnection.exp
@@ -3,6 +3,8 @@ id=eth1
uuid=00000000-0000-0000-0000-000000000000
type=ethernet
interface-name=eth1
+[ipv4]
+method=disabled
[ipv6]
method=manual
address=fc00::1/64
diff --git
a/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth2.nmconnection.exp
b/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth2.nmconnection.exp
index 53a6df6..1a4a900 100644
---
a/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth2.nmconnection.exp
+++
b/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth2.nmconnection.exp
@@ -8,3 +8,5 @@ method=manual
addresses=192.168.0.1/24
dns=127.0.0.1
dns-search=example.com
+[ipv6]
+method=disabled
--
2.47.2
--- End Message ---
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel