Wi-Fi: Difference between revisions

From Leo's Notes
This page was last edited on 23 March 2015, at 06:37.
No edit summary
Line 43: Line 43:


Edit the configuration and supply the WPA key. You may encode this using <code>wpa_passphrase</code>
Edit the configuration and supply the WPA key. You may encode this using <code>wpa_passphrase</code>
Start the wireless connection by running
netctl start wireless-wpa


== See Also ==
== See Also ==
* https://wiki.archlinux.org/index.php/netctl
* https://wiki.archlinux.org/index.php/netctl

Revision as of 06:37, 23 March 2015

Monitoring Access Points

To monitor data on the wifi network, install aircrack-ng, then run:

airomon-ng start wlan0
airodump-ng wlan0

You may get an error like:

[root@alarmpi ~]# airodump-ng wlan0
ioctl(SIOCSIWMODE) failed: Device or resource busy

ARP linktype is set to 1 (Ethernet) - expected ARPHRD_IEEE80211,
ARPHRD_IEEE80211_FULL or ARPHRD_IEEE80211_PRISM instead.  Make
sure RFMON is enabled: run 'airmon-ng start wlan0 <#>'
Sysfs injection support was not found either.

Make sure that the wireless device is in the monitor mode and then try again.

[root@alarmpi ~]# iwconfig wlan0
wlan0     IEEE 802.11bgn  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

[root@alarmpi ~]# ifconfig wlan0 down
[root@alarmpi ~]# iwconfig wlan0 mode monitor
[root@alarmpi ~]# ifconfig wlan0 up
[root@alarmpi ~]# iwconfig wlan0
wlan0     IEEE 802.11bgn  Mode:Monitor  Frequency:2.422 GHz  Tx-Power=20 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

Automatically Connecting

Use the script in Systemd to automatically start scripts on boot time using systemd.

Install dependencies:

pacman -S wpa_supplicant

Create a netctl profile in /etc/netctl. You can copy the example wpa configuration from /etc/netctl/examples/wireless-wpa to /etc/netctl and rename it to a desired name (It'll be your profile name).

Edit the configuration and supply the WPA key. You may encode this using wpa_passphrase

Start the wireless connection by running

netctl start wireless-wpa

See Also