1

I currently have a Raspberry Pi Model B+ v1.2 (and I am planning to get the Raspberry Pi 4 after I sort out these issues). I have the network interface eth0 connected to my router through an Ethernet cable, and I have wlan0 connected to the same router through Wi-Fi.

I am planning on using this Raspberry Pi as a seedbox where I want all the traffic from qBittorrent-nox to go through the eth0 interface which will go through my OpenVPN, and then I want to leave the wlan0 interface unaffected by the VPN so I am able to access the qBittorrent-nox WebUI from my public no-ip address with my open port. (Note: My VPN doesn't allow for port forwarding)

I have seen a lot of posts talking about IP table routing but I didn't quite understand how to implement it for what I want.

I ran the "ip route show" command and below is the result:

0.0.0.0/1 via 10.28.10.5 dev tun0
default via 192.168.1.1 dev eth0 proto dhcp src 192.168.1.26 metric 202
default via 192.168.1.1 dev wlan0 proto dhcp src 192.168.1.27 metric 303
10.28.10.1 via 10.28.10.5 dev tun0
10.28.10.5 dev tun0 proto kernel scope link src 10.28.10.6
103.231.91.74 via 192.168.1.1 dev eth0
128.0.0.0/1 via 10.28.10.5 dev tun0
192.168.1.0/24 dev eth0 proto dhcp scope link src 192.168.1.26 metric 202
192.168.1.0/24 dev wlan0 proto dhcp scope link src 192.168.1.27 metric 303

Below is my "ifconfig" command result:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.26  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::f96:bfff:cd6d:d1d6  prefixlen 64  scopeid 0x20<link>
        inet6 2404:4408:23f4:5500:c127:7182:abfb:5e26  prefixlen 64  scopeid 0x0<global>
        ether b8:27:eb:61:19:70  txqueuelen 1000  (Ethernet)
        RX packets 911757  bytes 1126311222 (1.0 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 449193  bytes 64017695 (61.0 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 123  bytes 12608 (12.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 123  bytes 12608 (12.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
        inet 10.28.10.6  netmask 255.255.255.255  destination 10.28.10.5
        inet6 fe80::c6ba:27ae:2226:dfa2  prefixlen 64  scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 100  (UNSPEC)
        RX packets 467058  bytes 552751583 (527.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 253762  bytes 16534884 (15.7 MiB)
        TX errors 0  dropped 102112 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.27  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::65b8:5d35:c9e6:b85f  prefixlen 64  scopeid 0x20<link>
        inet6 2404:4408:23f4:5500:cfd3:d82:7d0b:93ce  prefixlen 64  scopeid 0x0<global>
        ether 00:c0:ca:84:7d:51  txqueuelen 1000  (Ethernet)
        RX packets 22208  bytes 23412831 (22.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 364  bytes 43145 (42.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Any help is appreciated. Thanks in advance!

1

What you want to do isn't an easy task and without exact information about your network setup, in particular about the vpn tunnel there cannot be said much in detail. But here are some ideas as far as I can see.

You have two default routes but the RasPi can use only one, the one with the lowest metric, in your case the route through interface eth0:

default via 192.168.1.1 dev eth0 proto dhcp src 192.168.1.26 metric 202
default via 192.168.1.1 dev wlan0 proto dhcp src 192.168.1.27 metric 303

Having two default routes makes only sense to have a fallback route to another gateway but you have it to the same gateway 192.168.1.1. So the setup should only have one default route to the internet.

Then your internet router must decide to what interface eth0 or wlan0 on the RasPi it must send packages belonging to a tcp connection. This is usually done with routing, so you have to configure the router with static routes. On the RasPi the interfaces eth0 and wlan0 must be on different subnets, e.g. 192.168.1.0/24 and 192.168.2.0/24. That's the way routing works. Maybe you can use a subnet 10.??.??.??/?? from the vpn tunnel? But without a concrete test environment I do not have an idea how this all can be achieved.

| improve this answer | |

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.