Table of Contents

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:

  1. The name of the MAC protocol used
  2. ESSID (Network Name)
  3. The NWID
  4. The frequency (or channel)
  5. The sensitivity
  6. The mode of operation
  7. Access Point address
  8. The bit-rate
  9. The RTS threshold
  10. The fragmentation threshold
  11. The encryption key
  12. 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 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):

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:

<code>
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):

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

—-