# [WLAN] Crazy problem when ESSID hidden

## Master One

Yesterday I exchanged an older 11Mbit AP against a new Netgear WGR614 54Mbit AP, and now I have the following problem:

With the old AP, everything worked fine. I always use the same configuration, with ESSID not being broadcasted, WEP with 128bit and access limitation by MAC address. I have three machines connecting to this AP (one older Gericom Notebook with WinXP & WLAN PC-Card, one Siemens SimPad SL4 with WinCE & WLAN PC-Card, and one IBM Thinkpad T42p with Gentoo & embedded iwp2200).

So yesterday I configured the new Netgear WGR614 access-point the usual way, and my SimPad SL4 and the Gericom Notebook worked right from the beginning, but my ThinkPad just could not connect sucessfully. When trying to bring up the wireless interface, it gets this far:

```
Starting eth1

   Configuring wireless network for eth1

      eth1 connected to "WLAN" at xx:xx:xx:xx:xx:xx

      in managed mode (WEP enabled - open)

   Bringing up eth1

      dhcp

         Running dhcpd ...
```

Then it just waits until the dhcpd times-out, and the service does not get started ("[ !! ]").

I am using the latest ~x86 baselayout, and in my /etc/conf.d/wireless I just have

```
mac_essid_xxxxxxxxxxxx="WLAN"

key_WLAN="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx enc open"

preferred_aps=( "WLAN" )
```

which is the correct (and formerly working) way to handle an AP with hidden ESSID. I also tried

```
mac_key_xxxxxxxxxxxx="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx enc open"
```

but this didn't change anything. It is really strange, because I tried a lot of times, to bring eth1 up, and usually I get the above mentioned response, but a few times it just worked, and a few times it even stopped right after "Configuring wireless network for eth1", which is confusing, because it really shouldn't work on such a randomly basis.

The clue is now, that problem only is present, if the ESSID is hidden. If I enable the ESSID broadcast in the AP, it is working just fine on every try!

That problem is really going to make me insane, because I already tried so many options, without success, and formerly with my old AP everthing was working just fine with exectly the same settings. It works with WinCE & WinXP, but not with my Gentoo setup on my ThinkPad. I don't want to leave the ESSID broadcast on due to the lesser security (or does this really not matter any more nowadays?).

----------

## Master One

Noone any hint? Someone else surely has to have stumbled over such an issue as well.

So why should exchanging a wireless access-point (by keeping all settings the same) produce the need of changing settings on a Gentoo powered notebook, while WinXP & WinCE machines works without any changes further on?

Either I have overseen something in this setup, or there has to be a bug somewhere in the involved software.

----------

## UberLord

 *Master One wrote:*   

> Either I have overseen something in this setup, or there has to be a bug somewhere in the involved software.

 

Well, let us see if there is a bug somewhere. Please do the following

```

ifconfig eth1 down

ifconfig eth1 up

iwconfig eth1 essid WLAN

iwconfig eth1 key xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx enc open

dhcpcd eth1

```

If that works then there is a bug with my code, if not, then it's a bug with the card/driver or Access Point. My guess would be the Access point.

----------

## UberLord

I think I may have found a solution - try the following in /etc/conf.d/net

```
postassociate() {

        interface_down ${IFACE}

        interface_up ${IFACE}

}
```

----------

## UberLord

If this works, here's a patch to /lib/rcscripts/net.modules.d/iwconfig that should fix it for good  :Smile: 

```
Index: iwconfig

===================================================================

RCS file: /var/cvsroot/gentoo-src/rc-scripts/net-scripts/net.modules.d/iwconfig,vretrieving revision 1.7.2.20

diff -u -B -r1.7.2.20 iwconfig

--- iwconfig    8 Apr 2005 17:16:29 -0000       1.7.2.20

+++ iwconfig    26 Apr 2005 08:39:21 -0000

@@ -463,6 +463,13 @@

                return 1

        fi

+       # We need to HUP the interface after a scan as some drivers/cards/AP

+       # combos don't like associating to AP's afterwards

+       # This is mainly noticable when the AP you want to connect to is

+       # not broadcasting or faking its ESSID

+       interface_down ${iface}

+       interface_up ${iface}

+

        local val i=-1 IFS=$'\n' j last

        local -a qual

```

----------

## Master One

Damned, that didn't change anything. I was playing arround with that sh*t the whole evening, but no success. I tried latest iwp2200 (~x86 1.0.3, but reverted then back again to stable 1.0.1), latest wireless-tools (but reverted then back to the last stable version), tried two different firmwareversions for the WGR614v4, but it even got worse (not finding the AP at all). I reverted back to the state when I first tried, and at least everything is working fine, as long as I let the AP broadcast the ESSID.

