2

For learning purposes, I'm trying to set up openvpn server, so that each connected client would get a unique public ip address.

I have a vps server and I ordered extra 8 static ips and they are rerouted to the vpn server.

What I have so far: - Ubuntu server 14.04 - Working openvpn server and client in tun mode

Current status: All clients connected to openvpn server get assigned the ip address 37.xxx.xxx.112

Plan: Each connected client (Linux pcs running Ubuntu 14.04 as well) gets assigned one of those 8 static ips. They are in the range 46.38.230.249 to 46.38.230.256, but they could have been also non sequential.

I'm just trying to wrap my head around the whole thing, so please help me out:

First solution:

For each user assign a fixed ip:

vim ccd/elmasry-client1

#add the following line:
ifconfig-push 46.38.230.249 10.8.0.5

And using iptables nat do a prerouting/postrouting between this public ip and some internal ip in that subnet, for example 10.8.0.6 Drawback: No IP pool. One fixed IP per user

Second Solution:

Use ifconfig-pool to assign a pool to the users, BUT 1. This option seems to be used for specifying an internal ip pool not external one 2. It can not be specified multiple times, but what if I have several pools, subnet masks

So to wrap up my question: How to configure openvpn server to allocate a unique public IP address from several ip pools?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.