[SOLVED] Debian 12 - Network / cloud-init / proxmox / netplan vs interfaces

andaga

Member
May 24, 2022
94
14
8
Hello everyone!

I have a problem with Debian 12 which has been seriously bothering me for a few days and I really don't know how to solve it and above all I don't understand who is sending the bad information.

Well, let's start working on the latest build of ProxMox! So completely up to date!

My issue is the following:

I create a Debian 12 template VM with cloud-init! I fill in my fields in cloud-init and the network part!

My new VM is created magnificent everything is fine! EXCEPT the network which screws up every time!

By default Debian 12 uses netplan and no longer /etc/network/interfaces (which I liked this one)!

In the config of the 50-cloudinitt...... file of netplan we see that for the gateway part it uses the
gateway4: IP of the gateway

instead of using the

routes:
- on-link: true
to: default
via: STANDARD-GATEWAY OF ACTIVE INTERFACE

So I get errors all the time when I do "netplan apply" and especially if I put a /32 network mask I literally have no traffic at all because the information is missing:

- on-link: true

so that /32 for ipv4 and /128 for ipv6 works!

In summary, who sends the information in the vm? Is it ProxMox? Is it the qcow2 of the image I download? How do we fix this because I'm starting to go crazy! lol :)

Greetings
 
Last edited:
Since when does Debian 12 use netplan? I have a half dozen Debian installs and none of them use it. The desktop ones use network manager not netplan. Servers use ifupdown aka interfaces file. Ubuntu uses netplan but not Debian unless cloudinit is doing it different for some reason.

Maybe this is why you get errors.
 
  • Like
Reactions: ikarlo
All qcow2 disk file I download from Debian website come automatically with systemd-networkd service by default mean netplan...
Which cloud image you use for creating your vm template?
 
I create a Debian 12 template VM with cloud-init!
There are many places where this can go wrong. The issue can potentially be in your process and troubleshooting that is beyond the scope of this forum.
! I fill in my fields in cloud-init and the network part!
Do you mean in PVE cloud-init wizard? Its possible that you will need to use custom cloudinit file.
In summary, who sends the information in the vm? Is it ProxMox? Is it the qcow2 of the image I download? How do we fix this because I'm starting to go crazy!
I'd start with using a prebuild official cloud image, where chances are higher that its correct, and make sure you can get that working. Try both the built-in cloud-init wizard and via custom cloud-init files (user, network, vendor).

If everything works, then continue with your custom image and start with getting it working with custom cloud-init, using one of the guides on the net. When you have a working file you can compare it with what PVE creates and if there are radical differences.

Good luck


Blockbridge: Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
There are many places where this can go wrong. The issue can potentially be in your process and troubleshooting that is beyond the scope of this forum.

Do you mean in PVE cloud-init wizard? Its possible that you will need to use custom cloudinit file.

I'd start with using a prebuild official cloud image, where chances are higher that its correct, and make sure you can get that working. Try both the built-in cloud-init wizard and via custom cloud-init files (user, network, vendor).

If everything works, then continue with your custom image and start with getting it working with custom cloud-init, using one of the guides on the net. When you have a working file you can compare it with what PVE creates and if there are radical differences.

Good luck


Blockbridge: Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Hello!
We have installed this qcow2 disk from this link:

https://cloud.debian.org/images/clo...ian-12-genericcloud-amd64-20231210-1591.qcow2

We have create the template and complete the field into the Cloud-init menu of the VM into ProxMox!

Everything is sent correctly during boot of the vm except the network side on the 50-cloudinit files into netplan folder!

It's using old value like gateway4 explained before!

But I don't understand what you mean about custom cloudinit files... You mean into the template? If yes! At which path??
Or at the ProxMox level?

Thank you for your time.
 
Hello! Finally I have found the issue after doing more hours of research!

In fact it was a cloud-init bug!

I explain:

Debian 12 Generic Cloud image we can dowload from Debian website come with default network the "netplan"
The latest version of cloud-init installed into Debian 12 over the normal repo are the Cloud-init 22.4.2

After some research into all the logs and changelog of cloud-init release we can see from the cloud-init 23.1.X version the problme about the netplan config with /32 subnet and the deprecated gateway4, the right on the directoy when you do netplan apply and they said the right on this folder is wrong... All of this thing is fixed on the new release.

For that I have downloaded the new release stable at this link:
https://packages.debian.org/sid/all/cloud-init/download

Installed into my debian 12 cloud image and now everything work.

I hope this thread can help other proxmox user to fix the problem.

Regards

Anthony
 
This problem exists in Ubuntu below 22 and all Debian versions. It happens because Cloudinit uses gateway4 and gateway6 to apply static routes to the gateway but this is now depreciated. In Ubuntu 22 and netplan the routes command is used to apply the static routes to the gateway so you won't have the same issues. It's a real pain the in the fucking arse for people who rent or co-locate servers because it means you basically have to create a custom OS per server because the gateway to the outside world is usually different. I tend to create a systemd service that runs just after Cloudinit. The service runs a simple bash script that applies the static routes to the gateway. This way I just have to run something like virt-edit -a debian-12-generic-amd64-daily-20231218-1599.qcow2 /path/to/script to update the IP for the gateway and then package it as a template. You can save yourself 5 minutes of boot time by disabling the systemd-networkd-wait-online.service. Someone here might have a better way of doing this but I find running the script at boot is very reliable.
 
Hello!
I think the problem is deeper than this!

Because if Cloud-Init was updated in official rest to switch to 23.x there would no longer be this concern for Gateway4 etc ... but directly by the new road mode:

Having just updated manually by downloading the .deb package to update Cloud-Init at the OS level, I no longer have any worries! So no need to script or anything!

On the other hand, I would really like to understand why the update is not offered at the Debian 12 level to put the 23.x of Cloud-Init! It's just incredible!
 
When did release 23.1 of Cloud-Init come out? Debian 12 has been out since June and was frozen for many months before that. Debian don't update versions of packages between releases. They're like Red Hat Enterprise that way.

If you want a Linux that is up to the last five-minute-ago release you're on the wrong one. Or you should use testing or unstable builds.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!