Before You Begin
Perform the following steps to connect your notebook PC to a WiFi network.
# 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.
# ipadm create-ip net0
# ipadm show-if 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 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:
Refers to the link name to be used in the WiFi connection.
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.
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.
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.
Refers to the strength of the radio signals from the WiFi networks that are available at your location.
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.
Refers to the speed (in megabits per second) of the particular network.
# dladm connect-wifi
# 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.
# 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.
# 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
# ipadm create-addr -a address interface
Use this option if you have a dedicated IP address for the system.
Typically, you need to supply a key and a payment method for this option.
# dladm disconnect-wifi
# dladm disconnect-wifi link
where link represents the interface that is being used for the session.
# shutdown -g0 -i5
You do not need to explicitly disconnect the WiFi session prior to shutting down the system.
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.