M
M
madcatdev2022-01-21 22:57:27
openvpn
madcatdev, 2022-01-21 22:57:27

OpenVPN - how to set up access to the client's LAN?

There is an OpenVPN network with a range of 10.0.0.0/24 and several hosts:
Server on OpenWRT, LAN 192.168.10.2, VPN 10.0.0.1
Client on Ubuntu, LAN 192.168.20.2, VPN 10.0.0.2
Client on Windows, addresses do not matter.

The following options are specified in the OpenVPN server config:

push "route 192.168.10.0 255.255.255.0"
route 192.168.20.0 255.255.255.0 10.0.0.2

Windows and Ubuntu see the LAN address of OpenWRT (192.168.10.2), while the LAN address of Ubuntu (192.168.20.2) is inaccessible from both Windows and OpenWRT.
On OpenWRT, an entry appears in the route table after starting the server:
$route
...
192.168.20.0     10.0.0.2       255.255.255.0   UG    0      0        0 tun0

The firewall on Ubuntu is disabled for the duration of testing, forwarding is enabled (sudo sysctl net.ipv4.ip_forward=1).
How to make Ubuntu client's subnet or at least its LAN address (192.168.20.2) accessible via VPN?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hint000, 2022-01-22
@madcatdev

You need to add iroute (while also leaving the currently available routes).
More details were here: https://qna.habr.com/q/276200 (only there, on the contrary, the person registered iroute, but did not register route).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question