Skip to content

Instantly share code, notes, and snippets.

@strarsis
Last active February 13, 2023 19:30
Show Gist options
  • Save strarsis/970f77b766921841b7ae453c74e970b1 to your computer and use it in GitHub Desktop.
Save strarsis/970f77b766921841b7ae453c74e970b1 to your computer and use it in GitHub Desktop.
Hetzner Cloud netplan configuration for IPv4+IPv6 (Dual Stack)
# /etc/netplan/50-cloud-init.yml
# Ensure that other netplan config yml files in /etc/netplan/ don't interfere with this configuration
network:
version: 2
renderer: networkd
ethernets:
ens3: # (Primary interface, usually ens3 or ens33 on recent Ubuntus)
addresses:
- <Hetzner instance IP4>/32
- <Hetzner instance IP6>::1/64
routes:
- to: 0.0.0.0/0
via: 172.31.1.1
on-link: true
gateway6: fe80::1
accept-ra: true # needs to be enabled!
nameservers:
addresses: # (Hetzner DNS servers)
- 213.133.98.98
- 213.133.99.99
- 213.133.100.100
- 2a01:4f8:0:1::add:1010
- 2a01:4f8:0:1::add:9999
- 2a01:4f8:0:1::add:9898
@No0key
Copy link

No0key commented Oct 20, 2021

@frennkie thanks for the reply. I've tried grub line and that not worked for me on ubuntu20.04 (can't connect to my server). I've found cause of my problem. If any ipv6 settings is used in your config file, ipv6 will be enabled. Since this pull request, networkd just ignores what in sysctl.conf. Solution that worked for me is remove all ipv6 configuration from netplan.yml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment