D
D
dm1rt1y2019-05-08 18:11:31
linux
dm1rt1y, 2019-05-08 18:11:31

How to reach the device through OpenVPN?

There is a vps with external ip xxxx . An openvpn server is deployed on it, to which the client is connected. The client inside the tunnel has ip 10.8.0.2 and vps 10.8.0.1 . It is required that all calls to the external ip vps on port 1234 be transmitted through the vpn tunnel to the client 10.8.0.2. Now I can "reach out" to a client with vps through its vpn ip's, but I can't forward this port to an external ip. I dug up all the manuals, tried all sorts of manipulations on ifconfig - it still doesn't work.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
brar, 2019-05-08
@dm1rt1y

Something like this.

iptables -t nat -A PREROUTING -d x.x.x.x -p tcp --dport 1234 -j DNAT --to-dest 10.8.0.2:1234

P
Petro Skip, 2019-05-08
@voronin_10

you need to register a route for the client on the VPN server
and make sure that it is created when connecting by
writingroute print -4

M
Mikhail Osher, 2017-04-18
@nurba91

([az]+)\s+:\s(\d+\.?\d*)([az]+)

https://regex101.com/r/NpdfmD/2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question