this post was submitted on 29 Jun 2023
6 points (75.0% liked)

Selfhosted

39190 readers
391 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

I have a paid external vpn(Nordvpn using gluetun) and am currently hosting my own wireguard vpn on my server through docker. is there a way to get the traffic from my selfhosted vpn to tunnel through my paid vpn? This is my docker-compose file atm.

services:
  gluetun_test:
    image: qmcgaw/gluetun
    container_name: gluetun_test
    cap_add:
      - NET_ADMIN
    ports:
      - "5010:5000"
      # Port of the WireGuard VPN server
      - "36843:36843/udp"
    environment:
      - VPN_SERVICE_PROVIDER=nordvpn
      - VPN_TYPE=wireguard
      - WIREGUARD_PRIVATE_KEY=redacted
      - SERVER_COUNTRIES=United Kingdom

  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

wg0.conf

[Interface]
Address = 10.252.1.0/24
ListenPort = 36843
PrivateKey = redacted
MTU = 1450
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
Table =

Any help would be great! Thanks!

you are viewing a single comment's thread
view the rest of the comments
[–] sudneo 4 points 1 year ago (3 children)

Sorry, I am not super clear of what you are asking.

You do have gluetun which is used to connect to NordVPN. Then you have wireguard, to which you connect from somewhere, and you want essentially:

client -> wireguard -> wireguard container -> gluetun container -> internet?

[–] TelepathicWalrus 2 points 1 year ago (2 children)

Yeah, this is correct. I have a self-hosted Wireguard VPN which i connect to and i want my internet traffic to go through the gluetun docker through nordvpn. client -> wireguard container -> gluetun container -> internet

[–] Bekar_vai 2 points 1 year ago (1 children)
[–] TelepathicWalrus 2 points 1 year ago

This didnt seem to help much. My problem is that when i tell the wireguard server to use gluetun as its network mode, i can not get any traffic to go from the client -> wireguard(my own server) -> gluetun(connected to nordvpn) -> internet as i want.