Comment 2 for bug 80499

Revision history for this message
Stephen Gornick (sgornick) wrote : Re: Changing ESSID requires reboot or, or manual iwconfig for changes to take effect

I did some more troubleshooting. I can get the exact same results by manually editing the /etc/networking/interfaces and restarting networking thus yes -- I mis-categorized this bug report by selecting "gnome-system-tools" package. I don't know if the problem is in the ifupdown package, or wireless-tools (iwconfig), or elsewhere?

What appears to be happening is that any values the card uses during startup are retained until they are explicitly changed using iwconfig. For instance, my config file (/etc/network/interfaces) has:
auto eth1
iface eth1 inet dhcp
wireless-essid WORKACCESSPOINT
wireless-key s:WORKWEPKEY
but since I am at home these values are invalid. So I boot (and get no connectivity) and then edit the config file to change the essid line to "wireless-essid HOMEACCESSPOINT" and remove the entry for "key". Even if I do "$ sudo /etc/init.d/networking restart" it appears that it still is trying to do WEP authentication. Unless I explicitly issue an "$ sudo iwconfig eth1 key off" first, the ifup appears to still attempt to use the WEP key that was in the config file during boot -- even though the wireless-key line has been removed.

So the problem appears to be that "$ sudo /etc/init.d/networking restart" isn't starting the network similar to how it starts from a power-off condition and instead it only changes the values that are explicitly listed in the /etc/network/interfaces.

Here's another example.
With an invalid essid in the config file at boot, if I then do an "$ iwconfig eth1", it will list frequency 2.437 GHz which is Channel 06 -- the first access point found when I "$ iwlist eth1 scanning" is channel 6 so I am suspecting that this is why it show this specific frequency. After I change the config file to "wireless-essid HOMEACCESSPOINT" and then restart networking, the dhclient part of the restart will still report NO DHCPOFFERS". I then do "$ iwconfig eth1" which now shows the correct ESSID but it still shows the 2.437 GHz frequency, and it also still shows "Access Point: Invalid". If I make no further changes to the config file and then reboot, I'll get a connection no problem. But to get the changes to the config file to take effect without rebooting I need to manually do:
  $ sudo iwconfig eth1 channel 11 essid "HOMEACCESSPOINT"
  $ sudo /etc/init.d/networking restart
and it then restarts and connects no problem.

To answer your question about whether or not dhcp server is at fault, I get the same problem at work (Airport Extreme AP) as at home (Linksys BEFWS114 router), so I don't think dhcp server is at fault -- especially since every dhclient subsequent to an iwconfig (with channel, essid, and key) is always successful.

Is what I am experiencing (changes to config not taking effect until iwconfig or reboot) unique?