Configuring and Administering Network Components in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

How to Connect to a WiFi Network

Before You Begin

Perform the following steps to connect your notebook PC to a WiFi network.

  1. Become an administrator.
  2. 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      ath0
    net1            Ethernet             up       1500   full      e1000g0

    In the previous example, the output indicates that two links are available. net0 over the device ath0 link supports WiFi communications. The e1000g0 link enables you to connect the system to a wired network.

  3. Configure the WiFi interface.
    1. Create the interface that supports WiFi. For example:
      # ipadm create-ip net0
    2. Verify that the link has been plumbed.
      # ipadm show-if
      IFNAME      CLASS        STATE     ACTIVE     OVER
      lo0         loopback     ok        yes        --
      net0        ip           ok        yes        --
  4. Check for available networks.
    # dladm scan-wifi
    LINK       ESSID        BSSID/IBSSID       SEC     STRENGTH   MODE   SPEED
    net0       ofc          00:0e:38:49:01:d0  none     good       g      54Mb
    net0       home         00:0e:38:49:02:f0  none     very weak  g      54Mb
    net0       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

    Refers to the link name to be used in the WiFi connection.

    ESSID

    Refers to the 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

    Refers to the 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

    Refers to the type of security that is required to access the wireless network. The values are none, WEP, 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

    Refers to the 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.

  5. Connect to a WiFi network by using either of the following methods:
    • Connect to an unsecured WiFi network with the strongest signal.
      # dladm connect-wifi
    • Connect to an unsecured network by specifying its ESSID.
      # dladm connect-wifi -e ESSID

      For more information about using the dladm connect-wifi command, see Establishing Secure WiFi Communications and the dladm (1M) man page.

  6. Check the status of the WiFi network to which the system is connected as follows:
    # dladm show-wifi
    LINK       STATUS        ESSID       SEC     STRENGTH   MODE   SPEED
    net0       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 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.

  7. 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

      If the WiFi network does not support DHCP, the following message is displayed:

      ipadm: interface: interface does not exist or cannot be managed using DHCP
    • Configure a static IP address.
      # ipadm create-addr -a address interface

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

  8. Access the Internet through the WiFi network in one of the following ways:
    • If the access point offers free service, you can run a browser or any application of your choice.
    • If the access point is on a commercial WiFi network that requires a fee, follow the instructions that are provided at that location.

      Typically, you need to supply a key and a payment method for this option.

  9. End the session in one of the following ways:
    • Terminate the WiFi session but leave the system running.
      # dladm disconnect-wifi 
    • Terminate a particular WiFi session when more than one session is currently running.
      # dladm disconnect-wifi link

      where link represents the interface that is being used for the session.

    • Cleanly shut down the system while the WiFi session is running.
      # shutdown -g0 -i5

      You do not need to explicitly disconnect the WiFi session prior to shutting down the system.

Example 7-1  Connecting to a Specific WiFi Network

The following example combines the different steps that you would 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 you have the static IP address 10.192.16.3/24 assigned for use on your notebook PC.

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

# ipadm create-ip net0
# ipadm show-if net0
IFNAME      CLASS        STATE     ACTIVE     OVER
lo0         loopback     ok        yes        --
net0        ip           ok        yes        --

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

# dladm connect-wifi -e citinet
# dladm show-wifi
LINK       STATUS        ESSID         SEC     STRENGTH   MODE   SPEED
net0       connected     citinet       none    good       g      11Mb

# ipadm create-addr -a 10.192.16.3/24 net0
ipadm: net0/v4
# ipadm show-addr net0
ADDROBJ           TYPE     STATE        ADDR
net0/v4           static   ok           10.192.16.3/24

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

# firefox

Terminate the session but leave the PC running.

# dladm disconnect-wifi
# dladm show-wifi
LINK       STATUS        ESSID         SEC     STRENGTH   MODE   SPEED
net0       disconnected   --            --       --       --       --

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