P
P
profaller2015-10-06 18:04:35
openvpn
profaller, 2015-10-06 18:04:35

How to forward a port to a client through OpenVPN?

The bottom line is - I need to make it possible to connect to my local machine on port 80 (the machine behind the provider's nat). Raised on vps OpenVPN, everything works, everything opens. But I don't know how exactly to force the server to redirect, for example from port 666, to port 80 of my machine that is connected to the vpn.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Q
quik, 2015-10-06
@quik

If your machine uses a VPN server as the default gateway, then the following iptables construction is suitable
: 80
iptables -t nat -A POSTROUTING -s internal_machine_address_inside_VPN/32 -p tcp -m tcp --sport 666 -j SNAT --to-source external_server_address_VPN:80

V
Vlad Zhivotnev, 2015-10-07
@inkvizitor68sl

The easiest way is through rinetd - https://debian.pro/523

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question