Adding static route based on a script
Posted: Thu Feb 24, 2022 3:58 pm
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:
So basically based on the CN number area I configure the static ip in the relevant file,
conversion from number to ip logic:
Is there a way to do it dynamically in the config with a script or something else, instead of adding client config file everytime?
name.number.mycompany.com
where number is between 2-65536
For each CN I add config file which looks like so:
Code: Select all
$ cat name.65501.mycompany.com
ifconfig-push 10.22.255.221 255.255.0.0
conversion from number to ip logic:
Code: Select all
$ python3 -c "print('10.22.{}.{}'.format(*divmod(65501, 256)))"
10.22.255.221