How to enable network adapter in centOS7 minimal?

48,446

Solution 1

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.

Solution 2

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

ifup enp0s3

Solution 3

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

Share:
48,446
Harsha Yeluru
Author by

Harsha Yeluru

Updated on September 18, 2022

Comments

  • Harsha Yeluru
    Harsha Yeluru almost 2 years

    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

  • Robert Houghton
    Robert Houghton over 4 years
    Do you know what the s would be for in 'enp0s3' I assume it's 'ethernet port 0' but don't know what s3 refers to?
  • Bert
    Bert about 3 years
    @RobertHoughton s3 in your example is slot 3. [P<domain>]p<bus>s<slot>[f<function>][d<dev_id>] Redhat Docs