# [SOLVED] NetworkManager Macbook atheros always disassociate

## bonzai.it

After network-manager installation I was so happy, I finally can see (and maybe connect to) the wireless networks in my gnome panel. But unfortunately any time I try to connect to any wifi net I found I always get the same error regardless of security or auth types:

```
Oct 22 13:42:00 arkano wlan0: authenticate with AP 00:24:01:0b:37:1f

Oct 22 13:42:00 arkano wlan0: authenticated

Oct 22 13:42:00 arkano wlan0: associate with AP 00:24:01:0b:37:1f

Oct 22 13:42:00 arkano wlan0: RX AssocResp from 00:24:01:0b:37:1f (capab=0x431 status=0 aid=2)

Oct 22 13:42:00 arkano wlan0: associated

Oct 22 13:42:00 arkano wlan0: disassociating by local choice (reason=3)
```

I can auth myself but I get immediately disassociating!   :Twisted Evil: 

I order to resolve my perennial problem with my macbook wifi I have some question:

1. I would like to understand the relationship between my net.conf and gnome network-manager. Does it overwrite any previous setting?

2. Do I need the notorious madfiwi-ng driver or the ones provides by kernel does suffice?

3. Where the hell am I wrong?

Some useful informations:

```
lspci | grep Network

02:00.0 Network controller: Atheros Communications Inc. AR5418 802.11abgn Wireless PCI Express Adapter (rev 01)
```

```
/etc/conf.d/net (wlan related entry)

#### wlan0 ####

config_wlan0=("arping")

modules=( "!iwconfig" "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext -c /etc/wpa_supplicant/wpa_supplicant.conf"

wpa_timeout_lan0=60

mode_wlan0="mode managed"
```

```
iwconfig 

lo        no wireless extensions.

eth0      no wireless extensions.

wmaster0  no wireless extensions.

wlan0     IEEE 802.11abgn  Mode:Managed  Frequency:2.412 GHz  

          Access Point: Not-Associated   Tx-Power=20 dBm   

          Retry min limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:0  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

vboxnet0  no wireless extensions.
```

```
ifconfig

          wlan0     Link encap:Ethernet  HWaddr 00:1b:63:06:c1:56  

          inet6 addr: fe80::21b:63ff:fe06:c156/64 Scope:Link

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:1 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:23 (23.0 B)  TX bytes:0 (0.0 B)

wmaster0  Link encap:UNSPEC  HWaddr 00-1B-63-06-C1-56-77-6C-00-00-00-00-00-00-00-00  

          UP RUNNING  MTU:0  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
```

```
eix madwifi-ng

[I] net-wireless/madwifi-ng

     Available versions:  0.9.3.3 0.9.4 ~0.9.4-r1 0.9.4.4030.20090529 ~0.9.4.4100.20090929 {injection kernel_linux}

     Installed versions:  0.9.4.4030.20090529(13:33:46 22/10/2009)(kernel_linux -injection)

     Homepage:            http://www.madwifi-project.org/

     Description:         Next Generation driver for Atheros based IEEE 802.11a/b/g wireless LAN cards

[I] net-wireless/madwifi-ng-tools

     Available versions:  0.9.3.3 0.9.4 0.9.4.4030.20090529 ~0.9.4.4100.20090929

     Installed versions:  0.9.4.4030.20090529(19:19:57 16/10/2009)

     Homepage:            http://www.madwifi-project.org/

     Description:         Next Generation tools for configuration of Atheros based IEEE 802.11a/b/g wireless LAN cards

Found 2 matches.

eix wpa_supplicant

[I] net-wireless/wpa_supplicant

     Available versions:  0.6.4 0.6.9 [M]-*9999 {dbus debug eap-sim gnutls kernel_FreeBSD kernel_linux madwifi ps3 qt3 qt4 readline ssl wps}

     Installed versions:  0.6.9(18:54:59 09/10/2009)(dbus kernel_linux madwifi readline ssl -debug -eap-sim -gnutls -kernel_FreeBSD -ps3 -qt3 -qt4 -wps)

     Homepage:            http://hostap.epitest.fi/wpa_supplicant/

     Description:         IEEE 802.1X/WPA supplicant for secure wireless transfers

```

```
uname -a

Linux arkano 2.6.30-gentoo-r4 #5 SMP PREEMPT Thu Oct 8 20:12:07 CEST 2009 i686 Intel(R) Core(TM)2 CPU T7400 @ 2.16GHz GenuineIntel GNU/Linux
```

