Сервер с topology subnet
Добавил в Advanced сервера
;ifconfig-pool-persist /../../ips.list
В ips.list:
user1,10.11.11.20
user2,10.11.11.77
В логе OVPN появилось следующее:
openvpn[64176]: ifconfig_pool_read(), in='user1,10.11.11.20', TODO: IPv6
Apr 7 09:49:51 openvpn[64176]: succeeded -> ifconfig_pool_set()
Apr 7 09:49:51 openvpn[64176]: ifconfig_pool_read(), in='user2,10.11.11.77', TODO: IPv6
Apr 7 09:49:51 openvpn[64176]: succeeded -> ifconfig_pool_set()
Т.е сервер, похоже, реально резервирует адреса.
user1 и user2 стали получать назначенные адреса.
Адреса остальных пользователей автоматически добавляются сервером в ips.list при подключении и, вероятно, закрепляются за ними.
Редактировать ips.list можно при остановленном экземпляре OVPN-сервера\при гарантированном отсутствии подключений. Иначе при запущенном сервере получить ошибку - порт занят, сервер падает и не запускается (видно в логе). Помогает перезагрузка pfSense.
И нужно ли переводить лист в режим только для чтения(ifconfig-pool-persist /conf/ovpns1.ipp 0)
Вероятно - нужно. Мануал говорит так:
–ifconfig-pool-persist file [seconds]
Persist/unpersist ifconfig-pool data to file, at seconds intervals (default=600), as well as on program startup and shutdown.The goal of this option is to provide a long-term association between clients (denoted by their common name) and the virtual IP address as‐signed to them from the ifconfig-pool. Maintaining a long-term association is good for clients because it allows them to effectively use the –persist-tun option.
file is a comma-delimited ASCII file, formatted as <common-name>,<ip-address>.
If seconds = 0, file will be treated as read-only. This is useful if you would like to treat file as a configuration file.
Однако:
Note that the entries in this file are treated by OpenVPN as suggestions only, based on past associations between a common name and IP address. They do not guarantee that the given common name will always receive the given IP address. If you want guaranteed assignment, use
--ifconfig-push</ip-address></common-name>