2

I have currently 2 internet connections. One is reasonable fast but the traffic is limited (network A). The 2nd is slower and I do not care about the cap (Network B) :)

The Raspberry Pi4 with Raspbian is connected with ethernet to Network A. Printers and NAS are all connected to Network A.

I now want to use transmission. The downloads and uploads should not go through Network A due to cap issues. Network B would be great.

Can I connect to Network B by Wifi while still being connected to Network A through Ethernet?

And how do I make Transmission to download/upload data from the internet through the wifi (Network B), while at the same time the files are read from/written to the NAS connected through the Ethernet port via a switch (Network A)?

Does this make any sense?

Cheers

Bang Olafson

PS: here now some current configurations: eth0 is "network A" and wlan0 is "network b"... Hope this makes now some sense...

pi@raspberrypi:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.15.251  netmask 255.255.255.0  broadcast 192.168.15.255
        inet6 fe80::55d8:fd43:8bfd:b830  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:19:f4:30  txqueuelen 1000  (Ethernet)
        RX packets 579670  bytes 873572373 (833.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 140698  bytes 9366986 (8.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.8.101  netmask 255.255.255.0  broadcast 192.168.8.255
        inet6 fe80::f467:d61d:3555:48ef  prefixlen 64  scopeid 0x20<link>
        inet6 fde4:19c1:92a3:9e00:97f2:8e07:5c03:d47e  prefixlen 64  scopeid 0x0<global>
        ether dc:a6:32:19:f4:31  txqueuelen 1000  (Ethernet)
        RX packets 26  bytes 2542 (2.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 73  bytes 11374 (11.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
5
  • "Can I connect to Network B by Wifi while still being connected to Network A through Ethernet" YES - but if you want anyone to help with this you need to be more specific not vague generalities. – Milliways Feb 3 '20 at 10:48
  • I’d like to. Unfortunately I would need a bit help in providing the required information. What do you need? – Bang Olafson Feb 3 '20 at 11:12
  • What do you mean wit cap? A hat ;) or capacity? It is possible to have two interfaces to different internet router but the problem is: who or what decides what is an up-/download and what is others? What is, what not is up-/download? It is mainly a routing problem where you can use policy routing (source-, destination routing) but not an easy task. – Ingo Feb 3 '20 at 16:00
  • Network A has a 1,000 GB download limit per month. Not sure actually whether it is a cap (e.g. the service would cease or be limited after reaching the amount) or a data limit with additional charges beyond the 1000 GB. – Bang Olafson Feb 4 '20 at 17:06
  • I have added the result from ifconfig. Aim is that transmission downloads through the router 192.168.8.1 while the NAS is connected to the other network on the routher 192.168.15.1 – Bang Olafson Feb 5 '20 at 20:45
1

You can use the 'route' command to add host-specific routing.

Normally the route table contains network routes. But you can create a host-specific route that forces the network stack to use a specific interface.

In your example:

eth0 is 192.168.15.251 with netmask 255.255.255.0 <-- faster net but limited

wlan0 is 192.168.8.101 with netmask 255.255.255.0 <-- slower net but unlimited

We need to know the gateway address on each of these nets. Often it's the .1 address on the network. We'll also need to know the IP address of the remote host to create a host-specific route.

Suppose both nets have their gateways at the .1 address and suppose the remote host has IP address 10.20.30.40

Then this command would create a host-specific route for your remote server.

route add -host 10.20.30.40 gw 192.168.8.1 dev wlan0

If you follow up by just typing 'route' (no options) it will display the route table. You should see a new row in the route table and the "Flags" column will have a letter "H" in that filed (indicating that it is a Host-specific route).

Technically the "dev wlan0" are optional. If you leave it off, the network stack will try to resolve how to reach 192.168.8.1 on it's own ... and conclude that it has to use the wlan0 interface to reach it. Adding in the argument just saves the operating system from doing that step.

This should also work via the 'ip' command (with the route option instead of the 'route' command). In that method, there is no specific command to add a host-specific route. Instead you use a netmask that uses all 32 bits and this has the same effect as a host-specific route. e.g.

ip route 10.20.30.40 255.255.255.255 192.168.8.1
0

When you set 192.168.8.1 as your default gateway, wlan0 will be used for downloads from the internet. If your RPi addresses the NAS or printers, he'll use eth0.

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.