Comment 9 for bug 42282

Revision history for this message
PC (pieter-claassen) wrote : Re: [Bug 42282] Re: fails to set the WEP encryption key

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/interfaces
# 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"
          Mode:Managed Frequency=2.412 GHz Bit Rate:18 Mb/s
          RTS thr:off Fragment thr:off
          Encryption key: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=/sbin/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"
          Mode:Managed Frequency=2.412 GHz Bit Rate:54 Mb/s
          RTS thr:off Fragment thr:off
          Encryption key: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, time 0ms
rtt min/avg/max/mdev = 4.994/4.994/4.994/0.000 ms

tail /var/log/syslog |grep dhc
root@desktop:~# tail -50 /var/log/syslog |grep dhc
May 3 19:12:34 localhost dhclient: DHCPDISCOVER on eth1 to
255.255.255.255 port 67 interval 6
May 3 19:12:40 localhost dhclient: DHCPDISCOVER on eth1 to
255.255.255.255 port 67 interval 19
May 3 19:12:40 localhost dhclient: DHCPOFFER from 192.168.1.2
May 3 19:12:40 localhost dhclient: DHCPREQUEST on eth1 to
255.255.255.255 port 67
May 3 19:12:40 localhost dhclient: DHCPACK from 192.168.1.2
May 3 19:12:40 localhost dhclient: bound to 192.168.1.42 -- renewal in
132 seconds.

On Wed, 2006-05-03 at 16:40 +0000, Scott James Remnant wrote:
> 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.
>