Go to main content

Configuring and Managing Network Components in Oracle® Solaris 11.4

Exit Print View

Updated: January 2019
 
 

How to Connect to a WiFi Network

Before You Begin

Ensure that your role has the appropriate rights profile to perform this procedure. See Using Rights Profiles to Perform Network Configuration.

  1. Display the physical attributes of the datalinks that are on the system.
    $ dladm show-phys
    LINK            MEDIA                STATE    SPEED  DUPLEX    DEVICE
    net0            Ethernet             up       1500   full      e1000g0
    net1            WiFi               down       1500   full      ath0

    The output indicates that two links are available. net0 over the device e1000g0, which supports wired communications and net1 over the device ath0, which enables you to connect to a wireless network.

  2. Configure the WiFi interface.
    1. Create the interface that supports WiFi.
      $ ipadm create-ip net1
    2. Verify that the link has been plumbed.
      $ ipadm show-if
      IFNAME      CLASS        STATE     ACTIVE     OVER
      lo0         loopback     ok        yes        --
      net1        ip           ok        yes        --
  3. Check for available networks.
    $ dladm scan-wifi
    LINK       ESSID        BSSID/IBSSID       SEC     STRENGTH   MODE   SPEED
    net1       ofc          00:0e:38:49:01:d0  none     good       g      54Mb
    net1       home         00:0e:38:49:02:f0  none     very weak  g      54Mb
    net1       linksys      00:0d:ed:a5:47:e0  none     very good  g      54Mb
    

    The scan-wifi command displays information about the available WiFi networks at the current location. The output includes the following information:

    LINK

    Link name to be used in the WiFi connection.

    ESSID

    Extended Service Set ID. The ESSID is the name of the WiFi network, which can be randomly named by the administrator of the specific wireless network.

    BSSID/IBSSID

    Basic Service Set ID (BSSID), which is a unique identifier for a particular ESSID. The BSSID is the 48-bit MAC address of the nearby access point that serves the network with a particular ESSID.

    SEC

    Type of security that is required to access the wireless network. The values are none and WPA. For more information, see Establishing Secure WiFi Communications.

    STRENGTH

    Refers to the strength of the radio signals from the WiFi networks that are available at your location.

    MODE

    Version of the 802.11 protocol that is run by the network. The modes are a, b, and g, or any combination of these modes.

    SPEED

    Refers to the speed (in megabits per second) of the particular network.

  4. Connect to a WiFi network.
    $ dladm connect-wifi [-e ESSID] 

    If a connection is established, a Known WLAN is created. See Administering Known WLANs for more details about Known WLANs.


    Note -  Successfully connecting to a WiFi network creates a Known WLAN. See Administering Known WLANs for more details about Known WLANs.

    For more information about using the dladm connect-wifi command, see Establishing Secure WiFi Communications. See also the dladm(8) man page.

  5. Check the status of the WiFi network to which the system is connected.
    $ dladm show-wifi
    LINK       STATUS        ESSID       SEC     STRENGTH   MODE   SPEED
    net1       connected     ofc         none    very good   g      36Mb

    The previous output indicates that the system is connected to the ofc network. The scan-wifi output from Step 3Step 4 of this procedure indicated that ofc had the strongest signal of the available networks. The dladm connect-wifi command automatically chooses the WiFi network with the strongest signal, unless you explicitly specify a different wireless network.

  6. Configure an IP address for the interface by using either of the following methods:
    • Obtain an IP address from a DHCP server.
      $ ipadm create-addr -T dhcp interface
    • Configure a static IP address.
      $ ipadm create-addr -a address interface

      Use this option if you have a dedicated IP address for the system.

  7. Access the Internet through the WiFi network.
  8. To end the session, use either the dladm disconnect-wifi command or shut down the system.
Example 20  Connecting to a Specific WiFi Network

The following example combines the different steps that you can take to connect your Oracle Solaris system to a wireless network. The example also shows how you can force the system to connect to a specific and preferred wireless network instead of allowing the OS to randomly select the wireless network. In the following example, assume that the static IP address 203.0.113.3/24 is assigned for use on the system.

$ dladm show-phys
LINK            MEDIA                STATE    SPEED  DUPLEX    DEVICE
net0            Ethernet             up       1500   full      e1000g0
net1            Wifi               down       1500   full      ath0

$ ipadm create-ip net1
$ ipadm show-if net1
IFNAME      CLASS        STATE     ACTIVE     OVER
net1        ip           ok        yes        --

$ dladm scan-wifi
LINK       ESSID        BSSID/IBSSID       SEC     STRENGTH   MODE   SPEED
net1       wifi-a       00:0e:38:49:01:d0  none     weak       g      54Mb
net1       wifi-b       00:0e:38:49:02:f0  none     very weak  g      54Mb
net1       ofc          00:0d:ed:a5:47:e0  none     very good  g      54Mb
net1       mynet        00:40:96:2a:56:b5  none     good       b      11Mb

$ dladm connect-wifi -e mynet
$ dladm show-wifi
LINK       STATUS        ESSID         SEC     STRENGTH   MODE   SPEED
net1       connected     mynet         none    good       g      11Mb

$ ipadm create-addr -a 203.0.113.3/24 net0
ipadm: net1/v4
$ ipadm show-addr net0
ADDROBJ           TYPE     STATE        ADDR
net1/v4           static   ok           203.0.113.3/24

Launch a browser or another application to commence your work over the WiFi network.

Terminate the session but leave the system running.

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

The output of the show-wifi command verifies that you have disconnected the net1 link from the WiFi network.