Wi-Fi: Difference between revisions
No edit summary |
|||
| Line 37: | Line 37: | ||
Use the script in [[Systemd]] to automatically start scripts on boot time using systemd. | Use the script in [[Systemd]] to automatically start scripts on boot time using systemd. | ||
Install | Install wpa_supplicant since it's required to connect to wpa networks: | ||
pacman -S wpa_supplicant | pacman -S wpa_supplicant | ||
You will need to create a netctl profile in /etc/netctl. This can be done either manually or through the <code>wifi-menu</code> command. Example WPA configuration files can be viewed in <code>/etc/netctl/examples/wireless-wpa</code> and can be copied to <code>/etc/netctl</code> and used as a template configuration file. | |||
<syntaxhighlight lang="text"> | |||
# cat /etc/netctl/wlan0-dd-wrt | |||
Description='Automatically generated profile by wifi-menu' | |||
Interface=wlan0 | |||
Connection=wireless | |||
Security=wpa | |||
ESSID=dd-wrt | |||
IP=dhcp | |||
Key=\"f0c8a9e643*************************************************af10f | |||
</syntaxhighlight> | |||
Your <code>Key</code> can be your password or the PSK key generated using <code>wpa_passphrase</code>. <code>wifi-menu</code> will automatically generate and use the PSK key instead of storing the plain text copy of the password. | |||
<syntaxhighlight lang="text"> | |||
# wpa_passphrase dd-wrt ap_password | |||
network={ | |||
ssid="dd-wrt" | |||
#psk="ap_password" | |||
psk=14c5441f17e930da158a71592c3c7914315424f08d03c225d1092076093c32ee | |||
} | |||
</syntaxhighlight> | |||
You can then connect to the access point by running: | |||
netctl start '''profile-name''' | |||
If it errors out, check the systemd logs using <code>journalctl -xe</code>. If you're still having issues connecting, you may want to try reseating the wireless device or rebooting the machine. | |||
== See Also == | == See Also == | ||
* https://wiki.archlinux.org/index.php/netctl | * https://wiki.archlinux.org/index.php/netctl | ||
Revision as of 07:07, 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 wpa_supplicant since it's required to connect to wpa networks:
pacman -S wpa_supplicant
You will need to create a netctl profile in /etc/netctl. This can be done either manually or through the wifi-menu command. Example WPA configuration files can be viewed in /etc/netctl/examples/wireless-wpa and can be copied to /etc/netctl and used as a template configuration file.
# cat /etc/netctl/wlan0-dd-wrt
Description='Automatically generated profile by wifi-menu'
Interface=wlan0
Connection=wireless
Security=wpa
ESSID=dd-wrt
IP=dhcp
Key=\"f0c8a9e643*************************************************af10f
Your Key can be your password or the PSK key generated using wpa_passphrase. wifi-menu will automatically generate and use the PSK key instead of storing the plain text copy of the password.
# wpa_passphrase dd-wrt ap_password
network={
ssid="dd-wrt"
#psk="ap_password"
psk=14c5441f17e930da158a71592c3c7914315424f08d03c225d1092076093c32ee
}
You can then connect to the access point by running:
netctl start profile-name
If it errors out, check the systemd logs using journalctl -xe. If you're still having issues connecting, you may want to try reseating the wireless device or rebooting the machine.