Adding a route through cloud-init

greg

Renowned Member
Apr 6, 2011
140
2
83
Greetings

I'm testing cloud-init on a brand new Ubuntu 18.04 VM.

My problem is that the IP of the VM and the GW are not on the same subnet (which is quite usual for a floating IP), so I guess the whole process of setting network fails.

I can see the parameters in /etc/netplan/50-cloud-init.yaml, so I tried adding a file 60-route.yaml with this :

network:
version: 2
ethernets:
eth0:
routes:
- my.gw.ip/32
via: eth0

On reboot the network doesn't come up.

How can I achieve setting up the network?

Thanks in advance
 
  • Like
Reactions: Amin Vakil
I found a way:

network:
version: 2
ethernets:
eth0:
gateway4: 94.23.201.254
routes:
- to: 94.23.201.254/32
via: 0.0.0.0
scope: link

(be careful it's yaml which is very hard to write correctly).

Is there a way to achieve that with Proxmox GUI?

TIA