Member-only story
Setting a Permanent Static IP Address in Ubuntu-Based Systems
How to Set a Static IP Address for your Ubuntu VM or Server
I have been able to set up lots of personal home labs/VMs for myself when trying out things on Ansible, Kubernetes, etc. One thing I keep battling with is constantly having to edit my /etc/hosts
file because my IP address constantly changes whenever I reboot or change my network. If you are like me or you simply want to have a permanent IP Address for your server, nodes, or VM, here are the steps to set up a static IP address in Ubuntu-based systems. Please click here for CentOs based systems.
With this I can memorize the IP’s of all my nodes and SSH into them as much as I can, anytime, and any day. I have a set-up of both Centos and Ubuntu on my laptop. That is why I am doing this additional guide.
Objectives:
1. Configure a static IP address in an Ubuntu-based system.
2. Make the IP address configuration permanent.
3. Understand the network configuration files and their role.
Prerequisites:
1. An Ubuntu-based system (e.g., Ubuntu 20.04 or later).
2. Administrative (sudo) privileges.
3. Basic knowledge of your network configuration, including the desired IP address, subnet mask, and gateway IP.