Bug 211436 - Link aggregation setting wlan mac changed in 11
Summary: Link aggregation setting wlan mac changed in 11
Status: Open
Alias: None
Product: Documentation
Classification: Unclassified
Component: Documentation (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-doc mailing list
URL:
Keywords: easy, patch
Depends on:
Blocks:
 
Reported: 2016-07-29 04:40 UTC by Randy Westlund
Modified: 2019-11-14 22:11 UTC (History)
6 users (show)

See Also:


Attachments
Fix the Ethernet+WiFi example (6.93 KB, patch)
2019-11-14 22:11 UTC, PauAmma
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Westlund 2016-07-29 04:40:42 UTC
The handbook shows setting up wifi/ethernet failover like this:

> ifconfig_bge0="up"
> ifconfig_iwn0="ether 00:21:70:da:ae:37"
> wlans_iwn0="wlan0"
> ifconfig_wlan0="WPA"
> cloned_interfaces="lagg0"
> ifconfig_lagg0="laggproto failover laggport bge0 laggport wlan0 DHCP"

As of FreeBSD 11, this no longer works.  The correct way is like this:

> ifconfig_bge0="up"
> create_args_wlan0="wlanaddr 00:21:70:da:ae:37"
> wlans_iwn0="wlan0"
> ifconfig_wlan0="WPA"
> cloned_interfaces="lagg0"
> ifconfig_lagg0="laggproto failover laggport bge0 laggport wlan0 DHCP"


The relevant section is 30.7, example 30.3.
https://www.freebsd.org/doc/handbook/network-aggregation.html

Relevant discussion on the mailing list:
https://docs.freebsd.org/cgi/getmsg.cgi?fetch=638990+0+current/freebsd-current
Comment 1 Jan Kokemüller 2016-08-02 09:50:29 UTC
According to this discussion/patch (https://lists.freebsd.org/pipermail/freebsd-current/2015-September/057403.html) it is better to change the MAC address of the Ethernet card instead of the wireless device. As an added bonus this should work for FreeBSD 9 and 10, too.
Comment 2 Randy Westlund 2016-08-03 06:03:18 UTC
Ah, thanks for the link.  In that case, I think the correct example should be this:

> ifconfig_bge0="ether 00:21:70:da:ae:37 up"
> wlans_iwn0="wlan0"
> ifconfig_wlan0="WPA"
> cloned_interfaces="lagg0"
> ifconfig_lagg0="laggproto failover laggport bge0 laggport wlan0 DHCP"
Comment 3 Jason W. Bacon freebsd_committer 2016-10-17 14:30:34 UTC
Neither the prescribed method for 11.x nor using the MAC of the wireless interface is working for me with 11.0-RELEASE.

The Ethernet interface works, but wireless failover does not connect:

Oct 17 08:59:09 oyster kernel: wlan0: link state changed to UP
Oct 17 08:59:09 oyster kernel: lagg0: link state changed to UP
Oct 17 08:59:09 oyster wpa_supplicant[21944]: wlan0: Associated with b0:7f:b9:01:aa:3b
Oct 17 08:59:09 oyster dhclient[22096]: send_packet: No buffer space available
Oct 17 08:59:14 oyster last message repeated 2 times
Oct 17 08:59:17 oyster wpa_supplicant[21944]: wlan0: CTRL-EVENT-DISCONNECTED bssid=b0:7f:b9:01:aa:3b reason=0
Oct 17 08:59:17 oyster kernel: wlan0: link state changed to DOWN
Oct 17 08:59:17 oyster kernel: lagg0: link state changed to DOWN
Oct 17 08:59:17 oyster wpa_supplicant[21944]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=1 ssid="MARITIME" auth_failures=2 duration=20 reason=CONN_FAILED
Oct 17 08:59:26 oyster dhclient[22096]: send_packet: Network is down

Both interfaces work fine without lagg, with the following config:

ifconfig_re0="DHCP"
wlans_urtwn0="wlan0"
ifconfig_wlan0="WPA DHCP"

This lagg config was working fine on 10.1:

ifconfig_re0="up"
ifconfig_urtwn0="ether e8:9a:8f:21:67:d3"
wlans_urtwn0="wlan0"
ifconfig_wlan0="WPA"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto failover laggport re0 laggport wlan0 DHCP"

I've tried this config, tried switching to

create_args_wlan0="wlanaddr e8:9a:8f:21:67:d3"

and tried 

ifconfig_re0="ether 80:1f:02:b6:a8:3e up"

instead of

ifconfig_urtwn0="ether e8:9a:8f:21:67:d3"

Any other suggestions?

Thanks,

   Jason
Comment 4 Erik Nordstrøm 2016-11-02 22:46:35 UTC
(In reply to Jason Bacon from comment #3)

Jason, was this in a fresh install or one with prior configurations?

I have a ThinkPad T520 running FreeBSD 11.0-RELEASE-p2.

Today I decided I wanted to set up failover link aggregation between the wired and wireless interfaces and I struggled a lot. It was first when I realized that I had previous configuration for one of the interfaces in /etc/rc.conf.local in addition to the configuration I had for the other interface in /etc/rc.conf.

I suggest you

grep -R re0 /etc/

and

grep -R urtwn0 /etc/

and perhaps even

grep -R wlan0 /etc/

on your computer to make sure that you don't have any other network configuration that interferes with the lagg0.

My working configuration is this:

- Given wired em0 real MAC aa:aa:aa:aa:aa:aa, and
- given wireless iwn0 real MAC bb:bb:bb:bb:bb:bb

I put the following in /etc/rc.conf:

ifconfig_em0="ether bb:bb:bb:bb:bb:bb up"
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA country NO"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto failover laggport em0 laggport wlan0 DHCP"

I live in Norway, so obviously use your country code in place of mine.

No other interface config should be present, or it might interfere.

In addition to this, I have my standard /etc/wpa_supplicant.conf from before unmodified.

I still have to manually

service netif restart lagg0

in order for the routing tables to update, and I might also have to

service dhclient restart lagg0

both of these because the networks I usually are separate for wired and wireless.

I wish to find a solution for that also but this bug is not the right place for me to talk about that, I just wanted to mention it for completeness.
Comment 5 Jason W. Bacon freebsd_committer 2016-11-19 18:14:46 UTC
God dag Erik,

Thanks for your reply.

This is a fresh installation.  I never use upgrade tools on any system. I'd rather improve my speed and proficiency with fresh installs, to avoid bit rot and other surprises, and to be ready to respond to quickly catastrophic hardware failures.  Hence sysutils/desktop-installer and sysutils/auto-admin.

I looked over your info and still no luck.  Your working config looks exactly like my original config, in fact.

I think we'll just have to wait until this issue is fixed upstream.

Cheers,

    Jason
Comment 6 Erik Nordstrøm 2016-11-19 18:28:13 UTC
(In reply to Jason Bacon from comment #5)

Sorry to hear that it didn't work. I hope it will get fixed so that it works for you some time in the not too distant future.

Meanwhile, in case you are willing to go through some extra trouble, I suggest that you consider buying an external USB WiFi module with a chipset that has good driver support in FreeBSD. This might be more hassle than it's worth, though? Also, having a WiFi module sticking out from your laptop on the move puts you at risk of destroying the module and the port if you or somebody else accidentally bump into it. Besides it could also be that the link aggregation problems are caused by the ethernet interface, who knows. You might try an USB ethernet interface as well, perhaps? At that point it gets quite ridiculous with the amount of extra cables and modules I suppose. Maybe it's not the best idea. Just something I came to think of.(In reply to Jason Bacon from comment #5)
Comment 7 Jason W. Bacon freebsd_committer 2016-11-20 01:20:53 UTC
I'm actually already using a USB wifi dongle, an Edimax EW-7811.  It only protrudes about 1cm and works pretty well.

The built-in chipset is RTL8188CE, for which there is no open source driver as of last time I checked.  I tried NDIS a while back, but it caused a kernel panic.  I know someone using the closed source Linux driver with some issues.

I installed 10.3-RELEASE and lagg failover is now working fine.  So we know it's limited to 11.0.

Thanks again for the suggestions.
Comment 8 PauAmma 2019-11-10 01:14:49 UTC
(In reply to Jason W. Bacon from comment #3)

> Neither the prescribed method for 11.x nor using the MAC of the wireless interface is working for me with 11.0-RELEASE.

Trying to move this forward, as using the wireless MAC address on the Ethernet NIC works for me on 12.1 whereas the method described in the handbook didn't: are you still having problems using this method with a supported release, 11.3 or 12.x?
Comment 9 Jason W. Bacon freebsd_committer 2019-11-10 23:55:17 UTC
This is currently working on my ThinkPad, using the MAC of the Ethernet interface:

ifconfig_em0="up"
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA"
create_args_wlan0="wlanaddr xx:xx:xx:xx:xx:xx"
cloned_interfaces="lagg0"
ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP"
ifconfig_lagg0_ipv6="inet6 accept_rtadv"

The same setup has worked on 11.2, 12.0, and 12.1.

This was generated by auto-wifi-failover, part of sysutils/auto-admin.
Comment 10 PauAmma 2019-11-11 02:24:09 UTC
(In reply to Jason W. Bacon from comment #9)

> wlans_iwn0="wlan0"

As https://lists.freebsd.org/pipermail/freebsd-current/2015-September/057403.html explains, setting the MAC address doesn't work on all wifi adapters. For example, it didn't work on my ath0, whereas setting the ethernet MAC address as suggested in comment 4 works for me. From my /etc/rc.conf:

# Link aggregation, re0+wlan0 -> lagg0
ifconfig_re0="ether b8:ee:65:5b:32:59"
wlans_ath0="wlan0"
ifconfig_wlan0="WPA"
create_args_wlan0="country FR"
cloned_interfaces="lagg0"
ifconfig_lagg0="up laggproto failover laggport re0 laggport wlan0 DHCP"
ifconfig_lagg0_ipv6="inet6 accept_rtadv"

Can you test whether setting the ethernet MAC address works for you as well so I can submit a doc patch either describing both methods (less than ideal IMO) or giving only the method setting the ethernet MAC address (if it works with all supported FreeBSD versions)?
Comment 11 Jason W. Bacon freebsd_committer 2019-11-12 20:24:30 UTC
Yes, setting em0 to use the wifi MAC address also works for me.

I'll update auto-wifi-failover accordingly.
Comment 12 Jason W. Bacon freebsd_committer 2019-11-13 01:34:03 UTC
Using the wireless MAC fixed lagg on my Toshiba Satellite as well (with atheros and re).  lagg didn't work when I did the install and I didn't have time to investigate, so I just disabled it until now.
Comment 13 PauAmma 2019-11-14 22:11:12 UTC
Created attachment 209155 [details]
Fix the Ethernet+WiFi example

- Swap the procedure around to change the Ethernet interface address instead of the wireless interface.
- Change the Ethernet and wireless interface names and MAC addresses to mine (re0 and ath0 instead of bge0 and iwn0).
- Tweak some markup and wording while I'm here.

Tested with lynx.