fails to set the WEP encryption key (rt2500)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
wireless-tools (Ubuntu) |
Incomplete
|
Medium
|
Scott James Remnant (Canonical) |
Bug Description
My wep key is never set properly on startup
the issue seems to be in the ifup binary since it fails to run the /etc/networking
The workaround is currently to set the key manually with
iwconfig ethx key XXXXXXXXXX
sam tygier (samtygier) wrote : | #1 |
Changed in ifupdown: | |
status: | Unconfirmed → Needs Info |
PC (pieter-claassen) wrote : | #2 |
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
iface eth2 inet static
address 192.168.1.3
netmask 255.255.255.0
gateway 192.168.1.1
wireless-essid AAA
wireless-key AABBCCDDEE
#auto eth2
iface wlan0 inet static
address 192.168.1.3
netmask 255.255.255.0
gateway 192.168.1.1
wireless-essid AAA
wireless-key AABBCCDDEE
#auto wlan0
iface eth1 inet static
address 192.168.1.3
netmask 255.255.255.0
gateway 192.168.1.1
wireless-essid AAA
wireless-key AABBCCDDEE
auto eth1
Scott James Remnant (Canonical) (canonical-scott) wrote : | #3 |
Add the following to the top of /etc/network/
eval 2>/tmp/wireless.log
set -x
Run ifdown/ifup for an interfact that the key isn't set for, and then attach /tmp/wireless.log
Thanks
Changed in ifupdown: | |
assignee: | nobody → keybuk |
PC (pieter-claassen) wrote : Re: [Bug 42282] Re: ifup fails to set the WEP encryption key properly | #4 |
Hi Scott, the eval didn't work but I just dumped the stdout verbatim
here.
root@desktop:/tmp# ifdown eth1
root@desktop:/tmp# ifup eth1
+ IWCONFIG=
+ '[' '!' -x /sbin/iwconfig ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n AABBCCDDEE ']'
+ /sbin/iwconfig eth1 key AABBCCDDEE
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n WLAN ']'
+ /sbin/iwconfig eth1 essid WLAN
+ '[' -n '' ']'
Error : Temporary failure in name resolution
On Tue, 2006-05-02 at 14:07 +0000, Scott James Remnant wrote:
> Add the following to the top of /etc/network/
>
> eval 2>/tmp/wireless.log
> set -x
>
> Run ifdown/ifup for an interfact that the key isn't set for, and then attach /tmp/wireless.log
>
> Thanks
>
> ** Changed in: ifupdown (Ubuntu)
> Assignee: (unassigned) => Scott James Remnant
>
Scott James Remnant (Canonical) (canonical-scott) wrote : Re: ifup fails to set the WEP encryption key properly | #5 |
Ok, so the key has been set correctly ...
Scott James Remnant (Canonical) (canonical-scott) wrote : Re: fails to set the WEP encryption key | #6 |
Your card may be one of those that requires the mode to be set first...
could you try adding
wireless-mode managed
to your /etc/network/
PC (pieter-claassen) wrote : Re: [Bug 42282] Re: fails to set the WEP encryption key | #7 |
Info included below.
If I do the following by hand, it still works.
iwconfig eth1 key AABBCCDDEE
iwconfig eth1 essid WLAN
The card uses the RT2500 driver that comes with the ubuntu distro.
root@desktop:
+ IWCONFIG=
+ '[' '!' -x /sbin/iwconfig ']'
+ '[' -n '' ']'
+ '[' -n managed ']'
+ /sbin/iwconfig eth1 mode managed
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n AABBCCDDEE ']'
+ eval /sbin/iwconfig eth1 key AABBCCDDEE
++ /sbin/iwconfig eth1 key AABBCCDDEE
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n WLAN ']'
+ /sbin/iwconfig eth1 essid WLAN
+ '[' -n '' ']'
Error : Temporary failure in name resolution
On Tue, 2006-05-02 at 15:21 +0000, Scott James Remnant wrote:
> Your card may be one of those that requires the mode to be set first...
>
> could you try adding
>
> wireless-mode managed
>
> to your /etc/network/
>
Scott James Remnant (Canonical) (canonical-scott) wrote : Re: fails to set the WEP encryption key | #8 |
And you can confirm that the commands run by the wireless-tools script are identical in both order, quoting, etc. in EVERY WAY to the commands you run that "make it work" ?
I'm afraid if that's the case, there's no information here that reveals the bug -- you're saying that there's a difference between you running a command on the shell, and the exact same command being run by a shell script.
There must be some other difference at work here.
After running "ifup eth1", please prove this is failing by providing /var/log/syslog which will show the dhclient attempts and the output of "ifconfig eth1" once an address has been found.
PC (pieter-claassen) wrote : Re: [Bug 42282] Re: fails to set the WEP encryption key | #9 |
I don't use dhcp on this interface, but notice that once the interface
comes up with a static ip it still leases a dhcp ip (bottom of mail).
The sequence by hand is exactly the same as that in wireless-tools
What state does ifdown leave the iwconfig settings? Notice that ifdown
removes the key but not the essid from the wireless interface. If I
don't use ifdown but just take the inteface down with ifconfig, then
ifup brings the interface up no problem.
root@desktop:~# ifdown eth1
Error for wireless request "Set Mode" (8B06) :
SET failed on device eth1 ; Invalid argument.
root@desktop:~# cat /etc/network/
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
iface eth1 inet static
address 192.168.1.3
netmask 255.255.255.0
gateway 192.168.1.1
wireless-mode managed
wireless-essid WLAN
wireless-key AABBCCDDEE
auto eth1
root@desktop:~# tail -2 /var/log/syslog
May 3 19:08:41 localhost dhclient: DHCPDISCOVER on eth1 to
255.255.255.255 port 67 interval 19
May 3 19:08:41 localhost dhclient: send_packet: Network is down
root@desktop:~# iwconfig eth1
eth1 RT2500 Wireless ESSID:"WLAN"
RTS thr:off Fragment thr:off
Link Quality=44/100 Signal level=-63 dBm Noise level:-205
dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
root@desktop:~# ifup eth1
+ IWCONFIG=
+ '[' '!' -x /sbin/iwconfig ']'
+ '[' -n '' ']'
+ '[' -n managed ']'
+ /sbin/iwconfig eth1 mode managed
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n AABBCCDDEE ']'
+ eval /sbin/iwconfig eth1 key AABBCCDDEE
++ /sbin/iwconfig eth1 key AABBCCDDEE
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n WLAN ']'
+ /sbin/iwconfig eth1 essid WLAN
+ '[' -n '' ']'
root@desktop:~# iwconfig
lo no wireless extensions.
eth1 RT2500 Wireless ESSID:"WLAN"
RTS thr:off Fragment thr:off
Link Quality=44/100 Signal level=-63 dBm Noise level:-204
dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
eth0 no wireless extensions.
sit0 no wireless extensions.
tun0 no wireless extensions.
root@desktop:~# iwconfig eth1 key AABBCCDDEE
root@desktop:~# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=4.99 ms
--- 192.168.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss,...
Scott James Remnant (Canonical) (canonical-scott) wrote : Re: fails to set the WEP encryption key | #10 |
That's interesting, this implies that your card needs the ESSID set before the Wireless Key, which is actually exactly the opposite to most cards.
If you move the following bit of code to the top of the wireless-tools script, does that make things work?
if [ -n "$IF_WIRELESS_
$IWCONFIG "$IFACE" essid "$IF_WIRELESS_
fi
PC (pieter-claassen) wrote : Re: [Bug 42282] Re: fails to set the WEP encryption key | #11 |
Scott, it is really weird.
I changed the code as requested but it didn't solve the problem (even
though manually, the card doesn't care which way I do it anyhow).
I noticed in syslog that the wireless interface eth1, even though it is
set to static IP still leases and IP successfully but then overrides it
with the static IP.
I included an strace of the ifdown eth1 and ifup eth1 FYI.
dmesg indicates that my machines thinks that my rtl8139 card is also on
eth1. Maybe that is the issue. How do I force my interfaces to be
different? (Just rmmod 8139too didn't work).
Cheers,
Pieter
On Wed, 2006-05-03 at 17:38 +0000, Scott James Remnant wrote:
> That's interesting, this implies that your card needs the ESSID set before the Wireless Key, which is actually exactly the opposite to most cards.
>
> If you move the following bit of code to the top of the wireless-tools script, does that make things work?
>
> if [ -n "$IF_WIRELESS_
> $IWCONFIG "$IFACE" essid "$IF_WIRELESS_
> fi
>
> ** Summary changed:
>
> - fails to set the WEP encryption key
> + fails to set the WEP encryption key (rt2500)
>
execve(
uname({sys="Linux", node="desktop", ...}) = 0
brk(0) = 0x804f000
old_mmap(NULL, 4096, PROT_READ|
access(
old_mmap(NULL, 8192, PROT_READ|
access(
open("/
fstat64(3, {st_mode=
old_mmap(NULL, 82358, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f40000
close(3) = 0
access(
open("/
read(3, "\177ELF\
fstat64(3, {st_mode=
old_mmap(NULL, 1238972, PROT_READ|
old_mmap(
old_mmap(
close(3) = 0
old_mmap(NULL, 4096, PROT_READ|
set_thread_
munmap(0xb7f40000, 82358) = 0
fcntl64(0, F_GETFD) = 0
fcntl64(1, F_GETFD) = 0
fcntl64(2, F_GETFD) = 0
brk(0) = 0x804f000
brk(0x8070000) = 0x8070000
open("/
fstat64(3, {st_mode=
mmap2(NULL, 4096, PROT_READ|
Scott James Remnant (Canonical) (canonical-scott) wrote : | #12 |
Attach complete output of "ifconfig -a" and /etc/iftab
PC (pieter-claassen) wrote : Re: [Bug 42282] Re: fails to set the WEP encryption key (rt2500) | #13 |
root@desktop:/tmp# ifconfig -a
eth1 Link encap:Ethernet HWaddr 00:50:18:3B:B8:80
inet addr:192.168.1.36 Bcast:192.168.1.255
Mask:255.255.255.0
inet6 addr: fe80::250:
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1855006 errors:0 dropped:0 overruns:0 frame:0
TX packets:1203089 errors:13919 dropped:13919 overruns:0
carrier:0
RX bytes:2478813485 (2.3 GiB) TX bytes:173190374 (165.1 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1415811 errors:0 dropped:0 overruns:0 frame:0
TX packets:1415811 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:640374359 (610.7 MiB) TX bytes:640374359 (610.7 MiB)
sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
root@desktop:~# cat /etc/iftab
# This file assigns persistent names to network interfaces. See
iftab(5).
eth0 mac 00:0a:e6:18:25:e5
On Wed, 2006-05-03 at 20:57 +0000, Scott James Remnant wrote:
> Attach complete output of "ifconfig -a" and /etc/iftab
>
Scott James Remnant (Canonical) (canonical-scott) wrote : | #14 |
I don't see any eth0 being detected in the "ifconfig -a" output there, this was after a fresh boot and not after you'd rmmod'd the card, yes?
PC (pieter-claassen) wrote : | #15 |
Yes, you are right. After a fresh boot, things look normal with wired
card seen as eth0 and wireless as eth1
However, this did happen after the interface was renamed from ra0 to
eth1 which I think happened some time before the dapper upgrade.
I am at a loss. Summarised are the facts:
During ifdown, there is an error
+ /sbin/iwconfig eth1 mode auto
Error for wireless request "Set Mode" (8B06) :
SET failed on device eth1 ; Invalid argument.
The card is left after ifdown without a key but the essid and mode is
still set.
on ifup eth1 the card is left without a key (even though if I cut and
paste the code from the set -x into the command line, it all works).
The additional errors we see is from the other code run
in /etc/netork/
I tried to have a look at the ifup/ifdown source but it didn't look like
normal c.
if I run iwconfig eth 1 key AABBCCDDEE after running ifup eth1, then all
works fine.
I really am at a loss as to where to look next.
Cheers,
P
On Wed, 2006-05-03 at 22:36 +0000, Scott James Remnant wrote:
> I don't see any eth0 being detected in the "ifconfig -a" output there,
> this was after a fresh boot and not after you'd rmmod'd the card, yes?
>
Scott James Remnant (Canonical) (canonical-scott) wrote : | #16 |
We have many other resports of problems with this driver not working correctly, merged with the kernel report
can you post your /etc/network/ interfaces.
X out the wep keys if you need.