How to Enable Network on CentOS

There is some situation when you perform minimal installation of CentOS 7 you may not get Network on your installation.

Run Super user using sudo command

sudo su

To check IP address use command

ip addr

eth0 is present and DHCP server is enabled but no IP address

Not connected in cent os 7 - anishmandal.in

and same can verify using a command

nmcli d

its showing eth0 is disconnected

Ethernet in cent os 7 - anishmandal.in

 To open Network Manager in the terminal we use a command

nmtui

which will give the following interface to interact

Edit network connection in cent os 7 - anishmandal.in
img 1

Here we can set hostname or edit an active connection.

let’s select edit connection and hit enter

eth0 in cent os 7 - anishmandal.in
img 2

eth0 is highlighted again hit enter

here we can navigate using tab key

Enable Automatically connect eth0 in cent os 7 - anishmandal.in
img 3

Select Automatically connect press space it will select and show X then again press tab to reach on <ok> and hit enter.

now on the previous image img 2 you just need to press the ESC key to go img 1 navigate to Quit by using down arrow key and hit enter.

Just restart network services by using the command

service network restart

now when we type “ip addr” command we can see it is assigned from DHCP.

See IP Address in cent os 7 - anishmandal.in

 Assigning Manual IP (Static IP)

we can assign Manual IP (Static IP) as on img 3

navigate IPv4 where its hows <Automatic> select Manual from Arrow key

Select manual IP address in cent os 7 - anishmandal.in

Then Tab to <Show> hit enter it will give complete dialog to assign all details.

add manual ip in cent os 7 - anishmandal.in