LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 11-23-2013, 10:10 AM   #1
Naxiz
LQ Newbie
 
Registered: May 2012
Distribution: Debian Sid
Posts: 9

Rep: Reputation: Disabled
OpenVPN one client has multiple IPs


I've installed OpenVPN server on Debian (sid), but I noticed something weird.

When I connect a client (client1), it gets the IP 10.8.0.6. Then I connect another client (client2) who gets 10.8.0.10.

Where did the 4 IPs between them go?

Also, in the ipp.txt file:
Code:
client1,10.8.0.4
client2,10.8.0.8
The IPs in the file are different from the IPs the clients get.

Is this normal, and is it possible to get something like:
Code:
client1,10.8.0.100
client2,10.8.0.101
Thanks!
 
Old 11-24-2013, 11:25 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Each OpenVPN client has its own network with 4 addresses. The netmask should be 255.255.255.252 also known as /2. In this case the /2 form is easier to work with; it means all but the last two bits of the address are the adress of the network. The last two bits -- which are always 00, 01, 10 and 11 -- represent the network itself, the OpenVPN server, the OpenVPN client and broadcast address.

Using your example of 10.8.0.6 and 10.8.0.10, decimal 6 in binary is 110 and decimal 10 in binary is 1010. They both end in 10, as do all OpenVPN client IP addresses when the last component is converted to binary. The OpenVPN server similarly allocates itself an address ending in 01 for each client. The corresponding <whatever>00 address is the network address and the <whatever>11 address is the broadcast address.

There must be a good reason why OpenVPN is designed this way rather than using a point-to-point network for each client with a netmask of 255.255.255.253 and no "network address" or "broadcast address" ... ?

EDIT:

The contents of the ipp.txt file are the network address parts of the networks given to each client. Each one, when converted to binary, ends in 100. The first address, with last component decimal 4, is the network address for the first client. Adding the four possible values of the last two bits -- 00, 01, 10 and 11 -- gives:
  • 10.8.0.4 + binary 00 is 10.8.0.4: the network address
  • 10.8.0.4 + binary 01 is 10.8.0.5: the OpenVPN server's address for the first client
  • 10.8.0.4 + binary 10 is 10.8.0.6: the first OpenVPN client's address
  • 10.8.0.4 + binary 11 is 10.8.0.7: the broadcast address on the first OpenVPN client's network

Last edited by catkin; 11-24-2013 at 11:41 AM.
 
1 members found this post helpful.
Old 11-25-2013, 06:44 AM   #3
Naxiz
LQ Newbie
 
Registered: May 2012
Distribution: Debian Sid
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thank you very much for your explanation!
 
  


Reply



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
Can openvpn client connect to multiple servers? Skaperen Linux - Networking 5 09-27-2013 12:21 PM
How to login multiple client pc on using via openvpn server from client side raja6525 Linux - Networking 1 11-24-2010 09:42 AM
OpenVPN assigning public & static IPs to pcs/devices behind an OpenVPN client dgonzalezh Linux - Networking 6 07-18-2010 09:50 AM
OpenVpn Multiple clients gets the same client ip Buddhike G Linux - Software 2 03-09-2010 05:29 AM

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

All times are GMT -5. The time now is 09:59 PM.

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