[network-admin] WEP doesn't work when setting key using network-admin

Bug #67152 reported by Andreas Gustafsson
6
Affects Status Importance Assigned to Milestone
gnome-system-tools (Ubuntu)
Invalid
Medium
Ubuntu Desktop Bugs

Bug Description

Summary: When configure a WEP key using network-admin, it is
correctly displayed by iwconfig, yet WEP does not work. If I
configure the exact same key using iwconfig, it works.

This is with a D-Link DWL-G520 PCI 802.11g adapter under
Ubuntu 6.06 LTS, with all packages up-to-date as of yesterday.

I have reproduced this rather strange behavior several times.
Here is what I do:

Let's say my WEP key is c90fef4410778eb1e5e8835977
(that's not my actual key, but it is in the same hex format).

I choose System/Administration/Networking from the menu bar
In the "Network settings" window, it says

  Wireless connection
  The interface ath0 is active

I click "properties"; "the Interface properties" window pops up. The
"Network name (ESSID)" setting shows multiple choices, one of which is
the correct ESSID for my network ("gson"). I choose it.

I leave "Key type" at its default of "Hexadecimal"

In the "WEP key" box, I enter "c90fef4410778eb1e5e8835977".

I click "OK"

A message window saying "Activating interface "ath0"" pops up
and stays up for a long time, about 90 seconds. When it disappears,
the "Network settings" window still says "The interface ath0 is
active", but I have no DHCP lease and no connectivity.

I try running "dhclient ath0" manually, but it also fails to get a lease.

I run "iwconfig ath0". It prints:

ath0 IEEE 802.11g ESSID:"gson"
          Mode:Managed Frequency:2.462 GHz Access Point: 00:0D:88:EB:BA:CA
          Bit Rate:36 Mb/s Tx-Power:18 dBm Sensitivity=0/3
          Retry:off RTS thr:off Fragment thr:off
          Encryption key:C90F-EF44-1077-8EB1-E5E8-8359-77 Security mode:restricted
          Power Management:off
          Link Quality=16/94 Signal level=-79 dBm Noise level=-95 dBm
          Rx invalid nwid:1 Rx invalid crypt:0 Rx invalid frag:0
          Tx excessive retries:0 Invalid misc:0 Missed beacon:7

I try setting the key manually from the command line with
"iwconfig ath0 key c90fef4410778eb1e5e8835977".

I run "iwconfig ath0" again. It prints exactly the same output as last time,
including the exact same key (I verified this using "diff"):

ath0 IEEE 802.11g ESSID:"gson"
          Mode:Managed Frequency:2.462 GHz Access Point: 00:0D:88:EB:BA:CA
          Bit Rate:36 Mb/s Tx-Power:18 dBm Sensitivity=0/3
          Retry:off RTS thr:off Fragment thr:off
          Encryption key:C90F-EF44-1077-8EB1-E5E8-8359-77 Security mode:restricted
          Power Management:off
          Link Quality=16/94 Signal level=-79 dBm Noise level=-95 dBm
          Rx invalid nwid:1 Rx invalid crypt:0 Rx invalid frag:0
          Tx excessive retries:0 Invalid misc:0 Missed beacon:7

I again run "dhclient ath0" manually, and this time it gets a lease,
even though the configuration according to "iwconfig ath0" is exactly
the same as when it failed. The only difference is that I set the
key manually inbetween (to the same value it already had).

Here's the lspci -v output for the card:

0000:02:01.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)
        Subsystem: D-Link System Inc DWL-G520 Wireless PCI Adapter rev. B
        Flags: bus master, medium devsel, latency 168, IRQ 177
        Memory at febc0000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [44] Power Management version 2

and lspci -vn:

0000:02:01.0 0200: 168c:0013 (rev 01)
        Subsystem: 1186:3a13
        Flags: bus master, medium devsel, latency 168, IRQ 177
        Memory at febc0000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [44] Power Management version 2

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug. Do you have the correct key written to /etc/network/interfaces? Does it work after restarting the network?

Changed in gnome-system-tools:
assignee: nobody → desktop-bugs
importance: Undecided → Medium
status: Unconfirmed → Needs Info
Revision history for this message
Andreas Gustafsson (gson) wrote :

> Thank you for your bug. Do you have the correct key written to /etc/network/interfaces?

No - the complete contents of /etc/network/interfaces are as follows:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet dhcp

auto eth2
iface eth2 inet dhcp

auto ath0
iface ath0 inet dhcp

auto wlan0
iface wlan0 inet dhcp

Furthermore, "ls -l /etc/network/interfaces" outputs:

  -rw-r--r-- 1 root root 194 2006-10-18 08:32 /etc/network/interfaces

The modification time of 2006-10-18 is the day Ubuntu was first installed on
the system, two days before the original bug report. Clearly, network-admin
has never written to the file in case.

> Does it work after restarting the network?

