Member-only story
Setting a Permanent Static IP Address in CentOS-Based Systems
How to Set a Static IP Address for your 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 just 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 CentOS-based systems.
Objectives:
- Configure a static IP address in a CentOS-based system.
- Make the IP address configuration permanent.
- Understand the network configuration files and their role.
Prerequisites:
- A CentOS-based system (e.g., CentOS 8 or later).
- Administrative (sudo) privileges.
- Basic knowledge of your network configuration, including the desired IP address, subnet mask, and gateway IP.
Step-by-Step Guide:
- Identify Your Network Interface Name:
To configure a static IP address, you need to identify the name of your network interface. You can do this by using the ip
command…