Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] automatic failover between wired and wireless
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mrmarbury
n00b
n00b


Joined: 01 Dec 2004
Posts: 43
Location: Munich

PostPosted: Fri Mar 23, 2018 2:07 pm    Post subject: [SOLVED] automatic failover between wired and wireless Reply with quote

Hi,

I am a BSD user possibly all my life. But I have a looong track record with Gentoo as well (at least 15 years by now. I think my first posting must have been around 2004 though). Now, after some years of absence, I installed myself a Gentoo as a parallel OS again. Everything works by now except some automagic failover between wired and wireless connections. And I wanted to ask what a Gentoo user uses for such things nowadays. Back in the olden days I used ifplugd. But it is not developed anymore and the very brief description in the wiki is not working for me at all. I have searched around in the forums a bit but all entries regarding ifplugd are really old and involve a quite complicated setup. I cannot remember doing more than installing and starting ifplugd and telling it about my interfaces. Well, how do you guys accomplish automatic failover on a notebook these days (I hope the solution does NOT involve systemd)

Cheers,
Stefan


Last edited by mrmarbury on Mon Mar 26, 2018 9:10 am; edited 1 time in total
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6316
Location: /usr/lib64/lv2

PostPosted: Sun Mar 25, 2018 3:24 pm    Post subject: Reply with quote

I use NetworkManager/nm-applet. (No systemd.) The wired connection can simply be checkboxed to automatically connect to this network when it is available. Connect to wifi when you want it. If you don't use it or it's not available, it auto-connects to the wired NIC.
_________________
Gentoo Studio: A Gentoo-based, professional digital audio workstation OS.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5969

PostPosted: Sun Mar 25, 2018 6:50 pm    Post subject: Reply with quote

I use dhcpcd + wpa_supplicant. Default behaviour in dhcpcd is to give wired a lower route metric than wireless, and the kernel will do its job.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6756
Location: Blighty

PostPosted: Sun Mar 25, 2018 11:52 pm    Post subject: Reply with quote

dhcpcd supports both Linux and BSD. I'm the author of dhcpcd, so I have some bias ...... use dhcpcd ;)
Out of the box it will do what you want
wpa_supplicant may need some minor tweakage depending on if it needs to work on a hotplugged interface.
The only buy in is that you don't use net.* to configure networking in Gentoo.
https://wiki.gentoo.org/wiki/Network_management_using_DHCPCD

dhcpcd has been shipping with NetBSD since NetBSD-5 so I'm guessing you use some other BSD?
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
mrmarbury
n00b
n00b


Joined: 01 Dec 2004
Posts: 43
Location: Munich

PostPosted: Mon Mar 26, 2018 9:20 am    Post subject: Reply with quote

dhcpcd works like a charm. That's what I was expecting. Thanks for the heads up. Back in the days we had ta use a mixture of conf.d/net, ifplugd, and dhcpcd which obviously does not work anymore and is not necessary anyway.
I never really used NetBSD. Sure I installed it and played with it but the daily driver on my notebook is FreeBSD and here I just use the dhclient that ships with the base system in combination with a link aggregation mode 1. Works well and makes mapping of vlans to gain access to certain networks way easier. I will build such a config in gentoo later . But for now dhcpcd is what I was looking for :)

Cheers,
Stefan
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6756
Location: Blighty

PostPosted: Mon Mar 26, 2018 9:49 am    Post subject: Reply with quote

That's an interesting solution. I note that the man page for lagg(4) also deals with the MAC address issue of mixing wired and wireless like that.
The only downside is that it assumes both wired and wireless are on the same subnet, which isn't always the case.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
mrmarbury
n00b
n00b


Joined: 01 Dec 2004
Posts: 43
Location: Munich

PostPosted: Mon Mar 26, 2018 3:49 pm    Post subject: Reply with quote

Oh it works well enough, even with the Wifi in a different subnet. The only thing that doesn't work from time to time is the failover. But not having to reconfigure my bridges, vlans and such whenever I switch between lan and wlan (multiple times a day) is worth the while. Unfortunately my company introduced some new video conferencing software that has a linux client but which I did not get to work with FreeBSD yet. So I have to have a Linux on my Lenovo P50 (excelent Linux/FreeBSD machine btw) in case I have to share my screen. So I am using good old Gentoo for such cases :)
Now that I know that dhcpcd does failover well I will play around with it in combination with lagg(4) - always liked dhcpcd better than dhclient anyway ;)
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6756
Location: Blighty

PostPosted: Mon Mar 26, 2018 4:00 pm    Post subject: Reply with quote

mrmarbury wrote:
Oh it works well enough, even with the Wifi in a different subnet.


So which interface would you run the DHCP client on and how would the default route look (assuming both subnets had a default router) when changing over?
FreeBSD (like NetBSD) is limited to one default route. Hence the need for something like dhcpcd to manage this for you.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
mrmarbury
n00b
n00b


Joined: 01 Dec 2004
Posts: 43
Location: Munich

PostPosted: Mon Mar 26, 2018 7:56 pm    Post subject: Reply with quote

going highly OT now ...

This is part of my FreeBSD network Config:

Code:

cloned_interfaces="lagg0"

ifconfig_em0="up"
ifconfig_iwm0="up"

wlans_iwm0="wlan0"
ifconfig_wlan0="WPA"
create_args_wlan0="wlanaddr <mac address of em0>"

ifconfig_lagg0="laggproto failover laggport em0 laggport wlan0 DHCP"


So dhcp is executed on lagg0 (the bonding interface)

ifconfig then looks like this for lagg0

Code:

lagg0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
   ether <macc address of em0>
   inet 10.0.0.113 netmask 0xffffff00 broadcast 10.0.0.255
   nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
   media: Ethernet autoselect
   status: active
   groups: lagg
   laggproto failover lagghash l2,l3,l4
   laggport: em0 flags=1<MASTER>
   laggport: wlan0 flags=4<ACTIVE>


I will send you a PM with my mail address so we can chat further, if you like
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum