25
Solved: How can containers be forced to use a VPN?
(programming.dev)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
Gluetun, is overkill if you already have a working setup. Your system is able to handle this in a much simple way with built in tools.
You can use
systemd
to restrict some daemon to your your VPN IP. For instance here's an example of doing that with transmission: override of the default unit by using the following command:Then type what you need to override:
Another option, might be to restrict it to a single network interface:
Save the file and run
systemctl daemon-reload
followed bysystemctl restart transmission-daemon.service
and it should be applied.This is a simple and effective solution that doesn't require more stuff.
Thanks, great to know! systemd can really do a lot.
Anti Commercial-AI license