Enabling an Ethernet connection on Centos7

I recently created a new Centos VM. When it booted, I noticed it did not have a working ethernet connection. So, I started playing with things, and got it working. Here are my notes:

To view connections

nmcli c

To bring up the connection was simple:

nmcli c eth0 up

To make it persist across boots required the autoconnect value:

nmcli c mod eth0 connection.autoconnect yes

This last one reflects the ONBOOT value in the file /etc/sysconfig/network-scripts/ifcfg-eth0

Setting it changed ONBOOT from no to yes.

Rebooting the machine and ip addr shows the connection up.

 

2 thoughts on “Enabling an Ethernet connection on Centos7

Leave a Reply

Your email address will not be published. Required fields are marked *