BUG: No routing in VM with cloud init (ubuntu 18.x - 19.4)


Active Member
Dec 19, 2011
It´s possible a bug in the network setting from proxmox to VMs with cloud-init and ubuntu. I have see many forum entries about the same problemas! The big problem is a wrong routing and only with a manual work arround the VMs will runs! That can been, that a routing with a gateway neer the same network will run directly without problems, but a routing outside the NIC network can been a big problem!

So expl. IP and GW can been working but not expl. this constelation:
IP and GW - but only about the commands they use for this routing! When the scripts use different routing commands in this following form a routing will work correct - in moment with use the old commands the routing not exists in the VMs (under Ubuntu) !!!

route add dev eth0
route add default gw

So please is somebody they can confirm this?! And we like that we get in future a proxmox so as they do this, what we Admins have enter in the GUI !!!
  • Like
Reactions: Amin Vakil
If the gateway is not in the same subnet as the network, a route will be added on Fedora. On Ubuntu it requires an Ubuntu specific workaround that's not actually a 'valid' (documented) cloud-init network config option. (Add 'on-link: true' or something like that) And it requires the network config v2 to actually work.
That's the reason it is not yet implemented. Perhaps other distributions require even other workarounds.
For now please use a custom snippet with network config v2 and 'on-link: true' for routes on Ubuntu.

Could you please share an example of a snippet for this problem? I've been trying to figure this out for a day now..
For now please use a custom snippet with network config v2 and 'on-link: true' for routes on Ubuntu.

Please enter a link for the documentation, please!
If you're asking how to add a custom cloud-init config, see here: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_cloud_init (10.8.3).
You can now dump the automatically generated cloud-init config as a base for your customizations with qm cloudinit dump <vmid> network. Then add the routes you require based on the cloud-init network v2 docs [0] and if you're using Ubuntu, the netplan docs [1].

[0] https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v2.html
[1] https://netplan.io/reference


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!