I have limited knowledge of iptables, but I read answers to similar questions here and tried to implement it.
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo iptables -t nat -A PREROUTING -i ppp+ -p tcp --dport 80 -j DNAT --to-destination 192.168.1.99:8888
sudo iptables -t nat -A PREROUTING -i ppp+ -p tcp --dport 443 -j DNAT --to-destination 192.168.1.99:8888
Objective:
VPN server install on : 192.168.1.36
HTTP Proxy server 192.168.1.99:8888
VPN users connect to pptpd (via wlan0)
\ | /
|
|
/ \
http everything else
https |
| |
| |
proxy |
server |
|
|
internet (via wlan0)
The objective is to pass the http/https traffic through proxy server. I can not configure a proxy server on a device, but I need to reroute its traffic through proxy server. So I thought I can do it through VPN.
What am I doing wrong?
Edit: I have already installed CA root certificate on the subject device. So I'll have no issues intercepting/monitoring the communication once I get past this iptables issue.