If you are using the desktop versions, the
nmcli command for Network Manager could be useful:
nmcli nm wifi [on|off]
nmcli dev wifi [list [iface <iface>] [bssid <BSSID>]]
nmcli dev wifi connect <(B)SSID> [password <password>] [wep-key-type key|phrase] [iface <iface>] [bssid <BSSID>] [name <name>] [--private] [--nowait] [--timeout <timeout>]
nmcli dev disconnect iface <iface> [--nowait] [--timeout <timeout>]
nmcli con up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [--nowait] [--timeout <timeout>]
nmcli con down id <id> | uuid <id>
- Disable and enable the WiFi.
- List available networks (specific to a wireless device and the BSSID (usually the MAC address of the AP)).
- Connect to a network, (use
password for WPA/WPA2,
wep-key-type for WEP).
- Disconnect the device and prevent it from automatically connecting again.
- Activate an existing connection. The
id is usually the name of the file in
/etc/Network-Manager/system-connections corresponding to the connection. The UUID is available in the same file.
- Deactivate an active connection.