13

I recently installed CentOS 7 as the sole OS on an Acer Aspire T. There is no GUI, as it is a server with a terminal-only interface.

What do I need to do to get CentOS 7 to be able to see and list the available wifi connections?

When I use the Network Manager Command Line Tool nmcli, I get the following, which indicates that nmcli has wifi enabled, but that it cannot see any wifi connections:

[root@localhost ~]# nmcli general status
STATE         CONNECTIVITY  WIFI-HW  WIFI     WWAN-HW  WWAN    
disconnected  none          enabled  enabled  enabled  enabled 
[root@localhost ~]# nmcli connection show
NAME  UUID  TYPE  DEVICE 
[root@localhost ~]# nmcli device status
DEVICE  TYPE      STATE      CONNECTION 
eno1    ethernet  unmanaged  --         
lo      loopback  unmanaged  --         
wlp3s0  wifi      unmanaged  -- 

I then checked the firewall config, which shows that ssh is the only open service, as follows:

[root@localhost network-scripts]# firewall-cmd --list-all
public (default, active)
  interfaces: eno1
  sources: 
  services: dhcpv6-client ssh
  ports: 
  masquerade: no
  forward-ports: 
  icmp-blocks: 
  rich rules:  

What do I need to change in order to get CentOS to be able to see the wifi connections? There are available connections. Does the firewall need to change? Or something else?


EDIT:

I am not able to do the things that @TimS. suggested because the following tools are not pre-installed on the computer, and it is not connected directly to the internet:

[root@localhost ~]# ifconfig -a
-bash: ifconfig: command not found
[root@localhost ~]# lspci -v
-bash: lspci: command not found  
[root@localhost ~]# iw dev
-bash: iw: command not found
[root@localhost ~]# iwconfig
-bash: iwconfig: command not found  

I am able to open nmtui, but am not sure what parameters to enter to create a new connection. [root@localhost ~]# iw dev -bash: iw: command not found [root@localhost ~]# iwconfig -bash: iwconfig: command not found

5
  • 1
    Try using nmtui to configure a wireless connection. Sep 15, 2015 at 0:07
  • 1
    Wifi on a server, is it for a home lab?
    – yagmoth555
    Sep 15, 2015 at 0:15
  • @yagmoth555 a development server.
    – CodeMed
    Sep 15, 2015 at 0:16
  • 2
    yum install NetworkManager-wifi*
    – Scott B
    Jun 27, 2016 at 22:24
  • If you open nmtui and you don't see the connections, there's nothing more the tool can do for you. You have to check your installation and actual availability of wifi networks. See my updated answer. Oct 28, 2016 at 7:59

6 Answers 6

11

When I use the Network Manager Command Line Tool nmcli, I get the following, which indicates that nmcli has wifi enabled, but that it cannot see any wifi connections:

Not at all. They only say that you haven't configured any wifi connection. You need to use other commands to check wifi connections and connect to wifi.

Make sure NetworkManager supports wifi and manages the wireless device

wlp3s0  wifi      unmanaged  -- 

This is a problem. If NetworkManager doesn't manage your wireless ethernet controller then you cannot expect it to see wifi networks and connect to them. NetworkManager would normally manage all devices automatically after a fresh boot.

You might want to check presence of the wifi package. If you don't have that package installed, you don't have wifi support in NetworkManager.

rpm -q NetworkManager-wifi

In that case you have to temprarily use an ethernet connection or transfer the RPM via other means.

yum install NetworkManager-wifi
systemctl restart NetworkManager

Connect using nmcli

To view available wifi networks:

nmcli dev wifi list

To connect to a wifi network called TestWifi:

nmcli --ask dev wifi connect TestWifi

Connect using nmtui

I also just successfully tried to view wifi networks in nmtui (not in CentOS but it should work). Choosing Activate new connection was enough to see the list of available wifi networks.

1
  • May also be affected by the manual choices made during the GUI installation process.If you select WiFi in the GUI before running the installation. I believe that I recall that this problem is avoided. The same may be true of other installation methods like kick start files and virt install
    – CodeMed
    Mar 22, 2017 at 1:00
3

Even though your system recognizes the wireless interface, you still need a package in order to manage it. Generally for CentOS, I use WPA Supplicant. It includes the tools you'd use to enable/disable/etc the interface.

A writeup is here on the CentOS wiki.

You can download the WPA Supplicant packages from various locations. I used RPMfind.net.

For reference, here are the instructions on configuring WPA Supplicant after installation. (taken from the above wiki)

Enabling wpa_supplicant without NetworkManager, updated version

This update is a simpler method to have a wifi interface connect automatically during the boot process. The original version is available below for reference.

Why an updated version?

  • Simpler to implement
  • More complete instructions
  • Does not change files overwritten by system updates
  • Supports "service network restart" to re-establish a connection

Edit /etc/sysconfig/network-scripts/ifcfg- file

Run iwconfig to find the wifi device. In this sample output, wlan0 is the only one that supports wifi.

# iwconfig 
lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"NETWORKSSID"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: 68:7F:74:AD:F3:3C   
          Bit Rate=54 Mb/s   Tx-Power=16 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
          Link Quality=50/70  Signal level=-60 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:90   Missed beacon:0

eth0      no wireless extensions.

pan0      no wireless extensions.

virbr0    no wireless extensions.

virbr0-nic  no wireless extensions.

# 

Edit the ifcfg for this interface. For example, using wlan0.

