# Link aggregation & WPA: works on boot but fails on netif restart



## sim (Feb 10, 2013)

Hi

I'm having another go at getting link aggregation working on my laptop.  Unlike my previous attempt, I'm having more success now.

On boot, the lagg0 interface (em0 & wlan0) seems to work as expected. However, if I restart the network (/etc/rc.d/netif restart) the wlan0 interface repeatedly connects and disconnects from the wireless AP and I have no network until reboot:


```
Feb 10 17:53:43 TMA1 kernel: wlan0: link state changed to DOWN
Feb 10 17:53:43 TMA1 kernel: lagg0: link state changed to DOWN
Feb 10 17:53:43 TMA1 wpa_supplicant[3143]: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
Feb 10 17:53:43 TMA1 wpa_supplicant[3143]: CTRL-EVENT-DISCONNECTED bssid=00:04:ed:57:8c:83 reason=0
Feb 10 17:53:43 TMA1 wpa_supplicant[3143]: Failed to initiate AP scan.
Feb 10 17:53:46 TMA1 last message repeated 3 times
Feb 10 17:53:46 TMA1 wpa_supplicant[3092]: Trying to associate with 00:04:ed:57:8c:83 (SSID='Ultragreen' freq=2427 MHz)
Feb 10 17:53:46 TMA1 wpa_supplicant[3143]: Trying to associate with 00:04:ed:57:8c:83 (SSID='Ultragreen' freq=2427 MHz)
Feb 10 17:53:46 TMA1 wpa_supplicant[3092]: Associated with 00:04:ed:57:8c:83
Feb 10 17:53:46 TMA1 kernel: wlan0: link state changed to UP
Feb 10 17:53:46 TMA1 kernel: lagg0: link state changed to UP
Feb 10 17:53:46 TMA1 wpa_supplicant[3143]: Associated with 00:04:ed:57:8c:83
Feb 10 17:53:47 TMA1 wpa_supplicant[3092]: WPA: Invalid EAPOL-Key MIC when using TPTK - ignoring TPTK
Feb 10 17:53:47 TMA1 wpa_supplicant[3092]: WPA: Could not verify EAPOL-Key MIC - dropping packet
```

Am I missing a step in restarting the network?  I know that restarting should not normally be necessary but I do find it useful especially when roaming between disparate locations.

For the record my network config is as per the handbook on lagg0:


```
hostname="TMA1"

# iwn0 native mac address: 00:24:d7:6a:7f:58
# em0 native mac address: f0:de:f1:24:9a:40

ifconfig_em0="up"
ifconfig_iwn0="ether f0:de:f1:24:9a:40"
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto failover laggport em0 laggport wlan0 DHCP"
```

Thanks for any insights,

sim


----------



## fonz (Feb 10, 2013)

I don't usually need to restart networking, so I forgot about this. But your story sounded familiar, so I tried. And sure enough it turns out I'm (still) having pretty much the same problem: networking works fine on boot (which tends to be all I need), but not after restarting. I have pretty much the same lines in /etc/rc.conf (except different interfaces and MAC addresses of course) as you do. I have no idea what's causing it, but I'll look into it.


----------



## sim (Feb 11, 2013)

That's interesting, at least it's not just me.  I'm going to look into this some more and will also post again if I make any progress. 

The odd thing is, once the problem occurs after an attempts to netif restart, I can't find any way to recover the situation even manually at the command line, without rebooting. Not ideal!

sim


----------



## fonz (Feb 11, 2013)

sim said:
			
		

> and will also post again if I make any progress.


Please do. Even observations like: "It doesn't happen when I don't use link aggregation" or "It doesn't happen if I (if possible) use WEP instead of WPA" or that sort of thing might still help to at least pinpoint _where_ the problem is.


----------



## sim (Feb 12, 2013)

Hi, 

It certainly doesn't happen when I go back to my previous non-lagg configuration (which in fact I've had to do as the link aggregation setup described above hit the restart problem when I moved between home and work yesterday.  So for now I'm back to manually switching between cable and wireless, but I won't give up on lagg.

I haven't tried without WPA but that could be a good move as the problem does appear to manifest itself in the wpa_supplicant log.  I'll try to set up a temporary open network when I get a mo, to confirm.

sim


----------

