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
All clients connected to openvpn server get assigned the ip address
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 220.127.116.11 to 18.104.22.1686, 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:
For each user assign a fixed ip:
vim ccd/elmasry-client1 #add the following line: ifconfig-push 22.214.171.124 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
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?