How do I enable the wireless network adapter on centos 7 minimal install?

Manish Batra asked:

I have just installed CentOS 7 over an old windows PC. The CentOS 7 image was of minimal install as I had only 4 GB of pendrive available.

The wifi driver named wlp18s0b1 shows in the list if I do ip link but it’s configuration file is not there in the /etc/sysconfig/network-scritps/ so I can’t enable this interface using ifup. ifup wlp18s0b1 says the following.

/sbin/ifup: configuration for wlp18s0b1 not found.
Usage: ifup

The option nmcli d shows the wifi device wlp18s0b1 listed along with the ethernet card but when I do nmcli conn up it says the following .

Error: unknown connection wlp18s0b1

I am not sure how to bring this device up with nmcli and I don’t have any extra network tools such as iw, iwconfig, ifconfig, dhclient available as it was a minimal install.

I only have access to wifi from here so can’t use ethernet to install these as well.

My answer:

You can quickly connect to a wireless network using nmcli:

nmcli d wifi c <SSID> --ask

This will connect to the specified SSID, ask you for the passphrase, and configure the entire connection for you.

You are meant to use the literal word wifi, not the interface name. NetworkManager will find your WiFi interface on its own.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.