(edit: problem resolved!)
Alright guys, just a warning: I'm very new to this stuff.
I have already setup a VPN (and use it just as a proxy, pretty much) using pptpd on a VPS that I purchased. After some tinkering around, I was able to get it to work. However, my VPS actually has two public IPs. The etc/network/interfaces has eth0 and eth0:0. I'm currently only able to log in and use a single IP, the one that is specified under eth0.
Here are my settings. I might be providing more info than is needed, I'm quite new to this.
/etc/network/interfaces:
Code:
auto eth0
iface eth0 inet static
address 199.***.***.113
gateway 199.***.***.1
netmask 255.255.254.0
auto eth0:0
iface eth0:0 inet static
address 199.***.***.101
gateway 199.***.***.1
netmask 255.255.254.0
auto lo
iface lo inet loopback
/etc/ppp/chap-secrets:
Code:
# Secrets for authentication using CHAP
# client server secret IP addresses
testname pptpd testpassword *
/etc/rc.local:
Code:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
exit 0
Those settings work properly when I connect to 199.***.***.113 as a VPN. What I want to be able to do is to also have the option of connecting to 199.***.***.101 as a VPN and be given that IP. Is this possible?
If I try to add an iptables rule and specify eth0:0 instead of eth0, that won't work because apparently iptables does not understand aliases.
Any help is appreciated. Thanks!
edit: Assigning IPs to each user (rather than using *) under chap-secrets, and then using that ip as the source in the iptables postfoward in conjunction with -j SNAT --to-source seemed to work. Nevermind!