-
Basically, I want to use a Gluetun container as my gateway for some other containers. However, I want to do it with my static IP from Windscribe. I also want to forward port 12345. So I want a container to be accessible at port 12345 through my Windscribe static IP. I can create a manual device on Windscribe and define a port, but it gives me some OpenVPN information that I don't see a space for in the Gluetun compose file. "Connect IP" is not asked for when creating an OpenVPN Gluetun container. I also don't see a way to tell it what ports I want to forward. Any advice? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
If you have a .ovpn file that works using the OpenVPN GUI or other client, you could always try the custom provider option in Gluetun. I stepped through this recently (#1470) with someone wanting to connect to their own OpenVPN Access Server. There's a bunch of back-and-forth you can ignore due to an inaccurate .ovpn file being posted initially (comment "#" marks removed for some reason), but the ultimate answer might be workable for you. |
Beta Was this translation helpful? Give feedback.
-
If you look at Docker compose below, you'll see that the name of the .ovpn file is established with OPENVPN_CUSTOM_CONFIG, and then that file on the host computer is bound to the /gluetun/yourfilename.ovpn:ro file in the container. Use of the VPN provider "custom" tells gluetun that you're going to be using your own config file: version: '3.7'
services:
gluetun:
image: qmcgaw/gluetun:latest
container_name: gluetun
cap_add:
- NET_ADMIN
environment:
- VPN_SERVICE_PROVIDER=custom
- VPN_TYPE=openvpn
- OPENVPN_CUSTOM_CONFIG=/gluetun/xxx.ovpn # Replace with the actual name of your .ovpn file
- OPENVPN_USER=openvpn # OpenVPN AS username here (openvpn is the default user)
- OPENVPN_PASSWORD=xxx # Password associated with the username
- TZ=US/Mountain # Timezone in standard Linux format
volumes:
- /data/openvpnas/xxx.ovpn:/gluetun/xxx.ovpn:ro # Bind the directory/filename to /gluetun/xxx.ovpn here with ro option
- /data/openvpnas:/gluetun # /data/openvpnas will be used for servers.json |
Beta Was this translation helpful? Give feedback.
-
@bnhf |
Beta Was this translation helpful? Give feedback.
-
If you're using separate stacks for your other containers, you should structure them to only use Gluetun to get the Internet. Here's an example of how it would be done with a Firefox container (something I like to use for testing). It may be possible to do it through the Portainer network tab, but this way there are no extra steps: version: '3.7'
services:
firefox:
image: lscr.io/linuxserver/firefox:latest
container_name: firefox
environment:
- PUID=1000
- PGID=1000
- TZ=US/Mountain
volumes:
- /data/firefox:/config
shm_size: '1gb'
network_mode: 'container:gluetun' All of your Gluetun dependent containers can also be put in the same stack, which I prefer -- but either way works. In the same stack, the networking section for each service (container) would look like this: network_mode: 'service:gluetun'
depends_on:
- gluetun And any ports you need to open, for any container in the stack, get listed in the Gluetun section. |
Beta Was this translation helpful? Give feedback.
-
I wanted to post as I ran into the same issue. The following section helped me https://github.com/qdm12/gluetun/wiki/Windscribe#vpn-server-port-forwarding setting FIREWALL_VPN_INPUT_PORTS to the port that I set up to forward. It started working. |
Beta Was this translation helpful? Give feedback.
@ShieldsPC
If you're using separate stacks for your other containers, you should structure them to only use Gluetun to get the Internet. Here's an example of how it would be done with a Firefox container (something I like to use for testing). It may be possible to do it through the Portainer network tab, but this way there are no extra steps:
All of your Gluetun dependent containers can also be put in the s…