Quantcast
Channel: Active questions tagged openvpn - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 823

Wireguard through openvpn

$
0
0

I'm a total noob in networking but need to connect 2 VPN.

  • OPENVPN-CLIENT: Connected to cyberghost
  • WIREGUARD: I use it to connect to my remote server

I want wireguard to be routed through openvpn-client so when I connect my phone to wireguard, all the trafic goes through cyberghost.

I've this docker-compose.yml

version: "3.8"services:  # hs-openvpn service  hs-openvpn:    container_name: hs-openvpn    image: dperson/openvpn-client:latest      restart: always    ports:      - "51820:51820/udp"    labels:      - "traefik.enable=true"      - "traefik.http.routers.wireguard.entrypoints=web,websecure"      - "traefik.http.routers.wireguard.rule=Host(`vpn.mydomain.com`)"      - "traefik.http.routers.wireguard.tls.certresolver=letsencrypt"      - "traefik.http.routers.wireguard.tls=true"      - "traefik.http.services.wireguard.loadbalancer.server.port=51821"    cap_add:      - NET_ADMIN    volumes:      - openvpn_data:/vpn      - /dev/net/tun:/dev/net/tun    sysctls:      - net.ipv4.ip_forward=1      - net.ipv4.conf.all.src_valid_mark=1    networks:      - default    dns:      - 208.67.222.222      - 208.67.220.220  # hs-wireguard service  hs-wireguard:    image: weejewel/wg-easy:latest    container_name: hs-wireguard      depends_on:      - hs-openvpn    environment:      - PASSWORD=SOME_PASSWORD      - WG_HOST=HOST_IP      - WG_DEFAULT_DNS=1.1.1.1      - WG_MTU=1420      - WG_PORT=51820         volumes:      - wireguard_data:/etc/wireguard    restart: always    cap_add:      - NET_ADMIN      - SYS_MODULE    sysctls:      - net.ipv4.ip_forward=1      - net.ipv4.conf.all.src_valid_mark=1    logging:      driver: json-file      options:        max-size: 50m    network_mode: "service:hs-openvpn"networks:  default:    name: internal-network    external: truevolumes:  # openvpn volumes  openvpn_data:    driver: local    driver_opts:      type: none      o: bind      device: /mnt/docker-data/openvpn/data  # wireguard volumes  wireguard_data:    driver: local    driver_opts:      type: none      o: bind      device: /mnt/docker-data/wireguard/data

It seems to work as I can connect to wireguard GUI through vpn.mydomain.com.The tricky part is when I connect my phone to wireguard, I see there is some trafic with the GUI but I don't receive any response on my phone

For additional help, here is the output of ip route

docker run -it --net container:hs-wireguard nicolaka/netshoot ip route0.0.0.0/1 via 10.2.4.1 dev tun0 default via 172.18.0.1 dev eth0 10.2.4.0/24 dev tun0 proto kernel scope link src 10.2.4.132 10.8.0.0/24 dev wg0 proto kernel scope link src 10.8.0.1 45.133.193.4 via 172.18.0.1 dev eth0 128.0.0.0/1 via 10.2.4.1 dev tun0 172.18.0.0/16 dev eth0 proto kernel scope link src 172.18.0.23

Thank you in advance for the help


Viewing all articles
Browse latest Browse all 823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>