How to set a static IP Address for Ubuntu using netplan
So in newer version of Ubuntu, they changed the way to change your ip address so now it makes use of a tool called netplan. I recently had to use this on my server since DHCP isn't ideal for a server. I however made the big mistake to install the package
netplan
which is the
name of the command, instead however what i should have installed was
netplan.io
in the Ubuntu repo's at least.
Inside the /etc/netplan
there should be at least one .yaml
file if not type netplan generate
, which should generate
the file needed, if not you can use my template and just place in the
folder, and of cause change the settings to meet your needs.
netplan config template once your done
simply type netplan apply
and that should be it.
If however you don't have internet access on your machine and therefore can't install the right package, turn to the Ubuntu Documumentation to set up a temporary config. Ubuntu Docs
TLDR
Install the package "netplan.io", go to "/etc/netplan" runcurl -LO
https://handskemager.xyz/tutorials/set-static-ip-ubuntu/50-cloud-onit.yaml
(or wget instead of curl) edit the file accordingly, run "netplan apply",
reboot and your done