Rootserver Sponsor

webtropia"

Donations

Please support your operating system's further development:

donate"

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
finottiOffline
Post subject: Wired/Wireless Simultaneously  PostPosted: 13.08.2016, 17:33



Joined: 2010-09-12
Posts: 493

Status: Offline
Dear all,

I have Netgear Powerline ethernet through outlet connected to my desktop. (My modem and router have to stay in the garage.) Sad Most of the times it works really well, but every once in a while, the connection breaks.

The problem is that my wife teaches online, so when the connection breaks during her classes, it is a real problem.

Rather than going back to slower speeds of a wireless connections, I thought maybe I could have both wireless and wired running at the same time, hoping that when the wired would fail, the wireless would keep it going.

I've put a USB wifi adapter that is working fine. The first problem is that only eth0 starts at boot. I thought that an "auto" in front of the interface would tell it to start at boot, no?

Here is my configuration:

      Code:

root@debian[/home/finotti]# cat /etc/network/interfaces
# /etc/network/interfaces - configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

auto wlx4c60de719837
iface wlx4c60de719837 inet dhcp
        wpa-psk <password>
        wpa-ssid <my SSID>


Secondly, if I have both up (manually bringing the wifi up) and one of the connections is cut, the other does not seem to take over, and internet is lost.

Any ideas or suggestions?

Thanks!

Luis
 
 View user's profile Send private message  
Reply with quote Back to top
slhOffline
Post subject: RE: Wired/Wireless Simultaneously  PostPosted: 13.08.2016, 21:26



Joined: 2010-08-25
Posts: 962

Status: Offline
What you're planning isn't really going to work, at least not well.

But let's go to the status quo first.
Your current configuration will indeed give you IP addresses, likely from the same subnet (unless you intentionally put wired and wireless into different subnets), but only one interface can get the default route, the information to the kernel which interface to use to reach the internet. What happens now, assuming undisturbed connectivity via both interfaces, is that both interfaces are probed in parallel. Given that wlan typically needs a little longer for the WPA handshake, quite likely your wired interface is the first to get initialized, it gets an IP assigned and the default route is set to it - all as you intend it to be. But then, after the WPA handshake completes for the wlan interface, it will get an IP address assigned as well - and with that, it also overwrites the default route, which means the system will now only consider the wireless interface to reach the internet (regardless of the also configured wired one).

Depending on DHCP lease time, potential interference or related fun, the default route will now shift back and forth randomly between both interfaces, giving you a very unreliable experience (even if both interfaces would have an undisturbed connection on their own).


One way to avoid this would be introducing routing metrics, as a way to get away from the binary decision of "there can only be one default route and the last one who manages to set it, will win for the next few minutes/ hours" over to a system of weighed priorities between several interfaces. While I haven't tested this with ifupdown, it's quite easy to set up via systemd-networkd.

In theory, your example is the primary purpose for using routing metrics, making it the ideal solution to your problem (and it would work, to some extent), but practice differs from theory...

The problem with wlan, and I assume powerline exposing a similar behaviour, is that its state changes quickly and intermittently, often without you even noticing (at first), which makes tracking this quite difficult (think huge packet loss, until the system deems the priority interface to be down and toggles the default route) and you never knowing which interface is currently working/ down. So while routing metrics do work very well for direct handover between wired lines, where there is no fuzziness in being up or down (as in, interface 'A' has been unplugged, switch to 'B'), it works considerably less well if one (or worse, both of the) interface(s) don't have a clear cut definition of being 'up' or 'down'. I assume your case might be even worsened by the fact that your wired connection to the powerline adaptor will technically never go down, just that it will stop reaching the other end.


If you have the chance, seriously consider switching to CAT-6 ethernet cable, it's the only really long term reliable option, but that's obviously not always (or everywhere) possible. Another option would be trying to improve the situation for one of your interfaces, like debugging the powerline issues (using the same phase, trying to find a shorter/ better cable run - extending the ethernet cable towards the powerline adaptor) or making sure that wlan is good enough for your purposes.

If you have to get your current setup working, I'd suggest to avoid any smart switching (allow-hotplug eth0, comment out allow-hotplug wlan0 - so it remains preconfigured, but inactive by default) and to toggle between both connections manually:
      Code:
# ifdown eth0
# ifup wlan0
(you can configure sudo and add this to small scripts, probably augmented by a desktop icon, if you like)

Feel free to experiment with routing metrics, to test how they work in your situation with two 'unreliable' connections, if the above won't meet your criterias.


But in the end nothing beats having one reliable connection, ideally wired ethernet, everything else introduces just varying shades of pain.
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject: RE: Wired/Wireless Simultaneously  PostPosted: 14.08.2016, 11:29



Joined: 2010-09-12
Posts: 493

Status: Offline
Thanks slh for the very informative reply! I will weigh my options.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio