Network - Wifi



Wifi:

sudo iwlist scan | less         <--list reachable wireless networks

Checking wireless configuration with command: iwconfig

• Interface Name: Each device has its own interface name, if the interface is a wireless connection, additional details will be shown. (default name for a wireless connection is wlan0).

 Standard: lists the IEEE 802.11 standards supported by the wireless adapter (IEEE 802.11 b/g/n.)

• ESSID: SSID of the network to which the adapter is connected (if currently it is not connected to any networks, it will show "off/any")

• Mode: The mode the adapter is currently operating in, which can be:
  Managed: A standard wireless network, where clients are connecting to access points. (most common)
  Ad-Hoc: A device-to-device wireless network, with no access points.
  Monitor: A special mode used for troubleshooting where the card listens for all traffic
  Repeater: A special mode that forces a wireless card to forward traffic, to boost signal strength.
 Secondary: A subset of the Repeater mode, which forces the wireless card to act as a backup repeater.

• Access Point: The address of the access point to which the wireless adapter is connected. (If it is not connected to any wireless access point, it will show "Not-Associated".)

• Tx-Power: The transmission power (the strength of the signal the adapter is sending) (higher number means stronger signal).

• Retry: the number of transmission retries, used on congested networks. (ususally not needed to be changed, some cards won’t allow it to be changed).

• RTS: configuration fo Ready To Send and Clear To Send (RTS/CTS) handshaking, used on busy networks to prevent collisions. (it is usually set by the access point on connection)

• Fragment: maximum fragment size of a packet (larger packets will be splitted to this size, it is normally set by the access point on connection)

• Power Management: current status of the adapter’s power management functionality, (it reduces the device’s power demands when the wireless network is idle)

==========================================

wpasuppclient - /etc/wpa.conf

/etc/wpa.conf is used by a tool known as wpasupplicant, designed to provide Linux with an easy way to connect to networks secured with Wireless Protected Access (WPA) encryption.

Using wpasupplicant, you can connect the Pi to almost any wireless network—regardless of whether it’s protected by WPA or its newer replacement WPA2—in both Advanced Encryption Standard (AES) and Temporal Key Integrity Protocol (TKIP) modes. Despite its name, wpasupplicant also allows connection to wireless networks using the older Wired Equivalent Privacy (WEP) encryption standard.

wpa.conf looks differently, depending on the encryption used:

No Encryption:
network={
ssid=”Your_SSID”           <---SSID of the wireless network to which you want to connect
key_mgmt=NONE
}


WEP Encryption:
network={
ssid=”Your_SSID”           <---SSID of the wireless network to which you want to connect
key_mgmt=NONE
wep_key0=”Your_WEP_Key”    <--ASCII key for your wireless network’s WEP encryption
}


WPA/WPA2 Encryption:
network={
ssid=”Your_SSID”           <---SSID of the wireless network to which you want to connect
key_mgmt=WPA-PSK
wep_key0=”Your_WPA_Key”    <--pass phrase for your wireless network’s encryption
}


WEP encryption is extremely insecure. Readily-available software can break the encryption on a WEP-protected network in just a few minutes, allowing a third party to use your network. If you’re still running WEP, consider switching to WPA or WPA2 for better security.


==========================================

Connecting to a wireless network:

1. add these lines at the end of /etc/network/interfaces
auto wlan0                      <--it is the device name of the USB wireless adapter
iface wlan0 inet dhcp           <--it configures DHCP
wpa-conf /etc/wpa.conf          <--it refers to a configuration file: /etc/wpa.conf (it does not exist yet)

2. create /etc/wpa.conf file, based on the encryption, for WPA encryption it should look like this
WPA/WPA2 Encryption:
network={
ssid=”Your_SSID”         <---SSID of the wireless network to which you want to connect
key_mgmt=WPA-PSK
wep_key0=”Your_WPA_Key”  <--pass phrase for your wireless network’s encryption
}

3. sudo ifup wlan0                <--start wireless network without reboot
4. ping -c 1 www.raspberrypi.org  <--test the network

==========================================

No comments:

Post a Comment