OpenVPN - Dedicated IP

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
AmirAlamani
OpenVpn Newbie
Posts: 2
Joined: Sat May 20, 2017 9:45 am

OpenVPN - Dedicated IP

Post by AmirAlamani » Sat May 20, 2017 9:53 am

I'm trying to setup an OpenVPN server which provides dedicated static IPv4 to each client. (e.g. 8.8.8.8 always for user1)

I have already tried "client-config-dir" method but cannot get it working.

Please advise.

AmirAlamani
OpenVpn Newbie
Posts: 2
Joined: Sat May 20, 2017 9:45 am

Re: OpenVPN - Dedicated IP

Post by AmirAlamani » Sat May 20, 2017 11:43 am

I'm trying to setup an OpenVPN server which provides dedicated static IPv4 to each client.

I have a /24 Public IP address and 200 VPN clients. For example : Client1 -> 172.16.1.1 Client2 -> 172.16.1.2

I think there are two ways to achieve this. 1. set my public address range as DHCP IP pool 2. set /24 internal address as DHCP and use 200 iptables rules to forward packets like below:

iptables -t nat -A POSTROUTING -s 172.16.1.2 -o eth0:2 -j MASQUERADE

pons are that It would require 200 virtual interfaces and iptables rules.

method #1 seems to be more logical and I've already made efforts to make it work. OpenVPN connection will be successful but there won't be Internet access.

Already read most available articles on Google including this comprehensive one: http://michlstechblog.info/blog/openvpn ... -a-client/

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: OpenVPN - Dedicated IP

Post by TinCanTech » Sat May 20, 2017 11:56 am

AmirAlamani wrote:I have already tried "client-config-dir" method but cannot get it working.
Try again .. it is simple.

See:
https://openvpn.net/index.php/open-sour ... html#scope

Post Reply