Skip to content

Instantly share code, notes, and snippets.

@rbgarga
Created August 23, 2019 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbgarga/e8e1c2aa1c472fe5924206adac31a39f to your computer and use it in GitHub Desktop.
Save rbgarga/e8e1c2aa1c472fe5924206adac31a39f to your computer and use it in GitHub Desktop.
Failover between ethernet and wifi on FreeBSD
ifconfig_em0="up"
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA"
# Configure wifi interface with the same mac address of em0
create_args_wlan0="wlanaddr 3c:97:0e:48:3f:f8 up"
cloned_interfaces="lagg0"
ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP"
ifconfig_lagg0_ipv6="inet6 accept_rtadv"
rtsold_enable="YES"
@puddingepoch
Copy link

does not work

@rbgarga
Copy link
Author

rbgarga commented Feb 7, 2020

does not work

It's working here on my laptop:

# Lagg
ifconfig_em0="up"
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA"
create_args_wlan0="wlanaddr 3c:97:0e:48:3f:f8 up"
cloned_interfaces="lagg0"
ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP"
ifconfig_lagg0_ipv6="inet6 accept_rtadv"
rtsold_enable="YES"
FreeBSD x230 13.0-CURRENT FreeBSD 13.0-CURRENT #139 r357294: Thu Jan 30 16:07:30 -03 2020     root@x230:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  amd64
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=800000<>
	ether 3c:97:0e:48:3f:f8
	media: Ethernet autoselect
	status: no carrier
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
	inet 127.0.0.1 netmask 0xff000000
	groups: lo
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 3c:97:0e:48:3f:f8
	groups: wlan
	ssid MORDOR channel 48 (5240 MHz 11a ht/40-) bssid 78:8a:20:b5:9f:b2
	regdomain FCC country US authmode WPA2/802.11i privacy ON
	deftxkey UNDEF AES-CCM 3:128-bit txpower 17 bmiss 10 mcastrate 6
	mgmtrate 6 scanvalid 60 ampdulimit 64k ampdudensity 8 -amsdutx amsdurx
	shortgi -stbc -ldpc wme roaming MANUAL
	media: IEEE 802.11 Wireless Ethernet MCS mode 11na
	status: associated
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 3c:97:0e:48:3f:f8
	inet6 fe80::3e97:eff:fe48:3ff8%lagg0 prefixlen 64 scopeid 0x4
	inet6 2804:f1c:80b:cc00:3e97:eff:fe48:3ff8 prefixlen 64 autoconf
	inet6 2804:f1c:80b:cc00:f470:f6b3:34da:5de8 prefixlen 64 deprecated autoconf temporary
	inet6 2804:f1c:80b:cc00:4ca6:58bd:362:3a7a prefixlen 64 autoconf temporary
	inet 172.21.4.121 netmask 0xffffff00 broadcast 172.21.4.255
	laggproto failover lagghash l2,l3,l4
	laggport: em0 flags=1<MASTER>
	laggport: wlan0 flags=4<ACTIVE>
	groups: lagg
	media: Ethernet autoselect
	status: active
	nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

@puddingepoch
Copy link

puddingepoch commented Feb 8, 2020

i assumed that since i have hardware identical to yours both ethernet and wireless, that this could work as a drop-in replacement (save the mac address)
after pouring over the man pages for this and being baffled as to why i cannot make it work, i can only conclude that the config is not the issue but rather freebsd, so i apologize for my rudeness

@rbgarga
Copy link
Author

rbgarga commented Feb 10, 2020

i assumed that since i have hardware identical to yours both ethernet and wireless, that this could work as a drop-in replacement (save the mac address)
after pouring over the man pages for this and being baffled as to why i cannot make it work, i can only conclude that the config is not the issue but rather freebsd, so i apologize for my rudeness

Did you configure wlan0 to have the same mac address of your ethernet port? What kind of problems did you have?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment