Need help with static IP assignments to clients

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
cheetah2003
OpenVpn Newbie
Posts: 1
Joined: Sun Feb 26, 2017 6:08 pm

Need help with static IP assignments to clients

Post by cheetah2003 » Sun Feb 26, 2017 6:23 pm

Hope this is ok to ask in here, I've been messing with this for a while now and I'm just not seeming able to get the result I desire.

Basically my layout is thus: I have a home network which is a few computers and virtuals machines. I have a cloud based VPN server I want to connect to. I have laptops and remote machines I want to also connect via the cloud VPN server.

Now currently I have all this working pretty decently actually. I have everything configured with an OpenVPN in bridging mode, so it's all ethernet bridge from every client to the server, clients can talk to each other fine and all that.

Where my problem lies, is I want to be able to assign static IP's to my remote clients that connect up. I've tried setting a client-config-dir and making a file in there with the same name as the CN of the client, but it doesn't seem to work at all. The clients still keeps getting an IP out of my pool.

If any of you can help me figure out how to make a specific client get a static IP assignment, that'd be great.

I'm going to include the server configuration. I'm not sure if the client config file is needed? Everything is running via tap devices.
Server Configuration
port xxx
proto xxx

dev tap

ca xxx
cert xxx
key xxx
dh xxx

# manual configuration
client-to-client
mode server
tls-server
topology "subnet"
push "topology subnet"
ifconfig 10.0.0.161 255.255.255.0
ifconfig-pool 10.0.0.162 10.0.0.171 255.255.255.0

client-config-dir /etc/openvpn/ccd

keepalive 10 120

cipher AES-256-CBC
comp-lzo

user nobody
group nogroup

persist-key
persist-tun

status openvpn-status.log

verb 1

daemon
The client CN name file in 'ccd' just has 'ifconfig-push 10.0.0.19 255.255.255.0'

Any tips would be appreciated, thanks!

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

Re: Need help with static IP assignments to clients

Post by TinCanTech » Sun Feb 26, 2017 8:18 pm

You have not read how to create your --server-bridge .. If your server works it is by luck not judgement.

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

Post Reply