Tag Archives: ubuntu

Configure a Static IP in Ubuntu 18.04

As with all things Linux there’s a million ways to do things, and every brilliant release comes up with a new way to do the same old things in a “better” way. Can you tell I’m be sarcastic yet? Good.

Anyway, after spending over an hour trying to get a freakin static IP on my desktop box I thought I’d share in case it saved anyone hours of their life.

My simple goal was to provide a static IP. Nothing more. Nothing less. Well, the “better” way of doing it now appears to be with “netplan”, and unless you enjoy banging your head against the wall, just create/edit this file and replace with the network interface (enp3s1), IP (192.168.20.55) and gateway (192.168.20.1) of your choice (this config appears to use the DNS servers from the router w/ DHCP turned on). Oh yeah, and don’t bother with the GUI based configuration tool, because apparently they’re not connected at all, and using this will force the config from this file (you’ve been warned and saved hours)

sudo nano /etc/netplan/01-networkd.yaml

# this is the actual file content
network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s1:
      dhcp: no
      addresses: [192.168.20.55/24]
      gateway4: 192.168.20.1
Please remember to subscribe to the newsletter to stay up to date!

You or someone you know looking to buy or sell?
Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself. You would think this should be self evident these days, but apparently not...