1251a lagg0 and wlan0 - Link aggregation & network interface dependency issue - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Networking

Networking Network related discussions (including general TCP/IP stuff, routing, etc).

Reply
 
Thread Tools Display Modes
  #1  
Old June 7th, 2012, 19:18
sim's Avatar
sim sim is offline
Member
 
Join Date: Nov 2008
Location: The Spacetime Continuum
Posts: 154
Thanks: 34
Thanked 5 Times in 3 Posts
Default lagg0 and wlan0 - Link aggregation & network interface dependency issue

Hi

I'm experiencing a problem with link aggregation on my laptop. lagg0 aggregates my wired and wireless interfaces (em0 and wlan0 respectively) as described in the handbook. It works "manually", but when configured by rc.conf there appears to be a problem due to the wlan0 interface not being ready before the lagg0 is configured.

My rc.conf snippet:

Code:
ifconfig_em0="ether 00:24:d7:6a:7f:58 up"
ifconfig_iwn0="up"
wlans_iwn0="wlan0"
ifconfig_wlan0="country GB WPA up"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto failover laggport em0 laggport wlan0 DHCP SYNCDHCP up"
Starting the interfaces via rc.d:

Code:
root@tma1> /etc/rc.d/netif start
ifconfig: create: bad value
ifconfig: SIOCS80211: Device busy
Starting wpa_supplicant.
ifconfig: SIOCSLAGGPORT: Device busy
Starting dhclient.
lagg0: no link .............. giving up
/etc/rc.d/dhclient: WARNING: failed to start dhclient
Starting Network: lo0 em0 iwn0 lagg0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 ::1 prefixlen 128 
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
        ether 00:24:d7:6a:7f:58
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect
        status: no carrier
iwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:24:d7:6a:7f:58
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11ng
        status: associated
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
        ether 00:24:d7:6a:7f:58
        inet6 fe80::224:d7ff:fe6a:7f58%lagg0 prefixlen 64 scopeid 0x6 
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect
        status: no carrier
        laggproto failover lagghash l2,l3,l4

laggport: wlan0 flags=4<ACTIVE> <--- this line is missing 

        laggport: em0 flags=1<MASTER>
root@tma1>
By elimination I'm pretty sure the "bad value" message comes from the "laggport wlan0" clause in the ifconfig_lagg0 rc.conf line.

If I then manually enter ifconfig lagg0 laggport wlan0 then all is well, however that is no good during boot and as a result a load of my boot processes are failing due to no network.

I can't see any way to force lagg0 configuration to wait for its component interfaces to be configured (wlan0 instantiation apparently being non-instantaneous).

Can anyone suggest solutions/hacks/commiserations?

Much obliged,

sim
__________________
There's no place like ~

Last edited by sim; June 9th, 2012 at 00:28. Reason: more formatting
Reply With Quote
  #2  
Old June 8th, 2012, 19:47
sim's Avatar
sim sim is offline
Member
 
Join Date: Nov 2008
Location: The Spacetime Continuum
Posts: 154
Thanks: 34
Thanked 5 Times in 3 Posts
Default

In case anyone is interested, I have found a possible workaround which, at least on first inspection, appears to work:

Add to devd.conf:
Code:
notify 0 {
match "system" "IFNET";
match "subsystem" "wlan0";
match "type" "LINK_UP";
media-type "802.11";
action "ifconfig lagg0 laggport wlan0";
};
I'll mark this as SOLVED (for now...).

sim
__________________
There's no place like ~
Reply With Quote
  #3  
Old June 8th, 2012, 20:17
sim's Avatar
sim sim is offline
Member
 
Join Date: Nov 2008
Location: The Spacetime Continuum
Posts: 154
Thanks: 34
Thanked 5 Times in 3 Posts
Default

PS: and remove
Code:
laggport wlan0
from the ifconfig_lagg0 clause in rc.conf.

sim
__________________
There's no place like ~

Last edited by DutchDaemon; June 8th, 2012 at 22:39.
Reply With Quote
  #4  
Old June 9th, 2012, 00:28
sim's Avatar
sim sim is offline
Member
 
Join Date: Nov 2008
Location: The Spacetime Continuum
Posts: 154
Thanks: 34
Thanked 5 Times in 3 Posts
Default

I wrote too soon, this solution does not work. I'm not sure why I thought it did!

With the devd.conf hack in place, boot fails because of the following sequence:

