在最近的 Ubuntu 中,netplan 是配置网络适配器的默认方式。我想要我的一个静态 IP,并且有一些关于如何做到这一点的指南。有人指出您需要编辑50-cloud-init.yaml。但该文件有一个不祥的警告:
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
Run Code Online (Sandbox Code Playgroud)
askubuntu 上的一个答案引用了这一点,并让用户这样做。(注意它的渲染器设置为 networkd。)
哪种方法是正确的?他们都工作吗?
最令人困惑的是,“跨实例持久化”是什么意思?这些设置在重新启动后仍然保持良好。我什么时候会丢失 50-cloud-init.yaml 中的设置?