aliases | category | classification | date | date_modified | draft | id | image | links | local_archive_links | pinned | series | tags | title | type | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
network |
public |
2020-06-28 06:02:40 -0700 |
2020-06-28 06:02:40 -0700 |
false |
20200628130240 |
false |
false |
|
Set Static IP on Ubuntu 20.04 |
tech-note |
Create or edit /etc/netplan/01-netcfg.yaml
and insert the below, replacing the adapter name and IP info if required:
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
addresses: [10.0.0.2/24]
gateway4: 10.0.0.1
nameservers:
addresses: [1.1.1.1,1.0.0.1]
The example above sets a static IP on my Raspberry Pi.
To restart networking, you can then run sudo netplan apply
.