After I manually edit /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg
, how do I tell cloud-init
to update /etc/netplan/50-cloud-init.yaml
? In other words, it doesn't make sense to manually update both files; what's the standard process to re-apply the netplan?
The cloud-init confuguration files are not the place the change your network configuration after first boot, because the network configuration will only be generated once by cloud-init (on first boot).
You can however change the netplan config file directly. Then use the following commands as root to enable your changes. They will stick across boots.
Only the command 'cloud-init clean' will regenerate the 50...yaml file, but I dont think you want that. That would reset everything, including hostname en machine-id (resulting in a new max-address and a new dhcp ip address).
As Lismatro said, once you create your netplan config, generate then apply it.
In your cloud-init config, first tells netplan to use custom config:
Then create the netplan config (still in cloud-init config). Here is a simple example. Find more ways to configure network interfaces with netplan here:
Finally tell cloud-init to use it (again, still in cloud-init config):