A
A
Alim Abdualim2021-08-26 15:21:17
openvpn
Alim Abdualim, 2021-08-26 15:21:17

Problem with port forwarding with openvpn?

Hello. I wanted to raise a mobile proxy server on Android using the servers ultimate.apk program. Since the ip addresses from the operators are not public, I forwarded port 8080 from the remote server to the local port 8080 using openvpn. The problem is that when a person connects to a proxy server, the traffic goes back to the vpn server along the following chain user>vps_ip:8080>10.8.0.2:8080>vpn_server>google.com. The endpoint of the chain is a vpn server and I would like the endpoint to be a proxy server on android. Those. Now Google sees the ip from the vpn server, but it needs to be seen from the proxy server. I will be grateful for any help.
Here are the iptables rules: iptables -t nat -A PREROUTING -d 194.87.98.202 -p tcp -m tcp --dport 8080 -j DNAT --to-destination 10.8.0.2:8080
iptables -t nat -A POSTROUTING -d 10.8.0.2 -p tcp -m tcp --dport 8080 -j SNAT --to-source 10.8.0.1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2021-08-26
@res2001

Apparently the VPN server is the default route on android.
There is a line in the Android OpenVPN config: Remove. It is she who adds the default route through the VPN server.
push "redirect-gateway def1 bypass-dhcp"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question