5

I have a cluster of raspberry pi's and I am updating the os from raspian to ubuntu 20.04. I am able to configure a static ip address and name server, but I can not figure out how to disable ipv6. The cloud-init documentation states that dhcp6 is defaulted to false, but my system still shows an ipv6 address on boot. I am new to cloud-init and figuring things out as I go along. Any help would be greatly appreciated.

Lateralus
  • 151

1 Answers1

3

you could do

write_files:
  - path: /etc/sysctl.d/10-disable-ipv6.conf
    permissions: 0644
    owner: root
    content: |
      net.ipv6.conf.eth0.disable_ipv6 = 1
runcmd:
  - systemctl restart systemd-sysctl

to test it without restating:

sudo systemctl restart systemd-sysctl

confirm with:

ip a

and see there is no IPv6 address on the eth0 interface

runcmd is necessary to make the configuration take effect, and is executed after the write_files directive.

northben
  • 103
NicoKowe
  • 141