I have a router at home with ESSID of dlink_home and 10 digits (0123456789) 64-bit WEP encryption of Open Authentication Type.
I want to connect to it through terminal with bash commands, I tried
ifconfig wlan0 up iwconfig wlan0 essid dlink_home key s:0123456789 dhclient wlan0
When using s: prefix it gives the following error:
Error for wireless request "Set Encode" (8B2A) : SET failed on device wlan0 ; Invalid argument.
and without it, it doesn't work, as s: prefix is for specifying string key rather than HEX key.
The OS I am running is Red Hat Enterprise Linux 6.