2

I'm new at the Raspi 3 and unix in general, and now trying to build a headless streaming application, and trying to automate some basic setup steps on boot.

If I want to guarantee the fastest connection speed is used for streaming, I'm just wondering if there's any benefit to turning off wlan0 if I see they're connected to eth0 already.

I guess my question is what happens when both wired and wireless connections to Internet exist? Do the connections get prioritized for speed, or do they get pooled together - or is there a possibility that the wireless would be used instead of wired ethernet?

I realize the answer might apply to all Unix flavors - and possible even Windows - but I'm specifically interested in Raspbian

4

Normally if both Ethernet and Wifi are capable of supplying an internet connection to the Raspberry Pi the one with the lowest metric (independent of the internet speed) will be the one used by the Pi to get the internet (In my personal experience eth0 always gets the lowest metric). If you want to check the metrics type route -n you would see something like :

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         100.100.100.1   0.0.0.0         UG    202    0        0 eth0
0.0.0.0         192.168.137.1   0.0.0.0         UG    303    0        0 wlan0
100.100.100.0   0.0.0.0         255.255.255.0   U     202    0        0 eth0
192.168.137.0   0.0.0.0         255.255.255.0   U     303    0        0 wlan0

In this chart you can see that eth0 has the lowest metric so the internet coming from that connection will be the one used. If you wanted to change the metric so that wlan0 becomes the one with the lowest metric then type

sudo route delete  default gateway 192.168.137.1 

and then

sudo route add  default gateway 192.168.137.1

you will see that the chart is now

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.137.1   0.0.0.0         UG    0      0        0 wlan0
0.0.0.0         100.100.100.1   0.0.0.0         UG    202    0        0 eth0
100.100.100.0   0.0.0.0         255.255.255.0   U     202    0        0 eth0
192.168.137.0   0.0.0.0         255.255.255.0   U     303    0        0 wlan0

and the internet coming from wlan0 will be the one used

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.