Ubuntu 20LTS static IPv4 & IPv6
In a default install of Ubuntu 20LTS, the /etc/network/interfaces
file is empty.
Instead, update the /etc/netplan/00-installer-config.yaml
.
Then run sudo netplan apply
.
(Below, change X.X.X.40
to your IP address.)
IPv4
Add IPv4 static: https://www.linuxtechi.com/assign-static-ip-address-ubuntu-20-04-lts/
IPv6
(This article references /etc/netplan/01-netcfg.yaml
which doesn't exists, use 00-installer-config.yaml
instead.)
Add IPv6 static: https://www.transip.eu/knowledgebase/entry/3412-adding-ipv4-ipv6-address-ubuntu/?utm_source=knowledge%20base/
$ sudo netplan apply |
I choose to match my IPv6 (::X.X.X.40
) address to my IPv4 address (X.X.X.40
). However, this doesn't work correctly in the yaml file. It is necessary to add a zero before the IPv6 address: 0::X.X.X.40
https://github.com/getdnsapi/getdns/issues/358
My final version of /etc/netplan/00-installer-config.yaml
(change X.X.X
to your IP address).
I only use IPv6 internally, thus neither a IPv6 gateway
not nameserver
is configured.
|
|