This is really insane! My two other machines running WinCE & WinXP with two different other WLAN cards (old Siemens 11Mbit card for the SimPad SL4, and the Netgear WG511 (which came in the bundle with the AP) for my old Gericom notebook) worked all along, while my ThinkPad T42p had all those troubles, so generally I would say, it is not a problem with the access point.

I also do not see the connection beween ESSID broadcast on/off and the ability of my ThinkPad T42p with ipw2200 connecting to the AP, so it most likely is a problem with my Gentoo installation, or the ipw2200 driver. On the other hand, it worked without any problem on my old 11 Mbit DLINK WLAN access-point, so there would only be the possibilty, that the ipw2200 has issues with the 54 Mbit mode, or the "b & g" option of the Netgear access-point.

Whenever the connection seemed to be established, but running dhcpcd failed, there was nearly nothing unusual shown by iwconfig. This is the normal output with working connection:

```
eth1      IEEE 802.11g  ESSID:"WLAN"  Nickname:"WLAN"

          Mode:Managed  Frequency:2.457 GHz  Access Point: 00:09:5B:FF:BF:28

          Bit Rate=54 Mb/s   Tx-Power=255 dBm

          RTS thr:off   Fragment thr:off

          Encryption key:xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx   Security mode:open

          Power Management:off

          Link Quality=94/100  Signal level=-33 dBm  Noise level=-67 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:1
```

This is also shown exactly the same when that problems occure without ESSID broadcasting, except "Invalid misc" is showing something else than zero. With the mentioned problem present, ifconfig shows eth1 to be down. If I bring it up manually with "ifconfig eth1 up", and then run "dhcpcd eth1", which failes, eth1 is down afterwards again (but this may be normal in that situation). I am sorry, but there is really not any more info, I can provide concerning this issue.

At the moment I don't have WinXP installed on my ThinkPad, so I can't test this machine with the WinXP driver, but I assume, it will work just fine in WinXP.

There has to be an issue related to Linux/Gentoo/the ipw2200 driver.

Or is it really possible, that a certain WLAN interface just can not properly cooperate with an access point, when ESSID broadcast is switched off?

This problem is just too unusual.

As long as no solution is found, I'll have to stick with the ESSID broadcast option switched on, also I really do not like this idea.

Can anyone comment on the security situation, if ESSID broadcast is switched on?

----------

## UberLord

 *Master One wrote:*   

> Damned, that didn't change anything.

 

 :Sad: 

Well, it fixes the same issue for madwifi users.

 *Quote:*   

> 
> 
> As long as no solution is found, I'll have to stick with the ESSID broadcast option switched on, also I really do not like this idea.
> 
> Can anyone comment on the security situation, if ESSID broadcast is switched on?

 

Doesn't really make much difference. It would take slightly longer to crack, but that's purely to sniff the ESSID.

If you don't find a solution, then try out wpa_supplicant as it can connect to your WEP access point for you.

----------

## Master One

Hm, quit interesting, never heard of wpa_supplicant before. I just searched for more info, but I don't really understand, what the advantage of using wpa_supplicant is for my setup. My setup is pretty simple, and since it worked before the exchange of the AP without any problems, it should also work now with the new AP flawlessly (but it doesn't). Not sure what wpa_supplicant can change on this situation.

In anther thread, you mentioned, that the latest 1.11 baselayout series already supports wpa_supplicant.

Can you explain the interaction between wpa_supplicant ant the baselayout?

----------

## UberLord

wpa_supplicant is mainly used to handle wpa security.

However, it has evolved over time into a daemon that selects access points and applies the security you've configured it for.

Baselayout simply starts it up and then applies network configuration based on the AP it connected to.

The difference here is that my iwconfig code is simply not as good as wpa_supplicant's - and really can never be.

baselayout iwconfig - configures your wireless network card using the iwconfig command from wireless-tools

baselayout wpa_supplicant - configures your wireless network card using the wpa_supplicant daemon

Hope that explains the relationship.

----------

## Master One

Thanx for that explaination. One more thing:

Can you please tell me, what I have to change in the baselayout config when swapping from iwconfig to wpa_supplicant?

I mean, will have I have to change anything in /etc/conf.d/net and /etc/con.d/wireless, since wpa_supplicant has its own config file?

When using wpa_supplicant: Is wireless-tools completely unnecessary then, and can I unmerge it?

----------

## UberLord

 *Master One wrote:*   

> Can you please tell me, what I have to change in the baselayout config when swapping from iwconfig to wpa_supplicant?
> 
> I mean, will have I have to change anything in /etc/conf.d/net and /etc/con.d/wireless, since wpa_supplicant has its own config file?

 

The only wireless settings that they both share are setting stuff up based off ESSID. For example, you can share the below

```
config_WLAN=( "192.168.0.2/24" )

dns_servers_WLAN="192.168.0.1"

dns_domain_WLAN="your.domain"

```

 *Quote:*   

