I'd like to insure that transmission only sends/receives traffic when the server it runs on is connected to a VPN.
I found this question which is similar but I don't want to force all traffic through the VPN and I haven't been able to find a good guide on how to use firestarter from the command line.
Instead I was thinking of using ufw, but I have little to no experience with firewalls, and I'm hopping the community can help me out.
One idea I had would be to force transmission to use a specific port, say 33442, and then only allow traffic to and from that port from the IP address of the VPN server. I checked out the Ubuntu server guide and I think could do something like this:
sudo ufw enable sudo ufw deny port tcp from localhost to any port 33442 sudo ufa allow port tcp from localhost to VPNIP port 33442 sudo ufw deny port udp from localhost to any port 33442 sudo ufa allow port udp from localhost to VPNIP port 33442
Does this logic hold it's salt? How would you do it? What would I use for VPNIP, the public IP of the VPN server, or should I specify the local subnet range that the VPN connects me to?
Thanks for your help!