What exactly do you mean by "restaring the network"?` Assuming you mean
running "/etc/init.d/networking restart", the answer would be "no".

Revision history for this message
Sebastien Bacher (seb128) wrote :

the changes should be written to /etc/network/interfaces, marking the bug unconfirmed until somebody pick up that problem to investigate

Changed in gnome-system-tools:
status: Needs Info → Unconfirmed
Revision history for this message
Stephen Gornick (sgornick) wrote :

Andreas reports that he makes the changes in the "interface properties" dialog box, then clicks OK but does not see the changes made in the /etc/network/interfaces config file.

However after that Interface Properties dialog box closes, focus is returned to network-admin dialog box (titled "Network settings") at that point, I too see that the config file has not yet been written to. It is not until the OK button in network-admin also is pressed that network-admin writes the changes to the config file.

If instead you click cancel in network-admin, any changes made in Interface Properties are discarded and never written to the config file.

Additionally, I am experiencing a similar problem in connecting where after making the change (even if network-admin writes the changes to the config file), I still need to manually re-issue the iwconfig to get a connection, or else I can simply reboot:
https://bugs.launchpad.net/ubuntu/+source/netbase/+bug/80499

Revision history for this message
Sebastien Bacher (seb128) wrote :

Andreas, do you use "cancel"? Stephen, what version of Ubuntu do you use?

Revision history for this message
Andreas Gustafsson (gson) wrote :

> Andreas, do you use "cancel"?

Yes, I believe I did press "cancel" in the Network Settings
window in each of my previous attempts, because I just
tried again, pressing OK this time, and now the file
/etc/networking/interfaces did in fact get written to,
for the first time since the system was installed (I verified
that before I pressed OK it still had a timestamp of the
day the system was installed). After I pressed the OK
key, there was a lengthy delay before the Network Settings
window disappeared, on the order of 60 seconds.

However, despite /etc/networking/interfaces now
containing the correct WEP key, the wireless interface
remained non-functional. As before, setting the WEP
key manually using iwconfig fixed it. Unlike before,
the interface now worked after rebooting the machine.

In other words, I am seeing the same behavior reported
by Stephen G.

The issue of Cancel vs OK does not change the fact that
there is a bug: even though choosing OK rather than Cancel
means the interface works after a reboot, it still does not
work until rebooting, and it should.

Also, the fact that you can make it work without a
reboot by manually setting the key using iwconfig
even though "iwconfig ath0" already displays the correct
key is just bizarre. To me that suggests that there
may be a kernel or driver bug causing the interface
state displayed by iwconfig to become inconsistent
with that actually used by the hardware.

Revision history for this message
Stephen Gornick (sgornick) wrote :

> Stephen, what version of Ubuntu do you use?

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 6.06.1 LTS
Release: 6.06
Codename: dapper

desktop-i386

Hardware: HP Pavilion zx5078cl

$ lspci |grep Broadcom
0000:02:02.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03)

Now that the write to /etc/network/interfaces is working for Andreas the remaining problem is that the iwconfig still needs to be run, or system rebooted, which is what I also reported in #80499. Should #80499 be marked as a duplicate of this bug, or vice-versa?

Revision history for this message
Liam McDermott (liam-intermedia-online) wrote :

A similar problem: setting up wireless via network-admin--using the 'static' configuration--does not seem to work. Attached is a log from iwevent along with the steps taken to eventually enable wireless using the networkmanager applet (all written into the log as I went along).

I will also attach other details relating to this setup. Is there some workaround for this? Roaming is not a good option as a password has to be entered when the applet needs access to the keyring.

Am using the daily build of Feisty Fawn from yesterday (13/03/2007), fully updated. The key is hexadecimal.

Revision history for this message
Liam McDermott (liam-intermedia-online) wrote :
Revision history for this message
Liam McDermott (liam-intermedia-online) wrote :
Revision history for this message
Djainette (djainette) wrote :

I'm running a wifi dongle, with the zd1201 driver on Feisty. The device works, and the WEP wireless-key in my etc/network/interfaces used to work on Dapper. Now it seems that the network-manager can't read the key.
Using a GUI, I can't get a dhcp lease. But if I supply the WEP key using iwconfig and then run dhclient3, dhcp works perfectly.
It seems that the wireless-key in the interfaces file can't be used.

Revision history for this message
Liam McDermott (liam-intermedia-online) wrote :

In the end (even the setup posted above stopped working after a restart) I had to remove networkmanager and use the /etc/network/interfaces file.

Revision history for this message
Stephen Gornick (sgornick) wrote :

Network-admin no longer has a cancel button, and Network-manager now writes the wep key to the /etc/network/interfaces right away -- so this behavior of wep key not making it to /etc/network/interfaces no longer persists (As-of Gutsy Beta with latest updates).

Changed in gnome-system-tools:
status: New → Invalid
Revision history for this message
Andreas Gustafsson (gson) wrote :

Trying the 8.04 live CD, it is still the case that the network does not work after
configuring the WEP key using network-admin, even though many details of
the user interface and program behavior have changed since I originally
reported this as bug 67152. I am still using the same hardware.

These are the steps I followed to reproduce the problem:

Boot the 8.04 live CD
Click on the network icon in the top menu bar
Select "Manual configuration"
Select "Wireless connection"
Click "Properties"
Disable roaming mode
Network name: gson (my network ESSID)
Password type: WEP key (hexadecimal)
Network password: (my WEP key)
Configuration: Automatic configuration (DHCP)
Click OK

After these steps, /etc/network/interfaces does contain the
correct ESSID and WEP key for ath0, but according to
"ifconfig ath0" and "iwconfig ath0", the ath0 interface
has not been configured with that ESSID and key.

If I then manually run "/etc/init.d/networking restart", the
interface gets configured correctly and starts working.

Also, if after clicking on the networking icon I don't
select "Manual configuration" but instead simply select
my network from the list of detected networks and follow
the dialogs from there, I end up with a working configuration
without having to manually run "/etc/init.d/networking restart".

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.