[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

ifup doesn't setup wireless encryption



I can configure my wireless card as I want it using iwconfig, but when
I use /etc/network/interfaces it doesn't setup encryption
unless I "ifup" twice (by using --force the second time).
I put the following in my interfaces file:

iface eth2 inet static
   address 10.1.0.1
   netmask 255.255.0.0
   network 10.1.0.0
   broadcast 10.1.255.255
   wireless_mode ad-hoc
   wireless_channel 6
   wireless_essid Hassium
   wireless_rate 54M
   wireless_nick hs
   wireless_key on
   wireless_key1 FFFF-FFFF-FFFF-FFFF-FFFF-FFFF-FF
   wireless_defaultkey 1
   wireless_keymode restricted
   pre-up /etc/network/more-options
   post-up /etc/network/firewall/ensure_firewall_basis

and then do "ifup eth2". iwconfig shows:

eth2      RT2500 Wireless  ESSID:"Hassium"  Nickname:"hs"
         Mode:Ad-Hoc  Frequency=2.437 GHz  Bit Rate=11 Mb/s
         RTS thr:off   Fragment thr:off
         Encryption key:off
         Link Quality:60  Signal level:0  Noise level:0
         Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
         Tx excessive retries:0  Invalid misc:0   Missed beacon:0

I have to do "ifup eth2 --force" to get:

eth2      RT2500 Wireless  ESSID:"Hassium"  Nickname:"hs"
         Mode:Ad-Hoc  Frequency=2.437 GHz  Cell: FA:42:F3:52:8E:C0
         Bit Rate=11 Mb/s
         RTS thr:off   Fragment thr:off
Encryption key:FFFF-FFFF-FFFF-FFFF-FFFF-FFFF-FF Security mode:restricted
         Link Quality:60  Signal level:0  Noise level:0
         Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
         Tx excessive retries:0  Invalid misc:0   Missed beacon:0

I replaced /sbin/iwconfig with a logging script. The arguments
passed to iwconfig when I "ifup eth2" log as:

eth2 mode ad-hoc
eth2 rate 54M
eth2 key on
eth2 key [1] FFFF-FFFF-FFFF-FFFF-FFFF-FFFF-FF
eth2 key [1]
eth2 key restricted
eth2 channel 6
eth2 nick hs
eth2 essid Hassium

if I paste all that in (with "iwconfig" prefixing it) my interface
is configured fine.

If I append "iwconfig" to "/etc/network/if-pre-up.d/wireless-tools"
it shows the interface is correctly configured each time.
If I do the same in "/etc/network/if-up.d/whatever" it shows the
encryption is off. What is happening between the execution of these two
scripts to disable encryption?

Thanks for any help anybody can give.




Reply to: