Answer the question
In order to leave comments, you need to log in
OpenVPN Ubuntu Iptables port forwarding to client's LAN?
There is a VPN server, the Ubuntu tun0 (10.8.0.10) client is connected to it, the client has an enp2s0 (192.168.0.60) interface through which you can access other network devices in the client's local network 192.168.0.X.
The question is, what parameters need to be set for the client in Iptables in order to get to the client's devices through the VPN?
I tried like this, but it didn't work.
iptables -t nat -A PREROUTING -p tcp -d 10.8.0.10 --dport 80 -j DNAT --to-destination 192.168.0.X:80
iptables -t nat -A POSTROUTING -p tcp --dst 192.168.0 .X --dport 80 -j SNAT --to-source 10.8.0.10:80
iptables -t nat -A OUTPUT --dst 10.8.0.10 -p tcp --dport 80 -j DNAT --to-destination 192.168.0 .X:80
iptables -I FORWARD 1 -i tun0 -o enp2s0 -d 192.168.0.X -p tcp -m tcp --dport 80 -j ACCEPT
net.ipv4.ip_forward = 1 enabled.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question