CentosLinux

How to setup network after RHEL/CentOS 7 minimal installation

After installing RHEL/CentOS 7 minimal, You may not able to connect network in that machine. This will happen because Ethernet interfaces are not enabled by default.
This guide explain you to setup network on RHEL/CentOS 7.

Setup network on CentOS 7 minimal

First, type “nmcli d” command in your terminal for quick list ethernet card installed on your machine:

"nmcli d" command output
“nmcli d” command output

Type “nmtui” command in your terminal to open Network manager. After opening Network manager chose “Edit connection” and press Enter (Use TAB button for choosing options).

CentOS_7 Network manager screen
CentOS_7 Network manager screen

Now choose you network interfaces and click “Edit

Edit your network interfaces
Edit your network interfaces

DHCP configuration

Choose “Automatic” in IPv4 CONFIGURATION and check Automatically connect check box and press OK and quit from Network manager.

Set ip adress using DHCP
Set ip adress using DHCP

Reset network services:

service network restart

Now your server will get IP Address from DHCP .

CentOS 7 check ip address
CentOS 7 check ip address

If you want to set a static IP address see How to configure static ip address on CentOS 7.

58 Comments

  1. Activate network after install:
    1. Edit /etc/sysconfig/network-scripts/ifcfg-eth0
    ONBOOT=yes
    2.

    # /etc/init.d/network restart

    Look for easyrsh app og google play quick reference guide for Solaris, HPUX, Redhat OSs

  2. Hi, guys. I can’t see any available Ethernet after I open nmtui as attached. I have to add a new Ethernet connection every time I create a new VM, and I have to hard code the MAC address to the new Ethernet connection I have created.
    Does anyone know is there a way to detect the connection automatically after I deploy a new VM?

    Thank you in advance.

  3. Hi,I also meet this problem and can’t see any avaiable Ethernet after use “nmcli d”,so how to do? Can you send solutions to my email:bingliang711@hotmail.com
    Thanks!

    1. First, verify the status of Network Manager service
      # systemctl status NetworkManager.service
      To check which network interface is managed by Network Manager,
      type:
      # nmcli dev status

      I hope I helped you

  4. NetworkManager is still an abomination in my eyes for most uses, but for a workstation I get it.. otherwise NM_CONTROLLED=n is my friend.

  5. For a minimal install, why would you ever use networkmanager? Is it now forced in 7? If not, I would never, ever, use networkmanager on a server. It’s only real use is for mobile devices that hop around wireless networks all the time.
    In 6, I would use system-config-network-tui

  6. I am stuck in a silly thing but not sure how to solve it. To enable “Automarically Connect” checkbox, I am clicking in ENTER button and I am not getting “X”. How can I enable it?

    1. Type following command:
      # vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
      and change on ONBOOT=no to ONBOOT=yes

  7. Fantastic! Thank you very much for this helpful article – just what I needed and it worked.

  8. hello, i recently instlled centos7 but i have just LO interface,not eth0!! please could you help me!! tanks

    1. may be the ip is down state…..once use this command #ifup eth0

      here eth0 is default interface.once try friend

  9. Hi,
    How do I connect via wifi? It says it’s unmanaged. I’m real new to Linux ( Centos 7). Thanks for all of your help.

  10. Very straight forward and easy. After mucking around for about an hour, this help me complete in within minutes. Is there any chance you help me one on one? Many thanks

  11. Excellent. I thought Virtualbox would create this interface if you set it to bridged networking. But it did not. So I used nmtui add/manual and entered gateway and 192.* ip address and I could connect to CentOS from the host machine.

  12. Great…that helped me a lot.
    Although on my CentOS 7 Network manager was not running out of the but…..please add in your guide to start it 😉

  13. Thank man, you hit at right point. I wasted so much time by going on to those useless links. But your solution worked like a charm.
    Thanks again!

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.

Close
Close