Ethernet Wifi failover

Gavin Atkinson gavin at FreeBSD.org
Sat Sep 27 13:07:37 UTC 2014


On Fri, 26 Sep 2014, Olivier Cochard-Labbé wrote:
>  Hi,
> 
> here is an old post from my blog that can useful on the documentation.
> 
> I want a simple behavior with my laptop:
> 
>    1. If Ethernet cable connected use this connectivity, otherwise use the
>    wireless;
>    2. I want to kept the same IP addresses, event if I'm using DHCP client.
> 
> The solution is quiet simple:
> 
>    1. set-up an aggregate interface in failover mode with Ethernet as
>    primary and wireless as backup;
>    2. Put the Ethernet NIC MAC address on the wireless NIC.

Although this might work for some uses, it isn't ideal.  Right now, we 
don't have the infrastructure to actually bridge wired and wireless 
properly, and I think documenting it would be a bad idea.

Thanks,

Gavin

> 
> Here are how to do it:
> 
> # *ifconfig -l*
> iwn0 bge0 lo0
> => My Ethernet NIC is "bge0" and wireless is "iwn0" here
> 
> # *set MAC=`ifconfig bge0 | grep ether | cut -d ' ' -f 2`*
> # *sysrc ifconfig_bge0=up*
> ifconfig_bge0:  -> up
> # *sysrc wlans_iwn0=wlan0*
> wlans_iwn0:  -> wlan0
> # *sysrc ifconfig_iwn0="ether $MAC"*
> ifconfig_iwn0:  -> ether 00:1c:23:25:ab:45
> # *sysrc ifconfig_wlan0="WPA up"*
> ifconfig_wlan0: WPA DHCP -> WPA up
> # *sysrc cloned_interfaces=lagg0*
> cloned_interfaces:  -> lagg0
> # *sysrc ifconfig_lagg0="laggproto failover laggport bge0 laggport wlan0
> DHCP"*
> ifconfig_lagg0:  -> laggproto failover laggport bge0 laggport wlan0 DHCP
> # *sysrc ifconfig_lagg0_ipv6="inet6 accept_rtadv"*
> ifconfig_lagg0_ipv6:  -> inet6 accept_rtadv
> # *service netif restart*
> 
> And now with Ethernet cable unplugged:
> 
> # *ifconfig lagg0*
> lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
>     ether 00:1c:23:25:ab:45
>     inet6 fe80::41d:23ff:fe25:ab78%lagg0 prefixlen 64 scopeid 0x4
>     inet6 2a01:e35:9b9d:a1a0:41d:23ff:fe25:ab45 prefixlen 64 autoconf
>     inet 192.168.100.7 netmask 0xffffff00 broadcast 192.168.100.255
>     nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
>     media: Ethernet autoselect
>     status: active
>     laggproto failover lagghash l2,l3,l4
>     laggport: wlan0 flags=4<ACTIVE>
>     laggport: bge0 flags=1<MASTER>
> 
> 
> Then If I plug the Ethernet cable:
> 
> 
> # ifconfig lagg0
> lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
>     ether 00:1c:23:25:ab:45
>     inet6 fe80::41d:23ff:fe25:ab45%lagg0 prefixlen 64 scopeid 0x4
>     inet6 2a01:e35:9b9d:a1a0:41d:23ff:fe25:ab45 prefixlen 64 autoconf
>     inet 192.168.100.7 netmask 0xffffff00 broadcast 192.168.100.255
>     nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
>     media: Ethernet autoselect
>     status: active
>     laggproto failover lagghash l2,l3,l4
>     laggport: wlan0 flags=0<>
>     laggport: bge0 flags=5<MASTER,ACTIVE>
> _______________________________________________
> freebsd-doc at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-doc
> To unsubscribe, send any mail to "freebsd-doc-unsubscribe at freebsd.org"
> 


More information about the freebsd-doc mailing list