Solved lagg not working on cold boot

Hello, I've tried to setup a lagg interface on my laptop by aggregating the ethernet & wifi interface on my laptop. If followed the example 31.3 from the doc

On reboot, the lagg interface is shown but without ip address, I've to do a /etc/rc.d/netif restart and then the IP addresses are configured.

Relevant part of the /etc/rc.conf:
Code:
# Network interface
netif_enable="YES"
background_dhclient="YES"
synchronous_dhclient="NO"

# Configuration failover
ifconfig_re0="up"
wlans_iwm0="wlan0"
ifconfig_wlan0="WPA"
create_args_wlan0="wlanaddr <MAC ADDR> country France"
cloned_interfaces="lagg0"
ifconfig_lagg0="up laggproto failover laggport wlan0 laggport re0 DHCP"
ifconfig_lagg0_ipv6="inet6 accept_rtadv"

I've joined the ifconfig output "before" (after reboot but before the netif restart) & after the restart.

An idea of whats append ?
 

Attachments

  • ifconfig.before.txt
    1.2 KB · Views: 179
  • ifconfig.after.txt
    1.2 KB · Views: 182
You need to investigate dmseg to see what is happening.
My guess would be that the WiFi interface is not coming 'up' fast enough.
To test that theory you can use 'netwait'.
This will wait for the interface to come up before proceeding.
From the prototype file /etc/default/rc.conf
### Network link/usability verification options
netwait_enable="NO" # Enable rc.d/netwait (or NO)
#netwait_ip="" # Wait for ping response from any IP in this list.
netwait_timeout="60" # Total number of seconds to perform pings.
#netwait_if="" # Wait for active link on each intf in this list.
netwait_if_timeout="30" # Total number of seconds to monitor link state.


From /etc/rc.d/netwait script:
The netwait script helps handle two situations:
# - Systems with USB or other late-attaching network hardware which
# is initialized by devd events. The script waits for all the
# interfaces named in the netwait_if list to appear.
# - Systems with statically-configured IP addresses in rc.conf(5).
# The IP addresses in the netwait_ip list are pinged. The script
# waits for any single IP in the list to respond to the ping. If your
# system uses DHCP, you should probably use synchronous_dhclient="YES"
# in your /etc/rc.conf instead of netwait_ip.
# Either or both of the wait lists can be used (at least one must be
# non-empty if netwait is enabled).
 
Hi, I just have exactly the same problem on my laptop running 12.0-RELEASE-p10/amd64.
My setup is the same as hpc@, to configure lagg for Ethernet/WiFi failover (i.e. use Ethernet if available, or use WiFi).

On my system, it appears that the WiFi device (iwm0) is attached after the lagg is configured. So the lagg0 has only em0 on boot.
Here is an excerpt from dmesg (when ethernet was not connected).

Code:
lagg0: bpf attached
...
lagg0: link state changed to DOWN
...
iwm0: <Intel(R) Dual Band Wireless AC 8265> mem 0xe8000000-0xe8001fff at device 0.0 on pci1
...
wlan0: bpf attached
...
wlan0: link state changed to UP

As the original author said, manually running "service netif restart" adds both em0 and wlan0 to lagg0 and after that failover works as expected.
What is the best way to avoid this (manually restarting netif)?
/etc/rc.local seems to work but there must be better ways.
 
That sounds like something worth trying.

/boot/loader.conf
iwm_load="YES"

Wonder how a custom kernel with iwn baked in would act.
 
Thank you so much for your suggestions.
Rebooting with the following lines added to /boot/loader.conf solved the problem!
Code:
if_iwm_load="YES"
iwm8265fw_load="YES"

Now iwm0 is loaded much earlier and wlan0 is ready when the lagg is setup.
"dmesg | egrep '(iwm|wlan|lagg|em)0'" output follows.
Code:
iwm0: <Intel(R) Dual Band Wireless AC 8265> mem 0xe8000000-0xe8001fff at device 0.0 on pci1
em0: <Intel(R) PRO/1000 Network Connection> mem 0xe8100000-0xe811ffff at device 31.6 on pci0
...
iwm0: hw rev 0x230, fw ver 22.361476.0, address xx:xx:xx:xx:xx:xx
wlan0: Ethernet address: xx:xx:xx:xx:xx:xx
lagg0: link state changed to DOWN
wlan0: link state changed to UP
lagg0: link state changed to UP

hpc@, I hope this will help you too.
 
Silly nitpick but the original posters country code is incorrect.
For France we have either FR or F2 as country codes for wifi.
See /etc/regdomain.xml for specifics
 
FYI, I got another suggestion about when to load kernel modules on Twitter.
I confirmed that putting WiFi-related modules in kld_list (/etc/rc.conf) also works.
Code:
kld_list="if_iwm iwm8265fw"
 
Thank you for all your suggestions. I was not able to use netwait_enable="YES", I've tried to add netwait_timeout & netwait_if. It never worked.

/boot/loader.conf is a good track but it was difficult to find a right configuration.

if_iwm_load was not sufficient, nor iwm7265fw_load, I had to add iwm7265Dfw_load. Not sure to understand why..

/boot/loader.conf
Code:
if_iwm_load="YES"
iwm7265Dfw_load="YES"
iwm7265fw_load="YES"

This work for me :)
 
Back
Top