Gateway4/Gateway 6 are Deprecated - How Do I Configure a /64 IPv6 Range

Linode Staff

I am configuring a /64 IPv6 range for my Ubuntu 22.04 Linode using this guide:

However, when using the sudo netplan apply command, I got this error:

** (generate:892): WARNING **: 09:17:45.901: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.

** (generate:892): WARNING **: 09:17:45.901: `gateway6` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.

What do I do now that gateway4 and gateway6 are deprecated?

1 Reply

First, you will want to make sure that net.ipv6.conf.eth0.autoconf is set to 1 as noted in this guide:

To resolve your gateway error, you will need to replace this section:

      gateway4: 198.51.100.1                      # Primary IPv4 gateway.
      gateway6: "fe80::1"                         # Primary IPv6 gateway.

with this:

      routes:
        - to: default
          via: 198.51.100.1
        - to: default
          via: "fe80::1"

To complete your /64 IP setup, you will also want to remove your original IPv6 address from your list of addresses and then add your /64 IPv6 addresses like so:

  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
      addresses:
        - 198.51.100.5/24                         # Your Linode's public IPv4 address.
        # 3 example static IPs from your /64 range:
        - 2a01:5555:5555:5555::2/64
        - 2a01:5555:5555:5555::3/64
        - 2a01:5555:5555:5555::4/64

It's important to remember that you will still be able to interact with your SLAAC IPv6 address even though it is not listed in your netplan configuration.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct