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 up eth0

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.

4 thoughts on “Enabling an Ethernet connection on Centos7

  1. Thanks for the correction. I’ll need to confirm when next I bring up a C7.5 system. But since that is the right order on RHEL, I think you are correct.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.