> When using wpa_supplicant: Is wireless-tools completely unnecessary then, and can I unmerge it?

 

Yes, it is unnecessary. However, there's no real need to uninstall it either.

----------

## Master One

 *UberLord wrote:*   

> The only wireless settings that they both share are setting stuff up based off ESSID. For example, you can share the below
> 
> ```
> config_WLAN=( "192.168.0.2/24" )
> 
> ...

 

But those are settings, which I let fetch by dhcpcd, so I assume I can leave /etc/conf.d/net as is, and delete /etc/conf.d/wireless, because those settings are handled by wpa_supplicant then, right?

(Sorry for bothering you with this, but I am not at my notebook at the moment, and I really need a quick fix for that issue now, I already spent too many hours analysing that problem)

----------

## UberLord

http://dev.gentoo.org/~uberlord/net-book/hb_part1_chap4.html

----------

## Master One

Hey, great addition to the Gentoo handbook, exactly what I was looking for. Unfortunately using wpa_supplicant did not solve the issue, it was suffering the exact same problem. Sometimes it could connect, but mostly just timed out on dhcpcd.

I now tried using uhcpc as replacement for dhcpcd on both utils (wireless-tools & wpa_supplicant), but again without success.

So still, either it's a Gentoo problem (something between establishing the connection and handing over to the dhcp client), or it's an ipw2200 problem. I tried different version of the ipw2200 driver, the latest ~x86 1.0.3 seems to have some issues (no idea what's wrong, but it even don't want to establish the connection to the AP), but 1.0.2-r1 seems to work better than formerly used 1.0.1.

Again to mention: With my former config and my former 11MBit AP everything was just working fine. After swaping over to my new 54MBit AP the problems began, especially when ESSID broadcast is disabled. So something seems to be handled differently now with the new AP, also all settings stayed the same.

Two other machines with WinXP/WinCE are just working fine and never had any issues, so it really is no AP / settings related problem.

My trouble making Gentoo notebook also can establish the connection to the AP most of the times, showing the AP ESSID and MAC address on interface start correctly, showing all settings with iwconfig correctly, but does not get a lease with the dhcp client, and that's it. That issue occures usually, when I disable ESSID broadcast in the AP, but I also experienced it from time to time with this option enabled.

I don't know, what else to try, I already tested so many thing, I am really pretty sick and tired of it. It generally seems to work pretty unstable and unpretendable since the swap of the AP, but I really can't blame the AP, if two other devices are working just fine with it.

----------

## ycUygB1

I was having the same problem, but here's what I found:

I have a laptop with an Atheros 5212 (madwifi) and a Netgear MA401 pcmcia (orinico_cs, Prism 2.5).  

The AP is a D-Link DI-624.

With hidden ESSID, the netgear always comes right up and gets an IP address. No problem.

The madwifi reports ESSID='' and refuses to associate.

This is the case with iwconfig or wpa_supplicant, with wep, and without encryption.

With broadcasted ESSID, both cards come up fine.

Now, I am aware that not broadcasting ESSID is not a real security measure, since a probe request 

will return the essid.    I am working on a network where the client 

has chosen not to broadcast essid.  

I also tried the suggestion outlined above by our UberLord,

ifconfig ath0 down

iwconfig ath0 essid foobar

ifconfig ath0 up

dhcpcd ath0

This just times out.  Putting the post_associate() code in hung also.  The patch to iwconfig hung, too.

Gentoo developers, stop flagellating yourselves.  It is a madwifi driver problem, not yours...

----------

## untiefe

Hi!

I have a very similar problem. My wireless card (rt2500) is working fine when I set it up manually, but the configuration in /etc/conf.d/wireless can't set the ESSID right (In the output of iwconfig everything is setup fine, but not the essid and the key). So net.ra0 does not start until I set the essid manually (iwconfig ra0 essid MYID). After setting the essid,  /etc/init.d/net.ra0 starts fine.

After I read this thread, I also tested to not hide the essid on my access point, and it worked fine as well.

It seems the essid is not set by the wireless-tools.

I use wireless-tools-27-r1 28_pre10 with rt2500-1.1.0_beta3.

It worked fine before I reinstalled my computer with an older version of wireless-tools (can't remember exactly which one) and an old rt2500-1.4.1

Bye, Michael

----------

## TenPin

My access point has the essid turned off. I had to have scan_ssid=1 set in the network block of wpa_supplicant.conf for my madwifi card to connect.

----------

## untiefe

 *TenPin wrote:*   

> My access point has the essid turned off. I had to have scan_ssid=1 set in the network block of wpa_supplicant.conf for my madwifi card to connect.

 

I still use WEP instead of WPA (I know its not very safe...) can I set it for WEP as well?

----------

