In my VPN logic all of my client certificates have the folowing CN template:
name.number.mycompany.com
where number is between 2-65536
For each CN I add config file which looks like so:
$ cat name.65501.mycompany.com
ifconfig-push 10.22.255.221 255.255.0.0
So basically based on the CN number area I configure the static ip in the relevant file,
conversion from number to ip logic:
$ python3 -c "print('10.22.{}.{}'.format(*divmod(65501, 256)))"
10.22.255.221
Is there a way to do it dynamically in the config with a script or something else, instead of adding client config file everytime?