Help with selfhosted wireguard routed through gluetun
Hi there,
I wish to run a wireguard docker through a glueton docker so that i can access my paid vpn from my own server. This is what i want:
client -> wireguard docker(selfhosted) -> gluetun docker(connected to paid VPN) -> internet
I have posted before with this issue but still cannot get it to work as expected. I am not sure if there is issues with the wireguard docker not being able to route back through from gluetun as it is trying to force traffic through the tunnel.
Any help would be much appreciated.
docker-compose.yml:
services:
gluetun_test:
image: qmcgaw/gluetun
container_name: gluetun_test
cap_add:
- NET_ADMIN
ports:
- "5010:5000"
- "5011:8000"
# Port of the WireGuard VPN server
- "36843:36843/udp"
environment:
- VPN_SERVICE_PROVIDER=custom
- VPN_TYPE=wireguard
- WIREGUARD_PUBLIC_KEY=
- WIREGUARD_PRIVATE_KEY=
- VPN_ENDPOINT_IP=ip
- VPN_ENDPOINT_PORT=port
- WIREGUARD_ADDRESSES="10.2.0.2/32"
wireguard:
image: linuxserver/wireguard:latest
container_name: wireguard
cap_add:
- NET_ADMIN
environment:
- PUID=1000
- PGID=1000
volumes:
- ./wireguard/config:/config
# ports:
# Port for WireGuard-UI
# - "5010:5000"
# Port of the WireGuard VPN server
# - "36843:36843/udp"
network_mode: service:gluetun_test
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
Gluetun can expose a http or socks proxy. No need to setup a vpn to access your paid VPN..
If you want access outside your LAN to your paid VPN it's best to setup a WG tunnel separate from docker, on the firewall. Than connect to your personal WG tunnel en set the http/socks proxy.