Using a Wi-Fi network with one application and Ethernet for everything else

Sorry for my terrible English. If you don’t understand what I’m saying, ask and I will try to explain it with different words and give examples.
**
Here is what I’m trying to achieve:**

  • Everything to go through the ethernet connection by default.
  • And certain application(s) to go through a wireless network.

I’m running openSUSE Tumbleweed with Xfce desktop environment and I’m trying to use qBittorrent with a specific wireless network but use the ethernet for everything else (the browser and other internet applications).

[FONT=inherit]My network interfaces (I’ve replaced my MAC addresses with 00:00:00:00:00:00):

$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DORMANT group default qlen 1000
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff

I’ve done some research and I found this https://unix.stackexchange.com/questions/210982/bind-unix-program-to-specific-network-interface the accepted answer suggests using network namespaces but I couldn’t get it to work
[/FONT]
Here is what I did

user@linux-2qn0:~> sudo ip netns add test_ns
user@linux-2qn0:~> sudo ip link set wlp3s0 netns test_ns
RTNETLINK answers: Invalid argument
user@linux-2qn0:~> 

I’ve tried Wi-Fi on/off in Xfce’s NetworkManager but it gave the same error RTNETLINK answers: Invalid argument
I’m probably doing something obviously wrong and/or there is a much better way to do this thru the awesome YaST GUI tools but I couldn’t figure it out. Thanks for any help you are able to provide.

I forgot to explain why I want to do this. (it’s not particularly useful information but still)
I have 2 ISPs at my home. Because of the placement of the routers, I connect to one of the routers using a wired connection and I use wireless for the other one.
Obviously, I cannot combine both of the connections but I would like to be able to assign one application to use one network interface e.g. wireless and the rest to use the other interface.

Never really tested it properly but, the impression that I have is that Network Manager tends to use the link with the most bandwidth – I’ve never really tested if Network Manager will perform something which looks like load sharing over the available links.

The RTNETLINK error raised by “ip link set wlp3s0 netns test_ns” is possibly due to an issue in the ‘/etc/sysconfig/network/ifcfg-wlp3s0’ file:

  • Please check the value of entries such as “NETMASK??=” and “ADDRESS??=” – where ‘??’ is an integer value resulting from the process which created the new network name space.

N.B.: StackExchange: “Bind unix program to specific network interface” <routing - Bind unix program to specific network interface - Unix & Linux Stack Exchange

Set test to use eth0, after this point eth0 is not usable by programs

outside the namespace

It’s late, but wouldn’t some firewall tule work? Bittorrent traffic goes through a specific port, forward that port to the wireless interface, close all other ports… Just thinking if this could be done.

Thanks for your replies.

The RTNETLINK error raised by “ip link set wlp3s0 netns test_ns” is possibly due to an issue in the ‘/etc/sysconfig/network/ifcfg-wlp3s0’ file:

The file doesn’t exist tried WiFi off/on

user@linux-2qn0:~> cat /etc/sysconfig/network/ifcfg-wlp3s0
cat: /etc/sysconfig/network/ifcfg-wlp3s0: No such file or directory

user@linux-2qn0:~> ls /etc/sysconfig/network/
config  ifcfg-enp2s0f0      ifcfg-lo        if-down.d  providers
dhcp    ifcfg-enp2s0f0.bak  ifcfg.template  if-up.d    scripts

It’s late,

Is it late for an answer? Idk it’s not late to me.

Bittorrent traffic goes through a specific port, forward that port to the wireless interface, close all other ports… Just thinking if this could be done.

I don’t know much about firewalls but I guess I have to experiment.

One more thing. I’ve noticed that some applications have an option to select the network interface and/or to bind to a specific IP
For example in the Advanced settings in qBittorrent
I tried changing the network interface to wlp3s0 and tried all the IPs from that interface, restarted the application each time but qBittorrent couldn’t connect to any torrents.
https://i.imgur.com/xyXHGaQl.png](https://i.imgur.com/xyXHGaQ.png)