Answer the question
In order to leave comments, you need to log in
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
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
The easiest way is through rinetd - https://debian.pro/523
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question