>Le 03/09/2023 à 08:48, Jason Long via Openvpn-users a écrit :
> Hello, > When I use "server 10.8.0.0 255.255.255.0" in the Server.conf file, then > OpenVPN assigns IP addresses to clients respectively. What should I do if I > want to assign a specific IP >address to a client with a specific computer > name or MAC address? > >What should you do? You should read the docs. Really. >Do your homework, Jason. Many questions you're asking here have a simple >answer via "man" commands or by simply googling them. And this is typically >one of them. >$ man openvpn >Excerpt: > --client-config-dir dir Specify a directory dir for >custom client config files. After a connecting client has been authenticated, >OpenVPN will look in this >directory for a file having the same >name as the client's X509 common name. If a matching file exists, it > will be opened and parsed for client-specific configuration >>options. If no matching file is found, OpenVPN will instead try >to open and parse a default file called "DEFAULT", which may be provided but >is not required. Note that >the configura‐ tion files must be >readable by the OpenVPN process after it has dropped it's root privileges. > This file can specify a fixed IP address for a given >client using >--ifconfig-push, as well as fixed subnets owned by the client >using --iroute >If what you meant wasn't exactly that, and if you really want to use the name >of the machine or its mac address instead of its common name, please provide >more insight about >why you would really want to do that. Asking questions out >of the blue, without any perceivable goal, is a real deterrent. >Bruno Hello, As I said, I have some scenario and I want to learn more. Do you mean "ccd-exclusive"? If yes, then I edited the Server.conf as below: ifconfig 20.1.0.1 255.255.255.0 mode server tls-server client-config-dir ccd ccd-exclusive And: # cat ccd/client 10.0.2.0 255.255.255.0 ifconfig-push 20.1.0.202 20.1.0.201 After it, a client whose CN name is "client", always takes IP address 20.1.0.202. Am I right? How can I give the IP address by MAC address? _______________________________________________ Openvpn-users mailing list Openvpn-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-users _______________________________________________ Openvpn-users mailing list Openvpn-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-users