Skip to content

Latest commit

 

History

History
39 lines (34 loc) · 785 Bytes

set-static-ip-ubuntu.md

File metadata and controls

39 lines (34 loc) · 785 Bytes
aliases category classification date date_modified draft id image links local_archive_links pinned print series tags title type
set-static-ip-ubuntu
network
public
2020-06-28 06:02:40 -0700
2020-06-28 06:02:40 -0700
false
20200628130240
false
false
static
networking
ubuntu
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.