I need to auto-connect to the AP wirelessly with WEP with the password hello. I know it's unsecure and that's the purpose of the lab environment I am setting up for a presentation. I've seen tutorials and answers like this one (Connecting the Pi3 automatically to Wifi) but they all are using WPA or WPA2 and would like some help in setting this up. I also need to be able to simulate high amounts of traffic to the AP like a network to generate a ton of IVs (initialization vectors). Any help would be appreciated.
2 Answers
First, WEP key (i.e. password) only allowed hexadecimal digits (i.e. 0 - 9, A - F) as password, therefore 'hello' is not a valid password, and maximum length for the password is 26 hexadecimal digits (or 104 bits). This is the reason that WEP is not very secure and seldom be used nowadays.
If you still want to use WEP, here is what you need to do. Run your editor (example using nano) to modify the configuration of /etc/wpa_supplicant/wpa_supplicant.conf
file:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Add the following configuration to the end of the file:
network={
ssid="your network said"
key_mgmt=NONE
wep_key=0123456789abcdef0123456789
}
Please noted that there is no quote for wep_key
and it must be hexadecimal digits, and maximum not exceeding 26 hexadecimals. My example shows a 26-digit key.
Save the file and reload the network service or reboot.
This thread was very helpful in getting my Raspberry Pi connected to WEP router. Here are some details that I had to dig out:
The essence of the problem is that in the file /etc/wpa_supplicant/wpa_supplicant.conf the passkey is stored with quotes. The object is to remove the quotes (simple, right?). The problem is that the editor must be invoked with superuser privileges, otherwise you cannot save the edited file. The nano editor was not as friendly as the leafpad editor. So, in terminal:
sudo leafpad /etc/wpa_supplicant/wpa_supplicant.conf
Remove the quotes, save the file and Bob's your uncle!
-
Everyone uses his favorite editor and swear it's the best one.
nano
is the most used one on the command line. I swearvim
is the best one ever. So suggesting to use a specific editor is not a good idea particularly if you have to install it only for this action. Everyone using his favorite editor (he is familiar with it) should be able to delete some quotes. So you should advise to usesudo editor /etc/wpa_supplicant/wpa_supplicant.conf
. This will start the favoriteeditor
mostlynano
(default setting ofeditor
). For you it could startleafpad
. Nevertheless +1.– IngoCommented Jan 20, 2019 at 12:40
/etc/wpa_supplicant/wpa_supplicant.conf
togroup=CCMP TKIP WEP104 WEP40
. Readman wpa_supplicant.conf
for detail.