Hello I am looking for a way to use multiple internet connections to one computer. The initial scenario:
Line 1. low bandwidth, low ping
Line 2. high bandwidth, high ping
For downloads I would use line 2, so that I don’t have to wait for days, but to be able to play something on the computer I would use line 1 in parallel.
I myself use Linux → Arch → Manjaro
I have already come across possibilities to combine the lines,
as an example via hardware with load-balancer, or software-sided.
Unfortunately I didn’t find any information about the kind of balancing. Is round-robin used here, or would there be a possibility to send certain apps to a certain line?
Okay 2 Nics,
Connected to two Diffrent Gateways.
I want use both at one time.
I want to select if the connection from app x use nic 1,
the connection of app y should use nic 2.
The nic one is connected over my phone to the internet.
The nic two is connected over the copper wire to the internet.
So simply:
Connect to two internet gateways over two different nics and select for each app one nic to use.
Or define rules when a app has to use nic one or nic to.
Ok so, one way at least:
You create a separate routing table for your phone network and then use mangle table in iptables firewall to route mark specific processes that you want forwarded to “phone network” routing table.
Another way: If app supports it, you could bind specific IP of desired NIC to be used by the app. (or you bind it with firejail for example)
I have tried it with firejail --noprofile --net=wlp0s20f3 ping manjaro.org
and firejail --noprofile --net=bond0 ping manjaro.org
and it worked!
(First is my wifi device, the second one ethernet.)
If you have a local DNS running on 127.0.0.1, it doesn’t work because in the sandbox, there is no DNS running on its localhost.
Then, you have to configure another DNS with --dns=1.1.1.1 (e.g.).
This is really nice!
(Note that firejail is much more powerful and accessing files might be maybe difficult but I don’t know.)
Interface MAC IP Mask Status
lo 127.0.0.1 255.0.0.0 UP
eth0-105521 28:b2:bd:b2:39:28 192.168.178.229 255.255.255.0 UP
Child process initialized in 1103.12 ms
Parent is shutting down, bye…
I think it is not working at, for example i can start firefox or chrome but no site is reachable.
It seems not to be the DNS-Server i try to add the dns arg (–dns=8.8.8.8), but it does not make a differenz.
It seems to be not a dns problem, the browser cant reach any ip-address.
Well, routing applications (by name) wherever and whenever you feel like isn’t a trivial task. So it would help if you told us exactly what you would like to do/what is your intended use for this.
In regards to firejail, you probably need to run it as sudo for ping to work. And can’t remember if I used any special settings in firefox itself, but I have a working firejailed firefox that has a secondary IP bound to it (which is routed differently in router).
Even firewall (iptables) isn’t capable of distinguishing apps solely by their name/pid/command. You can do it for UID and GID, which I was just playing with (running app with sudo -g some_group ... which then uses different routing table). But in the end all these solutions feel hacky.
i want all apps that often need to download large files like steam to be bound to the nic with the large bandwidth. realtime application on the other hand should use the line (nic) with low bandwidth and a good ping.
For example:
I want that Chrome use the nic: enp0s20u1
I want that i can use Firefox to over nic wlp3s0
And i want use both apps together (at same time), so bound a app to a nic (etternet gateway), and use two nics together.
The apps are examples, you can put every app in that you want…
Ok. But it depends on applications. For example if you are using qbittorrent, you can choose which interface or IP it should bind to right in its settings. If app supports it, that is quickest solution. You can do same with ping and traceroute btw (select interface).
Anyhow, need to do some more testing with VRFs to see what’s easiest.