```
less /usr/src/linux/.config | grep -Ei '(ath|802)'

# CONFIG_MATH_EMULATION is not set

# CONFIG_VLAN_8021Q is not set

CONFIG_CFG80211=y

# CONFIG_CFG80211_REG_DEBUG is not set

CONFIG_LIB80211=y

# CONFIG_LIB80211_DEBUG is not set

CONFIG_MAC80211=y

CONFIG_MAC80211_RC_MINSTREL=y

# CONFIG_MAC80211_RC_DEFAULT_PID is not set

CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y

CONFIG_MAC80211_RC_DEFAULT="minstrel"

# CONFIG_MAC80211_MESH is not set

CONFIG_MAC80211_LEDS=y

# CONFIG_MAC80211_DEBUG_MENU is not set

CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"

# CONFIG_WLAN_PRE80211 is not set

CONFIG_WLAN_80211=y

# CONFIG_MAC80211_HWSIM is not set

CONFIG_ATH5K=m

# CONFIG_ATH5K_DEBUG is not set

CONFIG_ATH9K=m

# CONFIG_ATH9K_DEBUG is not set

# CONFIG_LEDS_BD2802 is not set

# CONFIG_RTC_DRV_BQ4802 is not set
```

```
lsmod

Module                  Size  Used by

ipv6                  263796  12 

vboxnetadp             86120  0 

vboxnetflt             93224  0 

vboxdrv               128520  1 vboxnetflt

snd_hda_codec_idt      56768  1 

ath9k                 317588  0 

ohci1394               31332  0 

snd_hda_intel          25000  1 

snd_hda_codec          60212  2 snd_hda_codec_idt,snd_hda_intel

isight_firmware         2740  0 
```

----------

## d2_racing

Hi, I'm not sure on that, but you don't need to use at all madwifi-ng, in fact use the module ath5k or ath9k from the kernel and you will be good to go.

Also, you should try this line too :

```

wpa_supplicant_wlan0="-Dwext" 

```

----------

## Master of the Darkside

Here's my setup, I have an atheros card, maybe it will help you:

/etc/conf.d/net

```

config_eth0=( "none ")

modules_wlan0=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

config_SDP=( "dhcp" )

config_BANDRIDGE=( "dhcp" )

config_home=( "192.168.1.4" )

routes_home=( "default via 192.168.1.1" )

```

/etc/wpa_supplicant.conf

```

ctrl_interface=/var/run/wpa_supplicant

ap_scan=1

network={

        ssid="SDP"

        proto=WPA

        key_mgmt=WPA-PSK

        pairwise=TKIP

        group=TKIP

        psk=9b9662a08adb18c9b7850204a3b55a8fcdc00285751dc91d89c96ece0ab4675

        wpa_ptk_rekey=600

}

network={

        ssid="home"

        key_mgmt=NONE

}

network={

        ssid="BANDRIDGE"

        key_mgmt=NONE

}

```

Also, use the kernel module ath5k, not the madwifi-ng driver.

----------

## bonzai.it

 *d2_racing wrote:*   

> Also, you should try this line too :
> 
> ```
> wpa_supplicant_wlan0="-Dwext" 
> ```
> ...

 

I already had it in my /etc/conf.d/net, I also tried without config flag but still the same result.

```
wpa_supplicant_wlan0="-Dwext -c /etc/wpa_supplicant/wpa_supplicant.conf"
```

Thanks Master of the Darkside but I guess that network-manager use his own settings so /etc/wpa_supplicant.conf is quite useless (maybe just general settings as ap_scan or ctrl_interface).

Does anybody know how to get a some more detailed log?

----------

## Master of the Darkside

I also used to use wicd but it failed with some wireless networks for the exact same reason, and switching back to wpa_supplicant and the classic gentoo way of connecting solved it for me.

----------

## d2_racing

Ok, so remove the mad package and reboot.

```

# lsmod

# ifconfig -a

# iwconfig

# rc-update show

# /etc/init.d/net.wlan0 start

# dmesg | tail

# wpa_cli status

```

What happen when you run all these commands ?

----------

## bonzai.it

That's all you requested....

ath9k is now built in in the kernel

```
lsmod

Module                  Size  Used by

ipv6                  261748  12 

snd_hda_codec_idt      58108  1 

snd_hda_intel          24968  1 

isight_firmware         2716  0 

ohci1394               30636  0 

snd_hda_codec          60156  2 snd_hda_codec_idt,snd_hda_intel
```

```
ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:1b:63:1c:5f:19  

          inet addr:137.204.215.200  Bcast:137.204.215.255  Mask:255.255.255.0

          inet6 addr: fe80::21b:63ff:fe1c:5f19/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:805 errors:0 dropped:0 overruns:0 frame:0

          TX packets:406 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:198221 (193.5 KiB)  TX bytes:57363 (56.0 KiB)

          Interrupt:16 

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:49 errors:0 dropped:0 overruns:0 frame:0

          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:21249 (20.7 KiB)  TX bytes:21249 (20.7 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:1b:63:06:c1:56  

          inet6 addr: fe80::21b:63ff:fe06:c156/64 Scope:Link

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wmaster0  Link encap:UNSPEC  HWaddr 00-1B-63-06-C1-56-77-6C-00-00-00-00-00-00-00-00  

          UP RUNNING  MTU:0  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
```

