Ubuntu: How do I connect my server to a WEP encrypted wireless network?


I've recently started working with Ubuntu Server 10.04, but I'm having a problem while connecting to WEP-encrypted Wifi.

I've tried the following:

sudo ifconfig wlan0 down  sudo dhclient -r wlan0    sudo ifconfig wlan0 up    sudo iwconfig wlan0 essid "<essid>"  sudo iwconfig wlan0 key <hex key>  

Then, I tried to connect to the Wifi by running sudo dhclient wlan0, however, I keep getting the same error- No DHCPOFFERS received.

Am I doing this the right way, or is there something I'm forgetting?

sudo ifconfig yields:

wlan0 Link encap: Ethernet HWAaddr 00:1f:1f:3b:3c:3e    UP BROADCAST MULTICAST MTU:1500 Metric:1    RX packets:0 errors:0 dropped:0 overruns:0 frame:0    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0    collisions:0 txqueuelen:1000    X bytes:0 (0.0B) TX Bytes:0 (0.0B)  

While sudo iwconfig yields:

wlan0 IEEE 802.11bg ESSID:"GlobalNetwork"    Mode:Managed Access Point: Not-Associated Tx-Power:8 dBm    Retry long limit:7 RTS thr:off Fragment thr:off    Encryption key:my-hex-key    Power Management:off  

I'm trying to connect with a Ralink RT2561 that shows up with lshw -C network.

Any help you can give me is much appreciated, what am I doing wrong?


The error you are receiving ( "No DHCPOFFERS received" ) seems to suggest that there is no DHCP server in your network. So I do not think is a WEP problem...

I assume that your are trying to connect to a "normal" router ( so you do not have separate DHCP server, firewalls or other stuff between your server and the router ).

  1. disable wep and try to connect again to the network. If this works, probably there was an error in the WEP password you entered.

  2. try to connect to the network by cable. This way you can check if through ethernet the DHCP works and an IP address is given to your server. If you receive an IP address the problem could be wireless card drivers or misconfiguration.

  3. check DHCP setting for the router. Maybe something is messed up on the router side, access it's configuration page and try to understand if settings are correct. You can also try to connect to the wifi connection through another computer ( just to be sure that the problem is the server! )

  4. config your server to use a static IP address ( this way you won't be using DHCP ):
    Please remember to check the IP address you will insert ( could be taken by someone else in the network ) and be sure to put the correct gateway address!


You need to use the #1 Key, NOT the Passphrase. The key shows "Default" and cannot be changed, but when I entered the key instead of the passphrase - BOOM - I was, and am connected.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »