OPNsense Forum

English Forums => Virtual private networks => Topic started by: develissimo on March 12, 2022, 12:13:14 PM

Title: OpnSense as OpenVPN Server => ignore Server GW but use specific client as GW
Post by: develissimo on March 12, 2022, 12:13:14 PM
Hi folks,

i am stuck.

What i try to achieve is to use OpenVPN-Client(B) as GW to another OpenVPN Client(A).
OpenVPN-Server network 10.10.7.0/24 hosted by OpnSense.

Setup:
OpenVPN-Client(A) [10.10.7.210] => ([OpenVPN-Server] [on OpnSense]) <= WAN <= External OpenVPN-Client(B)[10.10.7.222] (This clients gateway should be used to surf the web.)

What works:


Both clients have internet access. But Client(A) is only using internet connection provided by GW of the OpnSense WAN-address unable to use Client(B) as its gateway.

Client(A) routes:


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.10.7.222     128.0.0.0       UG    0      0        0 tun0
10.10.7.0       0.0.0.0         255.255.255.0   U     0      0        0 tun0
128.0.0.0       10.10.7.1       128.0.0.0       UG    0      0        0 tun0
192.168.0.0     0.0.0.0         255.255.255.0   U     100    0        0 eth0





Problem:

So the issue is => Client(A) is unable to use Client(B) as its GW.

How was this analyzed:

On Client(A) a check for external IP always resolves to OpnSense WAN IP.
To check furhter i use tcpdump on Client(B) but it clearly shows only traffic from Client(A) arrives on Client(B) when a direct communication is issued. Such as "ssh from A => B" or "Ping from A => B".
Info: Client(B) has ip forwarding activated, but not yet helpful as there do not arrive packets to be forwarded on Client(B).

All other outgoing traffic from Client(A) seems to be forced to use the OpnSense GW ignoring the route to Client(B).

What am i doing wrong?

Thanks for your help in advance,
Kind regards Raphael