0

I have an OpenVPN server (pivpn.io), and three server clients.

I'm trying to set a static IP address, for the VPN clients.

I've created ipp.txt /etc/openvpn/ccd/ipp.txt.

The file ipp.txt uses the following syntax:

[client name],[ip address] miami-test,10.8.0.5

When connecting the server is not issuing a static ip address.

0

That's because that is not how you manually assign IP addresses. There is a file ipp.txt that OpenVPN can maintain, so that clients (sometimes) get the same IP address reassigned to them if they reconnect or OpenVPN restarts.

See the sample config:

# Maintain a record of client <-> virtual IP address
# associations in this file.  If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist ipp.txt

But that's not what you've configured.

The files in the ccd directory are interpreted as client-specific configuration. So creating a file ccd/ipp.txt causes OpenVPN to attempt to interpret the file's contents as directives applying to a client named ipp.txt.

This doesn't appear to be what you want.

Let's go back to the sample config:

# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).

# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
#   ifconfig-push 10.9.0.1 10.9.0.2

So it looks like you want a file named ccd/miami-test containing ifconfig-push 10.8.0.5 10.8.0.6.

0

I added the following to /etc/openvpn/server.conf:

ifconfig-pool-persist ipp.txt

client-config-dir /etc/openvpn/ccd

I renamed /etc/openvpn/ccd/miami-test.user to /etc/openvpn/ccd/miami-test

I rebooted the Miami server, and used pivpn -c which displays a list of the clients, and Miami-test is now using 10.8.0.8 (the static ip address i assigned it).

Thanks, for the Help!

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.