Ubuntu Server Set Static IP Address

From DFWLPiki
Revision as of 20:17, 14 June 2021 by Jhorne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In order to change from DHCP to static IP address, edit the contents of /etc/netplan/00-installer-config.yaml

# This is the network config written by 'subiquity'
network:
  ethernets:
    ens160:
      dhcp4: no
      addresses: [10.128.20.41/24]
      gateway4: 10.128.20.1
      nameservers:
        addresses: [10.128.20.21, 10.128.20.22]
  version: 2

svae the file, and do:

netplan apply

or reboot the server.