0

I have a server (CentOS 8) with Openvpn 2.4 setup on it, and I want to assign dedicated IPs to each of my clients, so they always get the same dedicated IP each time they log in, How can I approach this?

Thanks in advance

Alex Aref
  • 115
  • 5

1 Answers1

2

You can specify IP addresses per client in the ipp.txt file. The format of the file is a CSV that looks like this:

dalaran,10.8.0.8,2001:db8:131d:c91f::1001
brill,10.8.0.12,2001:db8:131d:c91f::1002
theramore,10.8.0.16,2001:db8:131d:c91f::1003

First is the client name. This will be the name of the client as given in its OpenVPN client certificate. Second is the IPv4 address, and third is the IPv6 address.

Your OpenVPN server configuration file should specify to use the ipp.txt file to store addresses. This is the default, but if you make a custom configuration file you should be sure to include it.

ifconfig-pool-persist ipp.txt
Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • What if I don't have an IPv6 address? – Alex Aref Jun 16 '20 at 15:01
  • Also as I read somewhere, I can't just buy dedicated IP addresses, so where can I possibly get them to assign each client his own static IP? thanks for answering – Alex Aref Jun 16 '20 at 15:02
  • 1
    You should get IPv6, then. If your provider doesn't give it to you, you are using the wrong provider. And not providing IPv6 over your VPN will cause leakage. – Michael Hampton Jun 16 '20 at 15:04
  • 10.8.0.* is like an internal IP address for the client to connect to the Server, But I meant to give them dedicated/static IP addresses so they can surf the internet with this static and unique IP, – Alex Aref Jun 16 '20 at 18:06
  • 1
    @AlexAref You can do that too. – Michael Hampton Jun 16 '20 at 19:43