M
M
mrxakerrus2017-11-23 02:16:55
linux
mrxakerrus, 2017-11-23 02:16:55

Openvpn connects to the server, but the ports are not forwarded, how to solve?

from the server I can access the telnet device at the address given by openvpn, but from a remote computer I can’t connect from the white ip and port, maybe I’m specifying iptables incorrectly, iptables -t nat -A PREROUTING -d server ip/32 -p tcp - m tcp --dport 554 -j DNAT --to-destination 10.8.0.16:554

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kivva, 2017-11-23
@mrxakerrus

enable the client-to-client option in the server configuration - allows openvpn clients to communicate (most likely, it will take off without it)
and tell Linux that packets can be transferred through itself:

echo 1 > /proc/sys/net/ipv4/ip_forward

If anything, this is how my rules sound:
iptables -t nat -A PREROUTING -d mysite.ru -p tcp --dport 32901 -j DNAT --to-dest 12.0.1.29:8730
iptables -t nat -A POSTROUTING -d 12.0.1.29 -p tcp --dport 8730 -j SNAT --to-source 12.0.1.1

We process the returning packet with the second rule, otherwise the question will come, and the answer will hang, lost in the gap between the vpn router and the physical machine

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question