OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Virtual private networks »
  • Unbound wireguard client to openvpn
« previous next »
  • Print
Pages: [1]

Author Topic: Unbound wireguard client to openvpn  (Read 786 times)

systeme

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
    • View Profile
Unbound wireguard client to openvpn
« on: July 10, 2024, 08:32:06 am »
Hi,

I have a problem and can´t find any solutions.

Client Wireguard (Instance : 172.17.32.193/28) -------> Opnsense (LAN : 172.19.1.0/24) -------> OpenVPN (Tunnel Network : 172.28.0.0/16)

Part of my setup:

- 2x WAN
- IPSEC Connections (new method)
- WireGuard with multiple interfaces
- Wireguard Interface Rules has a ANY rule WG0  (used for my test)
- VPN > OpenVPN > Servers (Legacy)

OpenVPN configuration :
Tunnel Network : 172.28.0.0/16
Local Nets : 172.19.1.0/24

The connection is present (VIP : 172.28.0.6) and I have an "OK" status in "Connection Status".

Since Opnsense to VIP (OpenVPN) :
The ping is OK from Opnsense without specifying a source.
The ping is OK when specifying 172.19.1.253 (GW LAN) as the source.

Since WG Client to VIP (OpenVPN)  :
The ping is KO, and does not go through the WG tunnel.
I tried to create a SNAT rule (Firewall > Automation > Source NAT) specifying 172.19.1.253 as the translation address, but there seems to be a route problem.

How can I specify that the OPNsense needs the Wireguard Net as additional local network on the OpenVPN connection?

Thank you in advance for your help.
Logged

Patrick M. Hausen

  • Hero Member
  • *****
  • Posts: 6935
  • Karma: 584
    • View Profile
Re: Unbound wireguard client to openvpn
« Reply #1 on: July 10, 2024, 08:54:46 am »
Just add it to the "Local Nets" field of the OpenVPN configuration. You can specify as many networks in there as necessary.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

systeme

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Unbound wireguard client to openvpn
« Reply #2 on: July 10, 2024, 09:08:39 am »
Thank you for your reply, unfortunately I had already tried it and I've just done it, but it doesn't change anything.

For IPSec I had the same problem, which was solved by mentioning my WG instance in the SPD section and creating an entry in SNAT using the IP of my gateway on the LAN side for translation.

https://forum.opnsense.org/index.php?topic=41108.msg201474#msg201474
Logged

Patrick M. Hausen

  • Hero Member
  • *****
  • Posts: 6935
  • Karma: 584
    • View Profile
Re: Unbound wireguard client to openvpn
« Reply #3 on: July 10, 2024, 09:20:36 am »
OpenVPN and IPsec work completely differently in that  aspect.

What's in "AllowedIPs" in the WireGuard client settings?
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

systeme

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Unbound wireguard client to openvpn
« Reply #4 on: July 10, 2024, 09:44:57 am »
Unique tunnel IP address WG, IPsec network and I have add the  "Tunnel Network"  OpenVPN.
Logged

Patrick M. Hausen

  • Hero Member
  • *****
  • Posts: 6935
  • Karma: 584
    • View Profile
Re: Unbound wireguard client to openvpn
« Reply #5 on: July 10, 2024, 09:53:18 am »
Then use tcpdump to trace the packets as they enter through one tunnel and watch where they leave ...
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

systeme

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Unbound wireguard client to openvpn
« Reply #6 on: July 10, 2024, 04:01:36 pm »
The ping from my WG peer doesn't go out and goes through my local IP instead of through the WG tunnel. If I force the ping on the WG tunnel interface, it doesn't work either.
So no packet received on my host with the OpenVPN client (during tcpdump).
However, I can ping the WG peer from the OpenVPN client...

Does anyone have any ideas? Thanks in advance.
Logged

Patrick M. Hausen

  • Hero Member
  • *****
  • Posts: 6935
  • Karma: 584
    • View Profile
Re: Unbound wireguard client to openvpn
« Reply #7 on: July 10, 2024, 04:05:09 pm »
Quote from: systeme on July 10, 2024, 04:01:36 pm
The ping from my WG peer doesn't go out and goes through my local IP instead of through the WG tunnel.
Double check if the destination IP is really part of the AllowedIPs on that end of the tunnel. Check the routing table. Type e.g. "wg" and check the output.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

systeme

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Unbound wireguard client to openvpn
« Reply #8 on: July 10, 2024, 05:06:19 pm »
I have 2 opnsense (primary and slave) where this tunnel appears, but a different IP range for the "Virtual Network".
When I check with the keyword "wg" (primary), the route 172.28.0.0/16 is not listed, but my secondary's route 172.29.0.0/16 is.

What I can't explain?

So I disabled the tunnel on the secondary and took its IP range 172.29.0.0/16 (Virtual Network) and put it on the primary.
The 172.29.0.0/16 range is indeed listed as "Allowed Address" on the WG side.

The ping from my WG peer comes out fine this time through the WG tunnel, so there's an improvement.
Since it goes through the tunnel, the ping appears in the Live View and is in "pass" status when I filter the Virtual IP of my OpenVPN client (172.29.0.6).
However, it doesn't reach the destination. I'm still looking for a solution.

Thanks for any help
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Virtual private networks »
  • Unbound wireguard client to openvpn
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2