I have a Raspberry Pi running transmission, OpenVPN client, and a few other apps to help automate torrent handling. Files are downloaded straight to an NFS share on my NAS (WD My Cloud EX2 Ultra) that is mounted on the Pi. It's a setup that works well from a usability standpoint, but it's a lot for the Pi to handle and it tends to run hot, so I'd like to see if I can offload some of that to other devices.
My NAS is capable of running transmission and I also have a spare router (Linksys WRT3200ACM) which I've already flashed with OpenWRT that I can use for OpenVPN. If I've correctly interpreted the advice I previously received here, spreading out the workload in this way should alleviate some of the stress on the Pi without causing too much on the NAS and the router. The question is, how do I set things up so that transmission (running on the NAS) is properly routed through the VPN (running on the router), and everything is able to communicate with one another?
Some things to keep in mind: the ISP gateway isn't capable of anything advanced like bridge mode. I think my only options are to cascade my router LAN-to-LAN, or setup IP passthrough on the gateway and just run everything on my router. And I'd really like it if I can avoid spending any money on additional equipment and use only what I already have at my disposal. Also, if I am going the cascade route, can I use a different SSID on the VPN router so I can selectively connect other devices if I wish to route them through the VPN?
To keep things simple, you could add static route on NAS to 0.0.0.0/0 via OpenWrt.
I don't understand what that means. Like assign a static IP address for the NAS in OpenWRT settings?
That is also possible. With static IP/mask you need to provide the gateway and DNS also manually. What I had in mind was to get IP/mask/DNS from DHCP and use a different gateway with a lower, more preferred metric, manually. This would override the DHCP advertised gateway.
I'm sorry but I'm a total novice at these things. Can you provide the directions to do that, or a link to some please?
ETA: Here's my setup (as I've envisioned it, but maybe not final depending on the advice I receive here):
OpenWRT router LAN 1 > ISP gateway LAN 1 in cascade.
Pi > ISP gateway LAN 2.
NAS > ISP gateway LAN 3 (with only transmission routed through VPN on OpenWRT router).
NAS > OpenWRT router LAN 2 (still with only transmission traffic routed through VPN and other NAS traffic bypassing VPN).
All other devices > ISP gateway LAN or WiFi, but with the option of connecting to OpenWRT WiFi (meaning different SSID from ISP gateway) so that they can go through VPN.
If something like that is not possible, then I can setup IP passthrough on ISP gateway and basically use it as just a modem with my entire network running on the OpenWRT router.
EDIT 2: I'm guessing something like this is what I need. In particular, the second bullet point under "IPv4/IPv6/Port-Based Policies": VPN Policy-Based Routing + Web UI -- Discussion
EDIT 3: There's also this: https://openwrt.org/docs/guide-user/network/wifi/relay_configuration
Setting the static IP/mask/gateway or adding a static route for the nas and the Pi is outside of the scope of this forum. But I suppose it cannot be hard, as it is quite common.
If the router uses the vpn as default gateway then you don't need anything extra. Otherwise you could use the PBR. The relay doesn't apply here.