Go to main content

Configuring and Managing Network Components in Oracle® Solaris 11.4

Exit Print View

Updated: February 2022
 
 

Administering Known WLANs

This selection discusses different topics about wide local area networks.

About Known WLANs

You use Known WLANs to manage wireless networks that are known to the system. Usually, these are wireless networks that the system has connected to previously. Additionally, you can also manually create Known WLANs. The system then maintains a list of these known wireless networks. A Known WLAN stores the priority of that wireless network, as well as the any password or key that might be associated with that wireless network. You create this key by using the dladm create-secobj subcommand.

Creating and Administering Known WLANs

In this Oracle Solaris release, you configure and administer known WLANs by using the dladm command. See the dladm(8) man page.

Creating a Known WLAN

Use the following command syntax:

$ dladm create-wlan wlan-name

Whenever you connect to a WiFi network from your notebook PC, a Known WLAN is automatically created as soon as the dladm connect-wifi command succeeds. Properties for the Known WLAN are also set at that time.

To connect to a wireless network in the Known WLANs list, use the dladm connect-wifi command with the –w option as follows:

$ dladm connect-wifi -w

Running this command connects to the available wireless network in the Known WLAN list that has the highest priority. If the wireless network requires a key, you do not have to provide it. The key information from the Known WLAN is used to connect to that wireless network.

For more information about manually connecting to a WiFi network and switching WiFi networks, see How to Connect to a WiFi Network.

Displaying Configuration Information for a Known WLAN

Use the following command syntax:

$ dladm show-wlan wlan-name

To include BSSID information in the output, include the –o all option with the show-wlan subcommand.

$ dladm show-wlan -o all wlan-name
Example 22  Creating and Displaying Known WLANs

The following example shows how to create a Known WLAN named home-wifi.

$ dladm create-wlan home-wifi

Display configuration information about the Known WLAN as follows:

$ dladm show-wlan
ESSID               PRIORITY  SECURITY-MODE   KEY
home-wifi           0         --              --
office-wifi         2         --              --

Display BSSID information for the Known WLAN as follows:

$ dladm show-wlan -o all
ESSID               PRIORITY  BSSIDS                  SECURITY-MODE   KEY
home-wifi           0         --                      --              --
office-wifi         2         --                      --              --

Setting Properties for a Known WLAN

Use the following command syntax:

$ dladm set-wlan -p property=value1[,...] wlan-name

Note that property values are comma separated.

Example 23  Setting the Priority for a Known WLAN

By default, Known WLANs are assigned the highest priority 0 when created. The following example shows how to change the priority for a Known WLAN named home-wifi to 1. For more information, see About Known WLANs.

$ dladm set-wlan -p priority=1 home-wifi
Example 24  Setting the Security Mode and Adding a WPA Security Key for a Known WLAN

The following example shows how to change the security mode for a Known WLAN (home-wifi) to WPA and also how to add a security key. Note that you must create the key name prior to setting this property value for a Known WLAN.

Type the following command to check that the key name has been created:

$ dladm show-secobj
OBJECT                  CLASS
home-key                  wpa

Set the security-mode and key properties as follows:

$ dladm set-wlan -p security-mode=wpa,key=home-key home-wifi
$ dladm show-wlan -o all
ESSID               PRIORITY  BSSIDS                  SECURITY-MODE   KEY
home-wifi           1         a:b:c:d:e:f,f:e:d:c:b:a wpa             home-key
office-wifi         2         -                      --              --
Example 25  Setting Multiple BSSIDs for a Known WLAN

The following example shows how to set multiple BSSIDs for a Known WLAN, home-wifi. Note that each BSSID is separated by a comma.

$ dladm set-wlan -p bssids=a:b:c:d:e:f,f:e:d:c:b:a home-wifi
$ dladm show-wlan -o all
ESSID               PRIORITY  BSSIDS                  SECURITY-MODE   KEY
home-wifi           1         a:b:c:d:e:f,f:e:d:c:b:a wpa             home-key
office-wifi.....    2..       --..                    --              --
Example 26  Resetting Property Values for a Known WLAN

You can reset property values for a Known WLAN by using the reset-wlan subcommand. This command resets the specified property value back to its original, default value. The following example shows how to reset the security-mode and key property values for the home-wifi WLAN back to the default values.

$ dladm show-wlan
ESSID               PRIORITY  SECURITY-MODE   KEY
home-wifi           1         wpa             home-key
office-wifi.....    2..       --..            --

$ dladm reset-wlan -p security-mode,key home-wifi
$ dladm show-wlan
ESSID               PRIORITY  SECURITY-MODE   KEY
home-wifi           1         --              --
office-wifi.....    2..       --..            --

Deleting a Known WLAN

Use the following command syntax:

$ dladm delete-wlan wlan-name

For example, you would delete a Known WLAN named home-wifi as follows:

$ dladm delete-wlan home-wifi
Example 27  Deleting a Known WLAN by Using the dladm disconnect-wifi Command

You can also delete a known WLAN by using disconnect-wifi subcommand with the –d option, as shown in the following example.

$ dladm disconnect-wifi -d link
$ dladm show-wifi
LINK       STATUS        ESSID         SEC     STRENGTH   MODE   SPEED
net1       disconnected   --            --       --       --       --

where link represents the interface that was used to configure the Known WLAN.

Managing Known WLAN Behavior at Boot Time

When you boot your system, the nwamd daemon automatically connects to the available wireless network in the Known WLAN list with the highest priority. The daemon also monitors the network, and if it detects a dropped connection, the daemon reconnects to the network. This feature is controlled by the auto-connect link property for each link that is on a system. The resulting behavior is that the nwamd daemon does not automatically connect to a wireless network. To connect to a wireless network, you must do so manually by using the dladm connect-wifi command. You can specify the –w option with the command to connect to the available wireless network in the Known WLAN list with the highest priority. When a connection is established, the nwamd daemon monitors that connection and will reconnect if a disconnect is detected.

By default, the auto-connect property is set to on. However, you can turn this feature off by using the set-linkprop subcommand of dladm command as follows:

$ dladm set-linkprop -p auto-connect=off link