[Novalug] tool for wireless

Peter Larsen peter@peterlarsen.org
Tue Dec 13 11:42:05 EST 2016


On 12/13/2016 07:27 AM, Walt Smith via Novalug wrote:
>
> What tool is used for wireless to 
> issue commands and collect status/data ?

$ nmcli d wifi list
*  SSID           MODE   CHAN  RATE       SIGNAL  BARS  SECURITY 
*  xxxxxx          Infra  1     54 Mbit/s  86      ▂▄▆█  WPA1 WPA2
   --             Infra  7     54 Mbit/s  37      ▂▄__  WPA1 WPA2
   HOME-B4C1-2.4  Infra  6     54 Mbit/s  35      ▂▄__  WPA1 WPA2
   HOME-1478-2.4  Infra  6     54 Mbit/s  32      ▂▄__  WPA1 WPA2
   --             Infra  7     54 Mbit/s  32      ▂▄__  WPA1 WPA2
   xfinitywifi    Infra  5     54 Mbit/s  27      ▂___           
   VIZIO HD       Infra  161   54 Mbit/s  27      ▂___  WPA1 WPA2
   xfinitywifi    Infra  11    54 Mbit/s  25      ▂___           

As always help is near;
$ nmcli d wifi help
Usage: nmcli device wifi { ARGUMENTS | help }

Perform operation on Wi-Fi devices.

ARGUMENTS := [list [ifname <ifname>] [bssid <BSSID>]]

List available Wi-Fi access points. The 'ifname' and 'bssid' options can be
used to list APs for a particular interface, or with a specific BSSID.

ARGUMENTS := connect <(B)SSID> [password <password>] [wep-key-type
key|phrase] [ifname <ifname>]
                    [bssid <BSSID>] [name <name>] [private yes|no]
[hidden yes|no]

Connect to a Wi-Fi network specified by SSID or BSSID. The command creates
a new connection and then activates it on a device. This is a command-line
counterpart of clicking an SSID in a GUI client. The command always creates
a new connection and thus it is mainly useful for connecting to new Wi-Fi
networks. If a connection for the network already exists, it is better to
bring up the existing profile as follows: nmcli con up id <name>. Note that
only open, WEP and WPA-PSK networks are supported at the moment. It is also
assumed that IP configuration is obtained via DHCP.

ARGUMENTS := wifi hotspot [ifname <ifname>] [con-name <name>] [ssid <SSID>]
                          [band a|bg] [channel <channel>] [password
<password>]

Create a Wi-Fi hotspot. Use 'connection down' or 'device disconnect'
to stop the hotspot.
Parameters of the hotspot can be influenced by the optional parameters:
ifname - Wi-Fi device to use
con-name - name of the created hotspot connection profile
ssid - SSID of the hotspot
band - Wi-Fi band to use
channel - Wi-Fi channel to use
password - password to use for the hotspot

ARGUMENTS := rescan [ifname <ifname>] [[ssid <SSID to scan>] ...]

Request that NetworkManager immediately re-scan for available access points.
NetworkManager scans Wi-Fi networks periodically, but in some cases it might
be useful to start scanning manually. 'ssid' allows scanning for a specific
SSID, which is useful for APs with hidden SSIDs. More 'ssid' parameters
can be
given. Note that this command does not show the APs,
use 'nmcli device wifi list' for that.

=====

And of course you have the GUI component in the DE that also interfaces
to NetworkManager and shows the same data.

> initially it seems "iw" works for a PCI wireless 
> card I have ( the radio is crap but I can get at data )
> It's called wlan3.

iw works - but it's pretty deep and volatile. Ie. changes are not saved etc.

Examples:

$ iw dev
phy#0
    Unnamed/non-netdev interface
        wdev 0x8
        addr 4c:eb:42:c7:bc:ae
        type P2P-device
    Interface wlp3s0
        ifindex 3
        wdev 0x1
        addr 4c:eb:42:c7:bc:ad
        type managed
        channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz

$ iw dev wlp3s0 link
Connected to c2:9f:db:f7:fb:f2 (on wlp3s0)
    SSID: xxxxxxx
    freq: 2412
    RX: 170136 bytes (571 packets)
    TX: 78040 bytes (506 packets)
    signal: -36 dBm
    tx bitrate: 144.4 MBit/s MCS 15 short GI

    bss flags:    CTS-protection short-preamble
    dtim period:    1
    beacon int:    100

$ iwlist wlp3s0 scan
wlp3s0    Scan completed :
          Cell 01 - Address: C2:9F:DB:F7:FB:F2
                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=70/70  Signal level=-34 dBm 
                    Encryption key:on
                    ESSID:"xxxxxxx"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000006f9297e4f7
                    Extra: Last beacon: 20057ms ago
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
          Cell 02 - Address: 10:86:8C:D1:4B:58
                    Channel:7
                    Frequency:2.442 GHz (Channel 7)
                    Quality=33/70  Signal level=-77 dBm 
                    Encryption key:on
                    ESSID:"ldamos2.4"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000011c966ff208
                    Extra: Last beacon: 19897ms ago
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
          Cell 03 - Address: 32:86:8C:D1:4B:5E
                    Channel:36
                    Frequency:5.18 GHz (Channel 36)
                    Quality=20/70  Signal level=-90 dBm 
                    Encryption key:on
                    ESSID:""
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000011c9778bb63
                    Extra: Last beacon: 19661ms ago
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
          Cell 04 - Address: 00:19:9D:4D:9C:D4
                    Channel:161
                    Frequency:5.805 GHz
                    Quality=25/70  Signal level=-85 dBm 
                    Encryption key:on
                    ESSID:"VIZIO HD"
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000005d48e86c8c
                    Extra: Last beacon: 16241ms ago
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK

> However, I have a separate wireless router box
> on an ethernet cable.  The interface is on eth0
> 192.168.1.10 in the PC, on the route LAN side 
> which is easily accessable via  a web browser: 192.168.1.1.

You'll need to configure the SSID on the wireless router first using the
wired connection.

> I probably missed an option in "iw" ?? I don't see a setting
> to go outside the box.  Also, in iw , I never use a IP
> number, just a interface name.

Start here: https://en.wikipedia.org/wiki/Wi-Fi
Then use the reference links at the bottom to go as deep as you feel
comfortable with.

I see a lot of confusion of terms here. A wireless connection doesn't
see wired connections by definition. The typical connection type is
connecting a client to an Access Point (AP) via an SSID. That means, the
client will scan for available SSIDs and issue a connect to the SSID of
choice. This may require it to present passwords, certificates and other
goodies to deal with security - unless it's an open network. Once
accepted, a connection is done and layer 2 can begin it's magic (dhcp etc).

-- 
Regards
  Peter Larsen





More information about the Novalug mailing list