1) lagg0 initially configured with em0 only (intentional)
2) SYNCDHCP clause on lagg0 causes lagg0 to try to get a DHCP configuration from the (not connected) cable LAN. This obviously fails.
3) wlan0 eventually shows up.
4) devd.conf rule is triggered to add wlan0 to lagg0, which it does successfully.
5) However lagg0 doesn't try to configure itself with DHCP again, even though it could now do so successfully.
6) A bunch of network dependent services fail (ntp, nfs*, mountd et al), (i.e those which "REQUIRES: NETWORKING"). They think NETWORKING is enabled (which it is) but don't realise it didn't get configured properly. In fact it's worse because each service blocks for 30-60 seconds before giving up.

For now I've removed the link aggregation stuff and have gone back to wlan only.

sim
__________________
There's no place like ~
Reply With Quote
  #5  
Old June 9th, 2012, 04:22
ondra_knezour ondra_knezour is online now
Member
 
Join Date: Nov 2008
Location: Prague, Czech Republic, Europe
Posts: 215
Thanks: 9
Thanked 29 Times in 28 Posts
Default

Did you try exact config as described in Handbook as first?

In your case something like
Code:
ifconfig_bge0="up"
ifconfig_iwn0="ether 00:24:d7:6a:7f:58"
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA" #country settings may wait to next iteration :)
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto failover laggport bge0 laggport wlan0 DHCP"
From rc.conf
Quote:
Code:
synchronous_dhclient
(bool) Set to ``YES'' to start dhclient(8) synchronously at startup.  This behavior can be overridden on
a per-interface basis by replacing the ``DHCP'' keyword in the ifconfig_<interface> variable with
``SYNCDHCP'' or ``NOSYNCDHCP''.

Last edited by DutchDaemon; June 9th, 2012 at 23:14.
Reply With Quote
  #6  
Old June 9th, 2012, 04:26
ondra_knezour ondra_knezour is online now
Member
 
Join Date: Nov 2008
Location: Prague, Czech Republic, Europe
Posts: 215
Thanks: 9
Thanked 29 Times in 28 Posts
Default

Quote:
Originally Posted by sim View Post
4) devd.conf rule is triggered to add wlan0 to lagg0, which it does successfully.
5) However lagg0 doesn't try to configure itself with DHCP again, even though it could now do so successfully.
What about
Code:
action "ifconfig lagg0 laggport wlan0 && dhclient lagg0";
Reply With Quote
  #7  
Old June 9th, 2012, 06:16
wblock@'s Avatar
wblock@ wblock@ is online now
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,701
Thanks: 429
Thanked 1,757 Times in 1,456 Posts
Default

Restart dhclient(8):
# pkill dhclient && dhclient lagg0

But lagg(4) doesn't help if there's only one interface assigned to it.
Reply With Quote
  #8  
Old June 10th, 2012, 02:10
zeissoctopus zeissoctopus is offline
Member
 
Join Date: Aug 2009
Location: Hong Kong
Posts: 112
Thanks: 149
Thanked 21 Times in 14 Posts
Default

I follow the handbook to configure lagg0 in my notebook without any problem. I review your rc.conf, you does not exactly follow the handbook's template. May be this is the cause led to failure.

Quote:
Originally Posted by sim View Post
My rc.conf snippet:

Code:
ifconfig_em0="ether 00:24:d7:6a:7f:58 up"
ifconfig_iwn0="up"
wlans_iwn0="wlan0"
ifconfig_wlan0="country GB WPA up"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto failover laggport em0 laggport wlan0 DHCP SYNCDHCP up"
However, the template in handbook does:
  1. to enable ethernet interface
  2. to write down the ethernet interface's MAC address in paper
  3. to enable wireless interface, at the same time, to rewrite the wireless interface's MAC address and sync it with ethernet interface's MAC address by "ifconfig ether" command
  4. create wlan0 interface
  5. configure wlan0 interface with WPA options
  6. clone lagg0 interface
  7. configure lagg0 to enable failover with [FILE]em0{/FILE] and wlan0
  8. dhclient lagg0 to catch ip address and dns servers.

In you rc.conf, the sqeunce of synchronize MAC addresses between em0 and iwn0 do not follow the template of Handbook.

Last edited by zeissoctopus; June 10th, 2012 at 02:16.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Link Aggregation using the SIOCSLAGG ioctl request Siddharth_Rao FreeBSD Development 1 February 24th, 2012 10:03
[Solved] Link aggregation Problem sk8harddiefast Networking 1 December 19th, 2011 14:42
How do link aggregation/ethernet teaming work? olav Off-Topic 3 November 1st, 2010 10:39
tcpdump and Link Aggregation sonyk Networking 2 January 9th, 2010 07:08
Link Aggregation + VLan Trunk bloodhound Networking 2 March 19th, 2009 08:01


All times are GMT +1. The time now is 04:42.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0