Menu Close
Chapter 7. Managing Wi-Fi connections
This section describes how to configure and manage Wi-Fi connections.
7.1. Setting the wireless regulatory domain
In Red Hat Enterprise Linux, the crda package contains the Central Regulatory Domain Agent that provides the kernel with the wireless regulatory rules for a given jurisdiction. It is used by certain udev scripts and should not be run manually unless debugging udev scripts. The kernel runs crda by sending a udev event upon a new regulatory domain change. Regulatory domain changes are triggered by the Linux wireless subsystem (IEEE-802.11). This subsystem uses the regulatory.bin
file to keep its regulatory database information.
The setregdomain
utility sets the regulatory domain for your system. Setregdomain
takes no arguments and is usually called through system script such as udev rather than manually by the administrator. If a country code look-up fails, the system administrator can define the COUNTRY
environment variable in the /etc/sysconfig/regdomain
file.
Additional resources
-
setregdomain(1)
man page -
crda(8)
man page -
regulatory.bin(5)
man page -
iw(8)
man page
7.2. Configuring a Wi-Fi connection using nmcli
This procedure describes how to configure a Wi-fi connection profile using nmcli.
Prerequisites
- The nmcli utility to be installed.
Make sure that the WiFi radio is on (default):
$ nmcli radio wifi on
Procedure
To create a Wi-Fi connection profile with static
IP
configuration:$ nmcli con add con-name MyCafe ifname wlan0 type wifi ssid MyCafe ip4 192.0.2.101/24 gw4 192.0.2.1
Set a DNS server. For example, to set
192.0.2.1
as the DNS server:$ nmcli con modify con-name MyCafe ipv4.dns "192.0.2.1"
Optionally, set a DNS search domain. For example, to set the search domain to
example.com
:$ nmcli con modify con-name MyCafe ipv4.dns-search "example.com"
To check a specific property, for example
mtu
:$ nmcli connection show id MyCafe | grep mtu 802-11-wireless.mtu: auto
To change the property of a setting:
$ nmcli connection modify id MyCafe wireless.mtu 1350
To verify the change:
$ nmcli connection show id MyCafe | grep mtu 802-11-wireless.mtu: 1350
Verification steps
Use the
ping
utility to verify that this host can send packets to other hosts.Ping an IP address in the same subnet. For example:
# ping 192.0.2.103
If the command fails, verify the IP and subnet settings.
Ping an IP address in a remote subnet. For example:
# ping 198.51.16.3
If the command fails, ping the default gateway to verify settings.
# ping 192.0.2.1
Use the
host
utility to verify that name resolution works. For example:# host client.example.com
If the command returns any error, such as
connection timed out
orno servers could be reached
, verify your DNS settings.
Additional resources
-
nm-settings(5)
man page - NetworkManager duplicates a connection after restart of NetworkManager service.
7.3. Configuring a Wi-Fi connection using control-center
When you connect to a Wi-Fi
, the network settings are prefilled depending on the current network connection. This means that the settings will be detected automatically when the interface connects to a network.
This procedure describes how to use control-center to manually configure the Wi-Fi
settings.
Procedure
-
Press the Super key to enter the
Activities Overview
, typeWi-Fi
and press Enter. In the left-hand-side menu entry you see the list of available networks. Select the gear wheel icon to the right of the
Wi-Fi
connection name that you want to edit, and the editing connection dialog appears. The Details menu window shows the connection details where you can make further configuration.Options
-
If you select
Connect automatically
, NetworkManager auto-connects to this connection whenever NetworkManager detects that it is available. If you do not want NetworkManager to connect automatically, clear the check box. Note that when the check box is clear, you have to select that connection manually in the network connection icon’s menu to cause it to connect. -
To make a connection available to other users, select the
Make available to other users
check box. You can also control the background data usage by changing the
Restrict background data usage
option.NoteTo delete a
Wi-Fi
connection, click theForget Connection
red box.
-
If you select
Select the Identity menu entry to see the basic configuration options.
SSID
— The Service Set Identifier (SSID) of the access point (AP).BSSID
— The Basic Service Set Identifier (BSSID) is the MAC address, also known as a hardware address, of the specific wireless access point you are connecting to when inInfrastructure
mode. This field is blank by default, and you are able to connect to a wireless access point bySSID
without having to specify itsBSSID
. If the BSSID is specified, it will force the system to associate to a specific access point only. For ad-hoc networks, theBSSID
is generated randomly by the mac80211 subsystem when the ad-hoc network is created. It is not displayed by NetworkManager.MAC address
— The MAC address allows you to associate a specific wireless adapter with a specific connection (or connections).Cloned Address
— A cloned MAC address to use in place of the real hardware address. Leave blank unless required.For further IP address configuration , select the IPv4 and IPv6 menu entries.
By default, both
IPv4
andIPv6
are set to automatic configuration depending on current network settings. This means that addresses such as the local IP address, DNS address, and other settings will be detected automatically when the interface connects to a network. If a DHCP server assigns the IP configuration in this network, this is sufficient, but you can also provide static configuration in theIPv4
andIPv6
Settings. In the IPv4 and IPv6 menu entries, you can see the following settings:IPv4 Method
-
Automatic (DHCP)
— Choose this option if the network you are connecting to uses Router Advertisements (RA) or aDHCP
server to assign dynamic IP addresses. You can see the assigned IP address in the Details menu entry. -
Link-Local Only
— Choose this option if the network you are connecting to does not have aDHCP
server and you do not want to assign IP addresses manually. Random addresses will be assigned as per RFC 3927 with prefix169.254/16
. -
Manual
— Choose this option if you want to assign IP addresses manually. -
Disable
—IPv4
is disabled for this connection.
-
DNS
If
Automatic
isON
, and no DHCP server is available that assigns DNS servers to this connection, switch it toOFF
to enter the IP address of a DNS server separating the IPs by comma.Routes
Note that in the
Routes
section, whenAutomatic
isON
, routes from Router Advertisements (RA) or DHCP are used, but you can also add additional static routes. WhenOFF
, only static routes are used.-
Address
— Enter theIP
address of a remote network, sub-net, or host. -
Netmask
— The netmask or prefix length of the IP address entered above. -
Gateway
— The IP address of the gateway leading to the remote network, sub-net, or host entered above. -
Metric
— A network cost, a preference value to give to this route. Lower values will be preferred over higher values.
-
Use this connection only for resources on its network
Select this check box to prevent the connection from becoming the default route.
Alternatively, to configure
IPv6
settings in aWi-Fi
connection, select the IPv6 menu entry:IPv6 Method
-
Automatic
— Choose this option to useIPv6
Stateless Address AutoConfiguration (SLAAC) to create an automatic, stateless configuration based on the hardware address and Router Advertisements (RA). -
Automatic, DHCP only
— Choose this option to not use RA, but request information fromDHCPv6
directly to create a stateful configuration. -
Link-Local Only
— Choose this option if the network you are connecting to does not have aDHCP
server and you do not want to assign IP addresses manually. Random addresses will be assigned as per RFC 4862 with prefixFE80::0
. -
Manual
— Choose this option if you want to assign IP addresses manually. -
Disable
—IPv6
is disabled for this connection.
-
-
The
DNS
,Routes
,Use this connection only for resources on its network
fields are common toIPv4
settings.
To configure
Security
settings in aWi-Fi
connection, select the Security menu entry.WarningDo not connect to Wi-Fi networks without encryption or which support only the insecure WEP or WPA standards.
The following configuration options are available:
Security
-
None
— Encryption is disabled, and data is transferred in plain text over the network. -
WEP 40/128-bit Key
— Wired Equivalent Privacy (WEP), from the IEEE 802.11 standard. Uses a single pre-shared key (PSK). -
WEP 128-bit Passphrase
— An MD5 hash of the passphrase to derive a WEP key. -
Dynamic WEP (802.1X)
— WEP keys are changed dynamically. -
LEAP
— Lightweight Extensible Authentication Protocol, from Cisco Systems. -
WPA & WPA2 Personal
— Wi-Fi Protected Access (WPA), from the draft IEEE 802.11i standard. Wi-Fi Protected Access 2 (WPA2), from the 802.11i-2004 standard. Personal mode uses a pre-shared key (WPA-PSK). -
WPA & WPA2 Enterprise
— WPA and WPA 2 for use with a RADIUS authentication server to provide IEEE 802.1X network access control. -
WPA3 Personal
— Wi-Fi Protected Access 3 (WPA3) Personal uses Simultaneous Authentication of Equals (SAE) instead of pre-shared keys (PSK) to prevent dictionary attacks. WPA3 uses perfect forward secrecy.
-
- Password — Enter the password to be used in the authentication process.
- Once you have finished the configuration, click the Apply button to save it.
When you add a new connection by clicking the plus button, NetworkManager creates a new configuration file for that connection and then opens the same dialog that is used for editing an existing connection. The difference between these dialogs is that an existing connection profile has a Details menu entry.
7.4. Connecting to a Wi-Fi network with nmcli
This procedure describes how to connect to a wireless
connection using the nmcli utility.
Prerequisites
- The nmcli utility to be installed.
Make sure that the WiFi radio is on (default):
$ nmcli radio wifi on
Procedure
To refresh the available Wi-Fi connection list:
$ nmcli device wifi rescan
To view the available Wi-Fi access points:
$ nmcli dev wifi list IN-USE SSID MODE CHAN RATE SIGNAL BARS SECURITY ... MyCafe Infra 3 405 Mbit/s 85 ▂▄▆█ WPA1 WPA2
To connect to a Wi-Fi connection using nmcli:
$ nmcli dev wifi connect SSID-Name password wireless-password
For example:
$ nmcli dev wifi connect MyCafe password wireless-password
Note that if you want to disable the Wi-Fi state:
$ nmcli radio wifi off
7.5. Connecting to a hidden Wi-Fi network using nmcli
All access points have a Service Set Identifier (SSID) to identify them. However, an access point may be configured not to broadcast its SSID, in which case it is hidden, and will not show up in NetworkManager’s list of Available networks.
This procedure shows how you can connect to a hidden network using the nmcli tool.
Prerequisites
- The nmcli utility to be installed.
-
To know the SSID, and password of the
Wi-Fi
connection. Make sure that the WiFi radio is on (default):
$ nmcli radio wifi on
Procedure
Connect to the SSID that is hidden:
$ nmcli dev wifi connect SSID_Name password wireless_password hidden yes
7.6. Connecting to a Wi-Fi network using the GNOME GUI
This procedure describes how you can connect to a wireless network to get access to the Internet.
Procedure
- Open the GNOME Shell network connection icon menu from the top right-hand corner of the screen.
-
Select
Wi-Fi Not Connected
. -
Click the
Select Network
option. Click the name of the network to which you want to connect, and then click
Connect
.Note that if you do not see the network, the network might be hidden.
If the network is protected by a password or encryption keys are required, enter the password and click
Connect
.Note that if you do not know the password, contact the administrator of the Wi-Fi network.
- If the connection is successful, the name of the network is visible in the connection icon menu and the wireless indicator is on the top right-hand corner of the screen.
Additional resources
7.7. Configuring 802.1X network authentication on an existing Wi-Fi connection using nmcli
Using the nmcli
utility, you can configure the client to authenticate itself to the network. This procedure describes how to configure Protected Extensible Authentication Protocol (PEAP) authentication with the Microsoft Challenge-Handshake Authentication Protocol version 2 (MSCHAPv2) in an existing NetworkManager Wi-Fi connection profile named wlp1s0
.
Prerequisites
- The network must have 802.1X network authentication.
- The Wi-Fi connection profile exists in NetworkManager and has a valid IP configuration.
-
If the client is required to verify the certificate of the authenticator, the Certificate Authority (CA) certificate must be stored in the
/etc/pki/ca-trust/source/anchors/
directory. -
The
wpa_supplicant
package is installed.
Procedure
Set the Wi-Fi security mode to
wpa-eap
, the Extensible Authentication Protocol (EAP) topeap
, the inner authentication protocol tomschapv2
, and the user name:# nmcli connection modify wpl1s0 wireless-security.key-mgmt wpa-eap 802-1x.eap peap 802-1x.phase2-auth mschapv2 802-1x.identity user_name
Note that you must set the
wireless-security.key-mgmt
,802-1x.eap
,802-1x.phase2-auth
, and802-1x.identity
parameters in a single command.Optionally, store the password in the configuration:
# nmcli connection modify wpl1s0 802-1x.password password
ImportantBy default, NetworkManager stores the password in clear text in the
/etc/sysconfig/network-scripts/keys-connection_name
file, that is readable only by theroot
user. However, clear text passwords in a configuration file can be a security risk.To increase the security, set the
802-1x.password-flags
parameter to0x1
. With this setting, on servers with the GNOME desktop environment or thenm-applet
running, NetworkManager retrieves the password from these services. In other cases, NetworkManager prompts for the password.If the client is required to verify the certificate of the authenticator, set the
802-1x.ca-cert
parameter in the connection profile to the path of the CA certificate:# nmcli connection modify wpl1s0 802-1x.ca-cert /etc/pki/ca-trust/source/anchors/ca.crt
NoteFor security reasons, Red Hat recommends using the certificate of the authenticator to enable clients to validate the identity of the authenticator.
Activate the connection profile:
# nmcli connection up wpl1s0
Verification steps
- Access resources on the network that require network authentication.
Additional resources
- Managing Wi-Fi connections
-
The
802-1x settings
section in thenm-settings(5)
man page -
nmcli(1)
man page