```
iwconfig 

lo        no wireless extensions.

eth0      no wireless extensions.

wmaster0  no wireless extensions.

wlan0     IEEE 802.11abgn  Mode:Managed  Frequency:2.437 GHz  

          Access Point: Not-Associated   Tx-Power=20 dBm   

          Retry min limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:0  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
```

```
rc-update show 

       915resolution | battery      default                  

           alsasound |         boot                          

            bootmisc |         boot                          

             checkfs |         boot                          

           checkroot |         boot                          

               clock |         boot                          

         consolefont |         boot                          

                dbus |              default                  

                hald | battery      default                  

            hostname |         boot                          

             keymaps |         boot                          

               local | battery      default nonetwork        

          localmount |         boot                          

             modules |         boot                          

              net.lo |         boot                          

            netmount | battery      default                  

      NetworkManager |              default                  

      postgresql-8.3 | battery      default                  

           rmnologin |         boot                          

                sshd | battery      default                  

           syslog-ng | battery      default                  

             urandom |         boot                          

          vixie-cron | battery      default    
```

```
/etc/init.d/net.wlan0 restart

 * Stopping wlan0

 *   Bringing down wlan0

 *     Shutting down wlan0 ...                                                                                                                         [ ok ]

 *     Stopping wpa_cli on wlan0 ...                                                                                                                   [ ok ]

 *     Stopping wpa_supplicant on wlan0 ...                                                                                                            [ ok ]

 * Starting wlan0

 *   Starting wpa_supplicant on wlan0 ...                                                                                                              [ ok ]

 *   Starting wpa_cli on wlan0 ...                                                                                                                     [ ok ]

 *     Backgrounding ...
```

```
dmesg | tail 

input: Logitech USB Receiver as /class/input/input15

generic-usb 0003:046D:C501.0006: input: USB HID v1.10 Mouse [Logitech USB Receiver] on usb-0000:00:1d.1-1/input0

wlan0: no IPv6 routers present

wlan0: authenticate with AP 00:13:46:96:9f:87

wlan0: authenticated

wlan0: associate with AP 00:13:46:96:9f:87

wlan0: RX AssocResp from 00:13:46:96:9f:87 (capab=0x431 status=0 aid=576)

wlan0: associated

wlan0: disassociating by local choice (reason=3)

ADDRCONF(NETDEV_UP): wlan0: link is not ready
```

```
wpa_cli status

Selected interface 'wlan0'

bssid=00:00:00:00:00:00

ssid=

id=0

pairwise_cipher=UNKNOWN

group_cipher=UNKNOWN

key_mgmt=UNKNOWN

wpa_state=ASSOCIATED

```

----------

## pappy_mcfae

Keep it simple!

You need to change this:

```
/etc/conf.d/net (wlan related entry)

#### wlan0 ####

config_wlan0=("arping")

modules=( "!iwconfig" "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext -c /etc/wpa_supplicant/wpa_supplicant.conf"

wpa_timeout_lan0=60

mode_wlan0="mode managed"
```

to this

```

#### wlan0 ####

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

config_wlan0=( "dhcp" )

```

Then retry. 

Blessed be!

Pappy

----------

## d2_racing

Also, built your wireless module as module, not built in inside the kernel.

----------

## d2_racing

Can you post this :

```

# iwlist scan

```

----------

## bonzai.it

Done!

I've looked at this address http://www.gentoo-wiki.info/HOWTO_NetworkManager and I've found that networkmanager needs dhcdbd in order to work. These are my networkmanager use flags

```
emerge -pv networkmanager

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] net-misc/networkmanager-0.7.1-r6  USE="dhclient dhcpcd gnutls nss -avahi -connection-sharing -doc -resolvconf" 0 kB
```

```
rc-update show

       915resolution | battery      default                  

           alsasound |         boot                          

            bootmisc |         boot                          

             checkfs |         boot                          

           checkroot |         boot                          

               clock |         boot                          

         consolefont |         boot                          

               cupsd |              default                  

                dbus |              default                  

              dhcdbd |              default                  

                hald | battery      default                  

            hostname |         boot                          

             keymaps |         boot                          

               local | battery      default nonetwork        

          localmount |         boot                          

             modules |         boot                          

              net.lo |         boot                          

            netmount | battery      default                  

      NetworkManager |              default                  

      postgresql-8.3 | battery      default                  

           rmnologin |         boot                          

                sshd | battery      default                  

           syslog-ng | battery      default                  

             urandom |         boot                          

          vixie-cron | battery      default    
```

 *pappy_mcfae wrote:*   

> Keep it simple! 

 

 *d2_racing wrote:*   

> Also, built your wireless module as module, not built in inside the kernel. 

 

I did it! Thank you

So summarizing Atheros AR5418 does NOT need madwifi-ng (ath9k driver works fine) and my /etc/conf.d/net is quite essential. I've also disabled eth0 and wlan0 in my rc, by now it will a networkmanager problem bring them up.

----------

## d2_racing

Good  :Razz: 

----------

