Transmission with Surfshark reddit / selfhosted ---------------------------------------------------------------------- rilkman · 2023-09-28 02:29 Hi, I am trying to set up transmission with Surfshark in a Docker container, but it is not working as expected. I am using the docker run: docker run --cap-add=NET_ADMIN -d \ --name=transmission\ -e PUID=1000 \ -e PGID=1000 \ -v /home/husky/husky-share/data:/data \ -v /home/husky/husky-share/downloads:/downloads \ -v /home/husky/husky-share/incomplete:/incomplete-downloads \ -e OPENVPN_PROVIDER=SURFSHARK \ -e OPENVPN_CONFIG=\ -e OPENVPN_USERNAME=[USERNAME]\ -e OPENVPN_PASSWORD=[PASSWORD] \ -e LOCAL_NETWORK=192.168.0.51/24 \ -e TRANSMISSION_DOWNLOAD_DIR=/downloads\ -e TRANSMISSION_INCOMPLETE_DIR=/incomplete-downloads\ --log-driver json-file\ --log-opt max-size=10m \ -p 9091:9091 \ --restart=always \ haugene/transmission-openvpn I am unable to connect using my local IP ([`192.168.0.51:9091`](https://192.168.0.51:9091)), and when I run `docker logs -f transmission`, I get: Starting container with revision: 81277fb6f8ae6aeb57f913172d4d45c7af8c0b31 TRANSMISSION_HOME is currently set to: /config/transmission-home Creating TUN device /dev/net/tun Using OpenVPN provider: SURFSHARK Running with VPN_CONFIG_SOURCE auto No bundled config script found for SURFSHARK. Defaulting to external config Will get configs from https://github.com/haugene/vpn-configs- contrib.git Cloning https://github.com/haugene/vpn-configs-contrib.git into /config/vpn-configs-contrib Cloning into '/config/vpn-configs-contrib'... Found configs for SURFSHARK in /config/vpn-configs- contrib/openvpn/surfshark, will replace current content in /etc/openvpn/surfshark No VPN configuration provided. Using default. Modifying /etc/openvpn/surfshark/default.ovpn for best behaviour in this container Modification: Point auth-user-pass option to the username/password file sed: can't read /etc/openvpn/surfshark/default.ovpn: No such file or directory Modification: Change ca certificate path sed: can't read /etc/openvpn/surfshark/default.ovpn: No such file or directory Modification: Change ping options sed: can't read /etc/openvpn/surfshark/default.ovpn: No such file or directory sed: can't read /etc/openvpn/surfshark/default.ovpn: No such file or directory sed: can't read /etc/openvpn/surfshark/default.ovpn: No such file or directory sed: can't read /etc/openvpn/surfshark/default.ovpn: No such file or directory Modification: Update/set resolv-retry to 15 seconds Modification: Change tls-crypt keyfile path Modification: Set output verbosity to 3 Modification: Remap SIGUSR1 signal to SIGTERM, avoid OpenVPN restart loop Modification: Updating status for config failure detection Setting OpenVPN credentials... adding route to local network 192.168.0.51/24 via 172.17.0.1 dev eth0 Error: Invalid prefix for given prefix length. I am still very new to all networking and basically knew nothing a week ago. Sorry if this is a very basic problem, I couldn't find anything that worked online, any help is greatly appreciated ---------------------------------------------------------------------- NikStalwart · 2023-09-28 03:54 A couple of things: * I presume you are using Surfshark because it is "free". Using a free VPN is like using used underpants you find in a public bathroom at a central city station. There's a *technical possibility* nothing bad will happen, but that possibility is about as likely as aliens landing on your lawn and giving you a million dollars. * The log you posted shows a bunch of sed errors. Does the directory exist? Does default.ovpn exist? * I don't like that you are trying to use a 172.16.0.0/12 gateway with a 192.168.0.0/16 subnet. Why are you doing that? Why do you think that's a good idea? * I highly recommend using a compose file (even for single-service deployments) as it simplifies (re)starting containers instead of having to manage that ugly docker run command line. * Regarding your edit: the repo you linked does not have a default.ovpn file, so of course you will be getting the sed errors — sed is trying to edit something that *doesn't exist* (cue Jocasta Nu meme here). Having given that general advice, I'm afraid I do not use openvnpn nor transmission and certainly not surfshark so I cannot help *specifically* with your situation. Maybe ask the maintainer? ---------------------------------------------------------------------- rilkman · 2023-09-28 04:11 Hi, thank you for your reply. Surfshark is the VPN I've been using for a while, and I do pay for it. The directory and default.ovpn do not exist. I have tried creating the directory, adding a .ovpn file, and specifying it using `OPENVPN_CONFIG=\` . That removed the sed but I still had `Error: Invalid prefix for given prefix length` Sorry, I don't quite understand what you mean when you say "172.16.0.0/12 gateway with a 192.168.0.0/16 subnet". I don't think I set anything like that, and I thought it was automatic(??), but I could be completely mistaken. ---------------------------------------------------------------------- NikStalwart · 2023-09-28 04:24 > Sorry, I don't quite understand what you mean when you say "172.16.0.0/12 gateway with a 192.168.0.0/16 subnet". I don't think I set anything like that, and I thought it was automatic(??), but I could be completely mistaken. Okay so let's do a crash course on networking. There are three "local" networks: * 10.0.0.0/8 * 192.168.0.0/16 * 172.16.0.0/12 Docker, by default, uses the 172.16.0.0/12 subnet for its routes because most people tend to use the first two options and forget that this one exists. You supplied "192.168.0.51/24" as an environment variable to your container. Firstly, this is an *address* but not a *network*. The *network* is 192.168.0.0/24, while ...51 is a *host on that network*. Secondly, your container's IP is something like 172.16.1.2, but the software inside that container is trying to configure settings for 192.168.0.51. Of course this will not work. If you want to change the subnet docker will use, there are other settings for this. /16, /24, etc is [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter- Domain_Routing#CIDR_notation). It refers to the size of the network. > My surfshark subscription expires early next year and im considering just getting Nord cause it's listed as an internal provider which should make some of this easier correct? I would not trust any VPN provider with a marketing budget greater than $5. ---------------------------------------------------------------------- rilkman · 2023-09-28 05:52 Thank you for your help, I think I understand. Unfortunately I'm away from home at the moment but I'll give it a go when I get a chance tonight, or more likely tomorrow morning. Would I be able to pm you then if I have any questions? ---------------------------------------------------------------------- NikStalwart · 2023-09-28 08:17 I guess you can, but I should warn you that (a) I live on the other side of the world from you; (b) I don't use the services you are using so I can only provide common sense advice; which leads into (c) because I can only offer common sense advice, I am likely to become increasingly snarky while doing so.