I am spinning up a few CentOS 7 Servers in preparation for a Kubernetes/OpenShift Lab I am planning on running
There are a few ways to add a Static IP to a CentOS box. Here I will use the Network Manager TUI.
Type nmcli d to show your Interface/s – This is useful to know and will also show which Interface/s are connected
Type nmtui
This will provide a graphical interface to edit IP and Hostnames
Select Edit a connection and OK
Select the correct Interface and select Edit
From here we can add Static (Manual) details like: IP Address, Gateway, DNS etc..
I have Ignored IPv6 and Selected Require IPv4 addressing for this connection
OK out once you have made change and select Back to come out of the next screen
Whilst here I changed the Hostname
Once you have finished, exit out of Network Manager TUI
I restarted my Network: systemctl restart network
and checked the IP address was set correctly: ip addr show dev ens33 (Or your interface name)