3

Is there a way to switch between Wireless and Wired connections without switching either of the connections off when both are connected?

I am using 18.04.

2 Answers 2

0
  1. List first default gateways (here is my example):
route -n |grep -P ^0.0.0.0 -B2
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.64.1    0.0.0.0         UG    0      0        0 enp4s0
0.0.0.0         192.168.42.129  0.0.0.0         UG    101    0        0 enp0s20u9u2
  1. Figure out which is taking all traffic. It is first listed because of Metric column set lower than 101. So we need to "select" this one for deletion. (use IP=192.168.64.1)

  2. Delete this first default route:

sudo route del default gw $IP
  1. Enable it again if needed
sudo route add default gw $IP

Alternative

with ifmetrics

sudo ifmetric enp4s0 123 # higher on table than 101 will make this interface inactive
sudo ifmetric enp4s0 77 #  lower on metric table will make this interface active
0

You can, if is what you want, use 2 connections as one. E.g.:

Connection 1: 100Kb/s
Connection 2: 350Kb/s
Resulting connection: 450Kb/s

This is achieved using the technique Bonding.

How many bonding devices can I have? There is no limit.

It's a bit complicated to configure it properly, so I recommend you read this article completely, and take away all doubts before starting. And in this page you will see FAQs, advanced options and all the information in one single page.

3
  • It is a bad idea. Just quote important info from that answer and give a reference.
    – Gryu
    Feb 24, 2020 at 21:33
  • @Gryu I think it's all important. If you think something is not I would appreciate you adding another answer.
    – Mark
    Feb 24, 2020 at 23:32
  • That answer is not big. Just quote it wholly. I said about important info in general. If you consider everything important, then quote everything.
    – Gryu
    Feb 24, 2020 at 23:36

You must log in to answer this question.