Chapter 9. Managing Wi-Fi connections
This section describes how to configure and manage Wi-Fi connections.
9.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
See the following man pages for more information about the regulatory domain:
-
setregdomain(1)
man page — Sets regulatory domain based on country code. -
crda(8)
man page — Sends to the kernel a wireless regulatory domain for a given ISO or IEC 3166 alpha2. -
regulatory.bin(5)
man page — Shows the Linux wireless regulatory database. -
iw(8)
man page — Shows or manipulates wireless devices and their configuration.
9.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.168.100.101/24 gw4 192.168.100.1
Set a DNS server. For example, to set
192.160.100.1
as the DNS server:~]$
nmcli con modify con-name MyCafe ipv4.dns "192.160.100.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: autoTo change the property of a setting:
~]$
nmcli connection modify id MyCafe 802-11-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.168.100.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.168.100.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
-
See the
nm-settings(5)
man page for more information on properties and their settings. - If the configuration on the disk does not match the configuration on the device, starting or restarting NetworkManager creates an in-memory connection that reflects the configuration of the device. For further details and how to avoid this problem, see NetworkManager duplicates a connection after restart of NetworkManager service.
9.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. If you leave
Restrict background data usage
unspecified (default), then NetworkManager tries to download data that you are actively using. Otherwise, select the check box and NetworkManager sets the connection as metered, and applies restriction on the background data usage.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 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. The following configuration options are available:Security
-
None
— Do not encrypt the Wi-Fi connection. -
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.WarningIf the
Wi-Fi
use no encryption,WEP
, orWPA
, do not use the network because it is insecure and everyone can read the data you send over this network.-
LEAP
— Lightweight Extensible Authentication Protocol, from Cisco Systems. -
Dynamic WEP (802.1X)
— WEP keys are changed dynamically. -
WPA & WPA2 Personal
— Wi-Fi Protected Access (WPA), from the draft IEEE 802.11i standard. A replacement for WEP. Wi-Fi Protected Access II (WPA2), from the 802.11i-2004 standard. Personal mode uses a pre-shared key (WPA-PSK). -
WPA & WPA2 Enterprise
— WPA for use with a RADIUS authentication server to provide IEEE 802.1X network access control.
-
- Password — Enter the password to be used in the authentication process.
- Once you have finished the configuration, click the button to save it.
When you add a new connection by clicking the 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.
button,9.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 WPA2To 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
9.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