Connecting to a WLAN access point

This step shows how to establish a WLAN connection with an access point under Beckhoff RT Linux®. In addition, you will learn how to search for WLAN networks and determine the SSID.

Prerequisites:

Proceed as follows:

1. A ready-made sample configuration for WLAN networks is stored on the system at /usr/lib/systemd/network/80-wifi-station.network.example, which you can use. Copy the sample configuration from the directory to the appropriate folder.

sudo ln -s /usr/lib/systemd/network/80-wifi-station.network.example /etc/systemd/network/80-wifi-station.network
2. Reload the configuration.
sudo networkctl reload
3. Check the configuration and display the available WLAN devices.
sudo iwctl device list
4. The output looks as follows. The name of the WLAN device is also displayed here.
                             Devices
--------------------------------------------------------------------------------
  Name              Address             Powered      Adapter      Mode
--------------------------------------------------------------------------------
  wlx34c9f09ab29c   34:c9:f0:9a:b2:9c   on           phy0         station
5. Use the following command to search for available WLAN networks nearby.
sudo iwctl station wlx34c9f09ab29c get-networks
6. The availability of WLAN networks is displayed as follows:
                                 Available networks
--------------------------------------------------------------------------------
      Network name                     Security            Signal
--------------------------------------------------------------------------------
  >   COMPANY_Guest                    psk                  ****
      cx_pc                            8021x                ****
      testssid6015                     psk                  ****
      testssid                         psk                  ****
      BCS-DE-Verl-T5152                psk                  ****
7. Establish a connection to open WLAN networks with the following command. For SSID, enter the appropriate name for the WLAN network you want to connect to.
sudo iwctl station wlx34c9f09ab29c connect <SSID>
8. Establish a connection to a WPA2-protected WLAN with the following command.
sudo iwctl --passphrase <SSID_password> station wlx34c9f09ab29c connect <SSID>
9. Use ip addr show to check whether the WLAN connection has been established and an IP address has been assigned:
ip addr show
10. The output for the WLAN device wlx34c9f09ab29c in this example is as follows:
4: wlx34c9f09ab29c: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 34:c9:f0:9a:b2:9c brd ff:ff:ff:ff:ff:ff
    inet 172.21.180.77/19 metric 1024 brd 172.21.191.255 scope global dynamic wlx34c9f09ab29c
       valid_lft 3598sec preferred_lft 3598sec
    inet6 fe80::36c9:f0ff:fe9a:b29c/64 scope link proto kernel_ll
       valid_lft forever preferred_lft forever