# Connecting to an open wireless network

## wbecker

Hi,

I am trying to connect to a open wireless network that has been set to allow my MAC address - I've double checked that my MAC address is in there!

The problem i get is that it will not connect: looking at dmesg I get this repeated over and over again:

 *Quote:*   

> wlan0: Initial auth_alg=0
> 
> wlan0: authenticate with AP 00:1a:70:6a:f5:2c
> 
> wlan0: RX deauthentication from 00:1a:70:6a:f5:2c (reason=7)
> ...

 

I have KNetworkManager set up. It can detect all the networks including the one I am connecting to and can see the ssid of the one I am trying to access without a lock next to it.

I have wpa_supplicant going too, cat wpa_supplicant.conf:

 *Quote:*   

> network={
> 
>         ssid="brainfry"
> 
>         key_mgmt=NONE
> ...

 

and

here is my /etc/conf.d/net:

 *Quote:*   

> ###WIRELESS###
> 
> modules=( "wpa_supplicant" )
> 
> wpa_supplicant_wlan0="-Dwext -c /etc/wpa_supplicant/wpa_supplicant.conf"
> ...

 

Is there something obvious I am doing wrong or should I muck about with the router some more?

----------

## queen

 *wbecker wrote:*   

> Hi,
> 
> I am trying to connect to a open wireless network that has been set to allow my MAC address - I've double checked that my MAC address is in there!
> 
> The problem i get is that it will not connect: looking at dmesg I get this repeated over and over again:
> ...

 

Did you enabled the ssid of the network before you tried to connect?

You need to do the following things: 

```
iwlist wlan0 scan

```

After you see the name of the network you want to connect is to enable it:

```
iwconfig wlan0 essid <name of the network you want to connect>

dhcpcd wlan0
```

----------

## wbecker

Thanks for the reply.

I did what you said and got this as a result:

dmesg:

 *Quote:*   

> wmaster0: Selected rate control algorithm 'iwl-4965-rs'
> 
> wpa_supplicant[25042]: segfault at 0000000000000048 rip 000000000041f18d rsp 00007fff4512eda0 error 4
> 
> wlan0: Initial auth_alg=0
> ...

 

dhcpcd wlan0:

 *Quote:*   

> Error, wlan0: timed out

 

ifconfig:

 *Quote:*   

> wlan0     Link encap:Ethernet  HWaddr 00:13:E8:D4:0D:27
> 
>           inet addr:169.254.108.208  Bcast:169.254.255.255  Mask:255.255.0.0
> 
>           UP BROADCAST MULTICAST  MTU:1500  Metric:1
> ...

 

iwconfig:

 *Quote:*   

> wlan0     IEEE 802.11g  ESSID:"brainfry"
> 
>           Mode:Managed  Frequency:2.462 GHz  Access Point: 00:1A:70:6A:F5:2C
> 
>           Retry min limit:7   RTS thr:off   Fragment thr=2346 B
> ...

 

It knows about it, it just doesn't want to connect to it!

----------

## devilheart

wpa_supplicant man page says you must not put a space between -c and /etc/wpa_supplicant/wpa_supplicant.conf

as far as I know networkmanager dislikes wpa_supplicant.conf and other network configuration files

----------

## wbecker

Hi,

I made that change in /etc/conf.d/net, it now looks like 

 *Quote:*   

> modules=( "wpa_supplicant" )
> 
> wpa_supplicant_wlan0="-Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf"
> 
> config_wlan=( "dhcp" )
> ...

 

But it doesn't seem to have done much except to prevent the segfault reported in dmesg.

It doesn't seem to work with either using iwconfig and dhcpcd or knetworkmanager still

----------

## queen

 *wbecker wrote:*   

> Thanks for the reply.
> 
> I did what you said and got this as a result:
> 
> dmesg:
> ...

 

How you specified the command of dhcpcd? with the -t flag or without. It's important to give it more time than the standard. It didn't connect because the signal from the network is low. your wifi card is not synced with that network. You have an authentication problem as well. You have 2 options:

```
iwlist wlan0 scan
```

 and see what it shows about last beacon. This will show you how syncronized you are with  the 2nd network. if you get a small number it's ok. if you get a big number more than 1000 you are not synced. In this case you should change location to get a better signal.  Also run the last command several times to see how last beacon number changes.

----------

## wbecker

I am not sure what you mean by "last beacon". I ran "iwlist wlan0 scan" and got:

 *Quote:*   

> wlan0     Scan completed :
> 
>           Cell 01 - Address: 00:19:DB:0B:D5:D9
> 
>                     ESSID:"wlan-ap"
> ...

 

I am trying to connect to brainfry, which it says has quality 81/100. It's just in the next room. What do you mean by sync and beacon number?

----------

## queen

 *wbecker wrote:*   

> I am not sure what you mean by "last beacon". I ran "iwlist wlan0 scan" and got:
> 
>  *Quote:*   wlan0     Scan completed :
> 
>           Cell 01 - Address: 00:19:DB:0B:D5:D9
> ...

 

This is what I get 

```
iwlist eth2 scan

eth2      Scan completed :

          Cell 01 - Address: 00:0F:66:82:0A:B6

                    ESSID:"<hidden>"

                    Protocol:IEEE 802.11g

                    Mode:Master

                    Channel:10

                    Encryption key:off

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s

                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

                              48 Mb/s; 54 Mb/s

                    Quality=82/100  Signal level=-48 dBm

                    Extra: Last beacon: 40ms ago

```

Last beacon tells you if the router is synchronized with the wifi card. if it's a large number it means it's not synced. 

I also think that in the command of iwconfig you might want to specify the channel, because you have many cells there. brainfry is dhcp enabled?

brainfry knows about wlan0? because you have authentication error. 

I don't know why iwconfig doesn't show you the last beacon.

----------

## wbecker

Found the problem: my MAC address had been typed in the router wrong.

Everything works perfectly now!

Sorry for wasting everyones time.

----------

