====== Wireless: Connect ======
===== CLI =====
^ command ^ description ^
| ifconfig | Enable your wireless device |
| iwlist | List the available wireless access points |
| iwconfig | Configure your wireless connection |
| dhclient | Get your IP Address via dhcp |
----
===== Debian How-To =====
[[https://wiki.debian.org/WiFi/HowToUse#Command_Line|]]
----
===== iwconfig =====
Configure a wireless network (like ''ifconfig'' for wireless)
iwconfig # by itself, or...
iwconfig [interface name] # designate specific wireless interface
**Shows:**
- The name of the MAC protocol used
- ESSID (Network Name)
- The NWID
- The frequency (or channel)
- The sensitivity
- The mode of operation
- Access Point address
- The bit-rate
- The RTS threshold
- The fragmentation threshold
- The encryption key
- The power management settings
----
===== ifconfig + ifupdown (best) =====
[1] Bring your wireless network up (assuming interface name is wlan0):
ifconfig wlan0 up
[2] Scan for wireless access points:
iwlist wlan0 scan
iwlist wlan0 scan | less # pipe it to less or grep to find what you need
[3] Find the one you want and put its [[general_network#examples|configs]] in a file under /etc/network/
[4] Down the wireless interface and bring it up with you config file
ifconfig wlan0 down
ifup -i /etc/network/config_filename wlan0
----
===== ifconfig + iwconfig =====
Simplied (three commands to get wireless up and running; assuming interface name is wlan0):
* NOTE: iwconfig only supports open and WEP encrypted networks; no WPA/WPA2 support
* For WPA/WPA2 use the above ifupdown routine
ifconfig wlan0
iwconfig wlan0 essid NETWORK_NAME key WIRELESS_KEY
dhclient wlan0
[1] Bring your wireless network up:
ifconfig wlan0 up
[2] Scan for wireless access points:
iwlist wlan0 scan
iwlist wlan0 scan | less # pipe it to less or grep to find what you need
From the output of the scan you should see a line (or lines) like:
ESSID: "NETWORK_NAME" #name of an available wireless network
[3] Connect to the network of your choice:
iwconfig wlan0 essid NETWORK_NAME # open network
iwconfig wlan0 essid NETWORK_NAME key open # open network if above doesn't work
iwconfig wlan0 essid NETWORK_NAME key off # open network if above doesn't work
iwconfig wlan0 essid NETWORK_NAME key WIRELESS_KEY # encrypted network
**NOTE:** The iwconfig command defaults to HEX values for wireless keys. If you need to use ascii you have to prepend the āsā prefix to your key like so:
iwconfig wlan0 essid NETWORK_NAME key s:WIRELESS_KEY
[4] After you connect, if you need dhcp to assign an IP:
dhclient wlan0
[5] Shut it down...
ifconfig wlan0 down
----
====== Network Manager ======
**Network Manager Tools (included with install):**
* nmcli: the dedicated command line tool used in order to configure, add, edit and remove connections using the Network Manager;
* nmtui: (tab-complete to see shortcuts) a graphical user interface that provides just a subset of features compated to nmcli. Using nmtui, you can edit a connection, activate a connection or change the hostname of your computer;
* nm-applet: available in GNOME desktop environments, this applet is used as an interface overlay which can be used in order to connect or disconnect from networks.
**Start/Stop/Restart Networking: **
systemctl stop networking.service
systemctl start networking.service
systemctl restart networking.service # same as above two, combo
If that doesn't work:
service network-manager restart
----