Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable cloud init networking?

I am trying to disable cloud init network configuration. From the cloud init doc, I have to set network-config={config: disabled} in the kernel command line entry.

When I set it in /etc/default/grub:

GRUB_CMDLINE_LINUX="network-config={config: disabled}"

and run update-grub but it gives me the following error:

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

Looks like it doesn't take a yaml string.

Am I configuring in the right place?

Thanks

like image 632
Kintarō Avatar asked May 10 '26 20:05

Kintarō


1 Answers

Create a file at /etc/cloud/cloud.cfg.d/99-custom-networking.cfg which contains :

network: {config: disabled}
like image 67
Thanat Noo. Avatar answered May 19 '26 08:05

Thanat Noo.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!