OPNsense Forum

English Forums => Virtual private networks => Topic started by: Paul_Senger on February 20, 2023, 06:50:01 PM

Title: Access far ressources via wireguard (routing problem)
Post by: Paul_Senger on February 20, 2023, 06:50:01 PM
Hi,

I stuck with my wireguard configuration. I tried to draw a litte overview to illustrate the use case I want to realize. (Access a far ressource with multiple clients).

--------------------                     -----------------------                       ---------------------                 --------------
|  Client 1          |                   |                       |                     |                     |               |  example     |
|  PC                |-------------------|OPNsense with Wireguard|-------------------->|Router with Wireguard|-------------->| (FTP)Server  |
|                    |                   |  Client               |                     |  Server             |               |              |
--------------------                     -----------------------                       ---------------------                 --------------
--------------------                        |  |
|  Client 2          |                       |  |
|  PC                |-----------------------   |
--------------------                           |
--------------------                           |
|  Client 3          |                          |
|  PC                |---------------------------
--------------------

I'm at the point, where I can ping from the opnsense the destinated router and the ftp-server. But I can't reach them from the client pc's. For my understanding I didn't create all needed routing rules or something. Second, am I right, that the configuration of the clients via DHCP (fixed ip adresses based on mac adresses from opnsense dhcp-server, has no impact on the wireguard config? I have no idea, where the problem is and how I have to procedd.
I would be appreciated if somebody can help me.

Thanks you very much in advance.

Paul
Title: Re: Access far ressources via wireguard (routing problem)
Post by: Paul_Senger on February 26, 2023, 06:50:59 PM
After playing a litte bit around.
Could it be possible, that there is a problem with the circumstance, that i provide my local ipadresses via dhcp? Do I have to provide/add a special route for reaching the far clients though wireguard via dhcp?

Thanks

Paul
Title: Re: Access far ressources via wireguard (routing problem)
Post by: Greelan on February 27, 2023, 06:20:19 AM
You should be able to achieve this by firewall rules (policy based routing) and allowed IPs in WG
Title: Re: Access far ressources via wireguard (routing problem)
Post by: Paul_Senger on February 27, 2023, 01:57:39 PM
I set a source=any and destination=any role for the wg interface. Just for test, if it works in general. After it worked, it wanted to set the rule more resticted.
But even with this "all" rule it didn't work.
Title: Re: Access far ressources via wireguard (routing problem)
Post by: Paul_Senger on February 28, 2023, 05:27:56 PM
Ok, it seems I found the solution.
I have to create a NAT Outbound rule, where I have to set the wg interface as "Interface" and the Source addess to "LAN net".
Now every local client can reach the far ressources.  ;D