4th Floor, 4 Tabernacle Street London EC2A 4LU

Ubuntu Server 18.04 (Bionic Beaver) – Set Static IP Address

bionic ubuntu beaver baby

The latest version of Ubuntu server has moved management of IP information from /etc/network/interfaces into a YAML file located here: /etc/netplan/

Example static IP address set below:

Step 1:

Edit the file: /etc/netplan/50-cloud-init.yaml 

Set the IP to: 192.168.100.201

network:
    ethernets:
      enp3s0:
         dhcp4: no
         addresses: [192.168.100.201/24]
         gateway4: 192.168.100.1
         optional: true
         nameservers:
            addresses: [8.8.8.8]
    version: 2

Step 2:

Apply the change, run the command:

netplan apply