How to setup network after RHEL/CentOS 7 minimal installation

Photo of author

By rasho

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

[ads1]

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.

[ads]
[box type=”note” align=”” class=”” width=””]See also:

[/box]

74 thoughts on “How to setup network after RHEL/CentOS 7 minimal installation”

  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

    Reply
  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.

    Reply
  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!

    Reply
    • 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

      Reply
  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.

    Reply
  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

    Reply
  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?

    Reply
  7. 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

    Reply
  8. 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.

    Reply
  9. 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 😉

    Reply
  10. 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!

    Reply
  11. Hi,

    I installed CentOS 7 32 bit on my HP DV8000 laptop. Wireless connection is working fine but wired connection is not activated. In NetworkManager app even wired tab is disabled.
    # nmcli d
    DEVICE TYPE STATE CONNECTION
    wlp6s0 wifi connected HKNS-WIRELESS-2
    lo loopback unmanaged —
    No wired device is visible.
    # lspci |grep -i net
    06:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)
    08:08.0 Ethernet controller: Intel Corporation PRO/100 VE Network Connection (rev 01)

    # lspci -nn -k |fgrep -i ether
    08:08.0 Ethernet controller [0200]: Intel Corporation PRO/100 VE Network Connection [8086:1092] (rev 01)

    How can I install the driver and activate the wired network adapter? Please help. Thanks in advance!

    Reply
    • Hey Krishna,
      Did you able to solve this issue? I am having the same problem. Please let me know if you have a solution.

      Thank you in advance,
      -Sunil

      Reply
  12. My CentOS VM keeps dropping offline. Sometimes like clock work, 9 ping request timeouts and at times completely randomly goes up and down.

    I have disabled the firewall so that’s not it.
    The nic is also configured for “keep alive”
    I have already allowed SSH and can connect to it when it’s online.
    I have read dmesg, /var/log/messages and don’t see anything that makes sense
    Here’s the interesting part:1
    1. When I restart the network, the connection comes back temporarily
    2. The above does not happen if I restarted the firewalld
    3. ifup ens192 && ifup ens192 does bring the network back temporarily just like #1
    SSH is enabled and root logins are permitted and tested successfully

    Reply
  13. On CentOS 8 (minimal install):

    1. Run the command below to make sure the network interface/device is called eth0.
    nmcli d

    If “eth0” is not the name of your network interface, then replace “eth0” with the name of your interface in part 2 commands

    2. If the interface name is eth0, then run (as root) these commands:

    ifup eth0
    sed -c -i “s/\(ONBOOT *= *\).*/\1yes/” /etc/sysconfig/network-scripts/ifcfg-eth0
    systemctl restart NetworkManager.service

    Your done!

    The first command brings up the network interface. At this point you should be able to ping google.com & connect via ssh
    The second command sets the ONBOOT variable to “yes” in the ifcfg-eth0 file so that the interface starts up automatically on boot.
    The third command restarts the NetworkManager service.

    Reply

Leave a Comment