/etc/sysconfig/network-scripts/ifcfg-wlan0

Verify that the ONBOOT selection is enabled.

ONBOOT="yes"

Edit /etc/sysconfig/wpa_supplicant

Ensure that your device is included in the INTERFACES line in this file. In this example wlan0 is the only device supported by wpasupplicant.

# Use the flag "-i" before each of your interfaces, like so:
#  INTERFACES="-ieth1 -iwlan0"
INTERFACES="-iwlan0"

Edit /etc/wpa_supplicant/wpa_supplicant.conf

Most of your networks will require a single entry in wpa_supplicant.conf that looks like this. Replace NETWORKSSID and NETWORKPSK with the proper values for each network. Put them in the order that you want them used.

network={
        ssid="NETWORKSSID"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="NETWORKPSK"
}

Here is an example of a network which doesn't require a Pre Shared Key. If this appears before the "any" network it will be preferred to other open networks.

network={
        ssid="PUBLIC"
        key_mgmt=NONE
}

A final option (which you may not choose to implement) will let you connect to any network that is open. This is useful in hotels, but may allow connections to undesirable networks.

network={
        key_mgmt=NONE
}

Create /etc/rc5.d/S09prepnet

Paste the following text to create a new file which will prepare the running services for a wifi connection.

cat > /etc/init.d/prepnet <<EoT
#!/bin/sh

/etc/init.d/messagebus start
/etc/init.d/wpa_supplicant start
killall dhclient >/dev/null 2>&1

EoT
chmod a+rx /etc/init.d/prepnet
ln -s /etc/init.d/prepnet /etc/rc3.d/S09prepnet
ln -s /etc/init.d/prepnet /etc/rc5.d/S09prepnet

Configure services to run at boot

Paste the following commands to configure services.

chkconfig messagebus off
chkconfig wpa_supplicant off
chkconfig NetworkManager off
chkconfig network on

Reboot to enable

Upon the next reboot your wifi connection is enabled when network services start.

Adding or editing wifi networks

If you need to add or edit a wifi network, make whatever changes are needed in wpa_supplicant.conf.

/etc/wpa_supplicant/wpa_supplicant.conf

Next restart wpa_supplicant and network services.

service wpa_supplicant restart
service network restart
10
  • Thank you, but that does not seem to be an option in this situation. Please see EDIT to my OP. If I were to try your approach, you would have to explain which rpm files to download to a different PC and transfer manually by SCP from the other PC into this detached server. But I wonder why we cannot just use the tools that come pre-installed with CentOS 7. Are you suggesting a CentOS 6 approach whose tools were replaced with different tools in CentOS 7?
    – CodeMed
    Sep 15, 2015 at 1:07
  • 1
    CentOS is binary compatible to RHEL (built from the same source code). It's an enterprise-level operating system designed primarily for server-class systems, so they do not expect people to be using it on laptops and wifi. That's why distributions like Fedora are much easier -- they already include those types of packages required. If CentOS 7 includes those packages, that's news to me (We haven't deployed it here yet) but maybe there was enough of a demand of people using it for the same reasons you mentioned.
    – Tim S.
    Sep 15, 2015 at 1:15
  • 1
    A complete answer would list the files I need to download to a different PC and then transfer manually to this devbox. Are they rpm files? If so, where do I get them? What are there names?
    – CodeMed
    Sep 15, 2015 at 1:53
  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – slm
    Sep 15, 2015 at 2:02
  • Updated my answer with the instructions for configuration and a download link, along with the original URL.
    – Tim S.
    Sep 15, 2015 at 2:22
1

sometimes you need to install driver to detect it because centos by default only installs open source authorized drivers. seek rpm or look into parts manufactor's website for linux centos driver

1

Hi I spend yesterday the whole evening trying to get WIFI to work after reading tech document after tech document I finally came across a document that mentioned there being a bug in cent os 7 with the NetworkManager-wifi plugin not being included by default... The last thing I did last night was just do a completely clean install (It already was before, but I had been tampering so much I lost track)So this morning I had a fresh install of Cent OS 7 set up as a web server, I installed the NetworkManager-WIFI rpm from a stick did a reboot, and voila same as the connection I set up in the installation. It connected straight away.

0

Here is my experience, for the following reasons:

  1. If you got connected to Wifi network when you have installed CentOS 7.

  2. After CentOS 7 entering into sleep mode OR accidental shutdown due to power drainage OR you have restarted & logged into CentOS 7

and if your wifi not working.

Don't install extra kernel module/install any new packages/do any tweak.

Just shutdown and boot again in CentOS 7. Your wifi will start working again.

This is what I realised after 6 hours of tweaks and tried everything out

0

Same problem here. I never had this trouble when installing CentOS 7.3 but now I have it with CentOS 7.9. During installation it's possible to configure wifi to connect to the network, you can even see it connects as it gets an IP (if DHCP is configured), but after final reboot you can never connect your wifi device again.

After reading anserws here it was clear that the problem was missing NetworkManager-wifi so no service is taking care of the wifi connection. I searched the RPM package in RPMFind.net and downloaded, copied to a USB disk and

# mkdir /media/usb
# mount -t aut-/dev/sdb /media/usb
# cd /media/usb
# yum install NetworkManager-wifi-1.18.8-1.el7.x86_64.rpm <-- Replace with the name of your RPM File.
# reboot

and my wifi automatically connected to the network after rebooting.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .