why can't this CentOS 7 server see wifi connections?
Solution 1
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.
Solution 2
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
Solution 3
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.
Solution 4
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
Related videos on Youtube
RabT
Updated on September 18, 2022Comments
-
RabT almost 2 years
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-
Amitav Pajni almost 9 yearsTry using
nmtui
to configure a wireless connection. -
RabT almost 9 years@yagmoth555 a development server.
-
Pavel Šimerda over 7 yearsIf 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.
-
-
RabT almost 9 yearsThank 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 bySCP
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? -
Tim S. almost 9 yearsCentOS 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.
-
RabT almost 9 yearsA 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?
-
slm almost 9 yearsWhilst 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.
-
Tim S. almost 9 yearsUpdated my answer with the instructions for configuration and a download link, along with the original URL.
-
RabT almost 9 yearsI cannot evaluate the steps from your answer, because downloading the
rpm
files is a complicated process that requires elaboration. It is much more complicated than simply downloading the one rpm file in the link from your OP. I posted the download and install problem as a separate question, which can be read at the following link: unix.stackexchange.com/questions/229895/… -
Tim S. almost 9 yearsSo I read the post. Instead of installing with rpm, try "yum localinstall <rpm name>". It should automatically take care of the dependencies for you, providing that they are available in your repos. I never install rpm's manually with the rpm tool, because it can confuse the yum database.
-
RabT almost 9 yearsThe problem is that I do not know which rpm files to download, or where to download them from. Also, I do not have a local repository set up, so I would have to know how to set up a local repository with the correct rpm files downloaded from the correct locations. As it stands, when I type
yum localinstall wpa_supplicant-2.4-4.2.x86_64.rpm
, the terminal replies withLoaded plugins: fastestmirror. Cannot open: wpa_supplicant-2.4-4.2.x86_64.rpm. Skipping. Nothing to do
. Are you willing to provide explicit instructions? -
Pavel Šimerda over 8 yearsI do not think it is practical for a beginner to experiment with lower level tools like
wpa_supplicant
instead of simply learning the tools that are in the default installation. -
Tim S. over 8 yearsThere is no experimentation, but since you provided an answer, I have no complaints. The instructions for downloading, installing, and configuring wpa_supplicant are pretty clear, but either way it does not matter if the job is done.
-
RabT over 7 yearsMay 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