Add Static IP to CentOS 7

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.

1

Type nmcli d to show your Interface/s – This is useful to know and will also show which Interface/s are connected

2

Type  nmtui

3

This will provide a graphical interface to edit IP and Hostnames

Select Edit a connection and OK

4

Select the correct Interface and select Edit

5

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 connection6

OK out once you have made change and select Back to come out of the next screen

8

Whilst here I changed the Hostname

9

Once you have finished, exit out of Network Manager TUI

I restarted my Network: systemctl restart network

10

and checked the IP address was set correctly: ip addr show dev ens33 (Or your interface name)

11

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s