Network Setup:
10.0.0.1 Router: to internet
10.0.0.70 Server: Ubuntu based server,default gateway is 10.0.0.1
10.0.0.51 PC
I created a PPTP connection(interface: ppp0) on Server to a machine on the internet, what I want to do is route all the traffic from certain IP address(10.0.0.51) through the PPTP connection and then to the internet. What I did are:
Set the gateway on PC(10.0.0.51) as 10.0.0.70
Enabled ipv4 forward on 10,0,0,70
Add the masquerade rule to iptable:
iptables -t nat -A POSTROUTING -o ppp0 -s 10.0.0.51 -j MASQUERADE
After that, it seems none of the traffic from 10.0.0.51 be redirected to ppp0, instead these traffic are still going through 10.0.0.1 directly.
Any thoughts on it?