I have a centos 6 VPS configured 1 network interface binding with 4 IPs, for example 172.x.x.11, 172.x.x.12, 172.x.x.13, 172.x.x.14 binding with venet0:0, venet0:1, venet0:2, venet0:3.
I have pptpd service running on the server. Client can connect to the PPTP VPN service with each one of the 4 IPs, but when the package forwarded to destination, the IP always be the main IP of the server, i.e. 172.x.x.11.
For example , a user is request a page of twitter.com by connecting to 172.x.x.13 with PPTP VPN client, but twitter.com see the request is from 172.x.x.11. How should I setup the server (maybe iptables, route) to make the incoming and outgoing IP same?
This is what I set iptables for ip forwading:
-A POSTROUTING -s 192.168.24.0/255.255.255.0 -o venet0 -j MASQUERADE
This is the route command result:
[root@bla1 ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
link-local * 255.255.0.0 U 1002 0 0 venet0
default * 0.0.0.0 U 0 0 0 venet0