如何禁用云初始化网络?

Kin*_*arō 7 cloud cloud-init

我正在尝试禁用云初始化网络配置。从云初始化文档中,我必须network-config={config: disabled}在内核命令行条目中进行设置。

当我将其设置为/etc/default/grub

GRUB_CMDLINE_LINUX="network-config={config: disabled}"
Run Code Online (Sandbox Code Playgroud)

并运行update-grub,但它给了我以下错误:

generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-116-generic
Found initrd image: /boot/initrd.img-4.4.0-116-generic
Found linux image: /boot/vmlinuz-4.4.0-104-generic
Found initrd image: /boot/initrd.img-4.4.0-104-generic
Found linux image: /boot/vmlinuz-4.4.0-97-generic
Found initrd image: /boot/initrd.img-4.4.0-97-generic
error: syntax error.
error: Incorrect command.
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 128
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
done
Run Code Online (Sandbox Code Playgroud)

看起来它不需要 yaml 字符串。

我配置在正确的地方吗?

谢谢

小智 15

创建一个文件,其中/etc/cloud/cloud.cfg.d/99-custom-networking.cfg包含:

network: {config: disabled}
Run Code Online (Sandbox Code Playgroud)