LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Setting up a VPN that utilizes multiple public IPs (https://www.linuxquestions.org/questions/linux-networking-3/setting-up-a-vpn-that-utilizes-multiple-public-ips-920980/)

RichyP 12-28-2011 10:20 PM

Setting up a VPN that utilizes multiple public IPs
 
(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!

lithos 12-29-2011 03:53 PM

Quote:

Originally Posted by RichyP (Post 4560563)
(edit: problem resolved!)

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!

This is great that you found your solution. It's a nice thing you have it posted back so others might find it.

If it's solved, could you please use the Thread tools to mark thread as Solved (please read my signature if you want to know how).


All times are GMT -5. The time now is 04:58 AM.