How to enable network adapter in centOS7 minimal?

While installing centOS 7 minimal, I missed enabling network.

Now, I am unable to connect to the network (unable to ping or install packages using yum to be precise).

How can I enable the network settings so that I can connect to the network and install packages using yum?

Thanks in advance


Edit the file from the below location.

/etc/sysconfig/network-scripts/ifcfg-enp<number> Change the ONBOOT option to YES and restart network service.

service network restart

This will enable the network whenever VM is brought up.

To know the network status use the nmcli d command STATE column output.


May be you just need to bring the network interface up, so the command is

ifup enp0s3

If you have DHCP available on the network, you can also run dhclient and it will attempt to configure DHCP on all available interfaces.