I've been googling for a solution to my case and tried some stuff, but the solutions I found didn't fit very well. Also, if this is not the correct place to ask, please let me know.
Currently, I have my network set up like this:
- Personal devices that use PiHole as DNS. e.g., Local LAN 192.168.1.0
- Device that has country-restricted/aware apps and content. e.g., 192.168.1.10
- Home gateway at 192.168.1.1, using PiHole as a DNS. e.g., 192.168.1.2
Personal PCs ______ Raspberry Pi --- PiHole DNS (Docker)
(and other stuff) \ |
\ |
Device that \ |
Must use a VPN ---------- Home Router ---- Internet
This particular device has IP/DNS/Gateway settings but no VPN/Proxy configuration, but I'd like to force all its network usage through a VPN after PiHole (So, PiHole would still be the DNS for this device). How could I accomplish this using a Docker container or VM while leaving the rest of the network alone?
In a nutshell, I'm trying to accomplish this:
_ Force Internet Traffic through VPN _
/ while using PiHole as DNS sink \
/ \
Device that _____/ Raspberry Pi --- VPN Container (OpenVPN Client)
Must use a VPN \ | |_ PiHole DNS (Docker)
\ |
Personal PCs \ |
(and other stuff) ------- Home Router ---- Internet
I could do this by buying a router with a VPN config and making this device connect to the internet via this router, of course. But I know that there's a way of doing it via software.
So, the questions here are the following:
- I'm not well-versed in networking on Linux. Could you please point me somewhere with more or less cohesive (and up-to-date) resources on the subject?
- If I set up a Docker container with a bridged network and the OpenVPN client on it, is it possible to accomplish this using IPTables/UFW rules? Or should I spin up a full-fledged router OS for this?
- My router doesn't have configurable LAN routes. Only WAN/LAN routes.
Is there a way to force it via IP or route packages from a given MAC?
Thank you in advance!