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

Re: ifup fails but iwconfig




Agricolae--thanks for the suggestion.  There is no Network-Manager on my install, but fortunately your idea kept me going long enough to *nearly* find the solution.

Turns out I made a mistake in my original post.  If the ifup command fails, then the iwconfig command will also fail:

$sudo ifup rausb0
Error for wireless request "Set Mode" (8B06)
SET failed on device rausb0 ; Network is down.
Error for wireless request "Set Encode" (8B2A) :
SET failed on device rausb0 ; Network is down.
Error for wireless request "Set Frequency" (8B04) :
SET failed on device rausb0 ; Network is down.
Error for wireless request "Set ESSID" (8B1A) :
SET failed on device rausb0 ; Network is down.

$sudo iwconfig rausb0 mode Managed
Error for wireless request "Set Mode" (8B06)
SET failed on device rausb0 ; Network is down.

***************************************************************
All the above stuff occurs whenever the rausb0 interface is down (rausb0 is not shown in response to a simple "ifconfig" command):
~$ ifconfig
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:31 errors:0 dropped:0 overruns:0 frame:0
TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2068 (2.0 KiB) TX bytes:2068 (2.0 KiB)
~$

My key insight was how I got to this state (call it state #1) in which rausb0 is down. Of course, you are in this state at boot, before dhclient has run for the 1st time on rausb0. Also, you can stay in state #1 if you let dhclient run all the way to the end WITHOUT INTERRUPTING IT (either at boot, or by restarting the networking service). No DHCP offer will be received and eventually dhclient says it could not bring up rausb0.

I get into a very different state (call it state #2) if I interrupt dhclient (with ^C) in the middle of all its DHCPDISCOVERs. By interrupting dhclient, dhclient never has a chance to get to the point where it says it could not bring up rausb0. In state #2, a simple "ifconfig" command will show both lo and rausb0. However, no IPv4 address will be shown for rausb0 because rausb0 isn't really working even though the system considers it to be "up".

In state #2, with rausb0 "up" but not working, if I do:
$sudo ifup rausb0
then in response I get a message saying that rausb0 is already up.

In state #2, I can use the manual iwconfig commands and dhclient to get wireless working, as in my previous post:
$ sudo iwconfig rausb0 essid (deleted)
$ sudo iwconfig rausb0 mode Managed
$ sudo iwconfig rausb0 channel 2
$ sudo iwconfig rausb0 key (deleted)
$ sudo dhclient rausb0
Internet Software Consortium DHCP Client 2.0pl5
...
DHCPDISCOVER on rausb0 to 255.255.255.255 port 67 interval 10
DHCPOFFER from 10.10.10.1

Alternatively, in state #2, I discovered I can just say:
$sudo ifup --force rausb0
The --force argument avoids the "rausb0 already up" message, and essentially does the same thing as manually doing the iwconfig/dhclient commands.

So in fact, I MUST be in state #2 and use one of these 2 methods to get my wireless working.

But what I REALLY want is to be able to get wireless working from state #1--where rausb0 is currently down. Obviously this is the state you're in at boot time. But while in state #1, any iwconfig commands results in the error "SET failed on device rausb0 ; Network is down. Error for wireless request...". And it is necessary for the iwconfig commands to succeed before the dhclient command will succeed.

So I see a catch-22 bug. rausb0 must be up in order for the iwconfig commands to succeed But the iwconfig commands must  succeed in order to *truly* bring rausb0 up (=have dhclient succeed). The only workaround is entering that weird state (state #2) where rausb0 is up but dhclient hasn't yet succeeded.

Now that's what I call messed up.  Any ideas for a fix?

Pizzapie



Reply to: