LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-28-2011, 10:20 PM   #1
RichyP
LQ Newbie
 
Registered: Dec 2011
Posts: 1

Rep: Reputation: Disabled
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!

Last edited by RichyP; 12-29-2011 at 03:48 AM.
 
Old 12-29-2011, 03:53 PM   #2
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
Originally Posted by RichyP View Post
(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).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Public IPs with VirtualBox tedmp0816 Linux - Networking 3 01-05-2011 02:58 PM
multiple IPs over VPN st3reo Linux - Networking 2 06-15-2008 07:02 AM
Linux as a router but for multiple public IPs gnirtS Linux - Networking 8 03-07-2005 03:08 PM
Router with multiple public IPs Neodymium Linux - Newbie 1 04-13-2004 06:39 PM
Multiple NIC cards - public and private IPs harryinjapan Linux - Networking 2 12-02-2001 04:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration