Wireless
- WPA/WPA2 -- Wi-Fi Protected Access & Wi-Fi Protected Access V2) are security protocols for encrypting Wi-Fi communication. WPA has been hacked and should no longer be considered secure.
- WPA2 is also called RSN
- WPA/WPA2 (RSN) Enterprise -- requires a RADIUS server and is appropriate for large entities
- WPA/WPA2 (RSN) Personal (a.k.a. WPA-PSK or WPA2-PSK) -- uses pre-shared keys. Appropriate for residential and small business settings.
- WEP -- Wired Equivalency Protocol is another encryption mechanism. It has also been hacked and should no longer be considered secure.
- WPS -- Wi-Fi Protected Set-up is a technology which allows you to easily set-up a connection to a wireless network. After your network has been established, WPS should be disabled.
How to Connect to a WPA or WP2(RSN) network
lsusb
list usb devices
iw list
list wireless devices
- Create a virtual interface --
iw phy phy0 interface add <name> type <type>
. For instance iw phy phy0 interface add wlan0 type station
-- station connects to an AP (access point)
- To delete a virtual interface --
iw dev wlan0 del
Here are the various types (modes):
- AP (acess point) mode. To use AP mode, you need to use hostapd.
- managed (station) mode. Connects to an AP
- ibss (ad-hoc). A wireless network without the need of an AP
- mp (mesh). A wireless network in which nodes can forward to other nodes -- which is useful if the nodes are sparsely populated.
- monitor mode. No packets are transmitted. All packets are handed over to the host machine unfiltered.
- wds mode.
Check device status. Up or Down. ip link show wlan0
-- should show that the device is down -- i.e. UP is NOT seen between the parenthesis
Bring the device Up. ip link set wlan0 up
-- requires root access.
Check device status. ip link show wlan0
-- you should now see that the device is UP -- i.e. UP is seen between the parenthesis
Check the connection status. iw wlan0 link
-- which should report that you are NOT connected to a network
Scan available Wi-Fi networks. iw wlan0 scan
-- note the SSID (network ID) and security protocol (WPA2 or RSN)
wpa_passphrase <SSID> >>/etc/wpa_supplicant.conf
. Press ENTER and enter the network password followed by ENTER. This requires root access.
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_suppllicant.conf
. -B to run in the background (omit this for debugging). -D for the wireless driver. wext is a generic driver.
Check the connection status. iw wlan0 link
-- which should report that you are now connected to a network
Obtain IP address via DHCP. chclient wlan0
Test external connectivity. ping www.google.com
Hostapd
- Hostapd is a user space daemon for access point servers.