port 12348
;proto tcp
proto udp
;dev tap
dev tun
;dev-node MyTap
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/sparhawk.crt
dh /etc/openvpn/keys/dh1024.pem
server 192.168.83.0 255.255.255.0
ifconfig-pool-persist ipp.txt
;server-bridge 192.168.83.1 255.255.255.0 192.168.83.50 192.168.83.100
push "redirect-gateway"
keepalive 10 120
cipher DES-CBC
;max-clients 100
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
log-append openvpn.log
verb 3
;mute 20
Пробовал менять tun на tap, server на server-bridge. Ничего не помогает - все равно всем клиентам выдается один и тот же IP-адрес (192.168.83.4 или 192.168.83.50 в случае bridge).
Также пробовал задавать диапозон адресов напрямую через ifconfig-pool - та же проблема.
Подскажите, в чем может быть проблема. Заранее благодарен!
port 12348
;proto tcp
proto udp
;dev tap
dev tun
;dev-node MyTap
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/sparhawk.crt
dh /etc/openvpn/keys/dh1024.pem
server 192.168.83.0 255.255.255.0
ifconfig-pool-persist ipp.txt
;server-bridge 192.168.83.1 255.255.255.0 192.168.83.50 192.168.83.100
push "redirect-gateway"
keepalive 10 120
cipher DES-CBC
;max-clients 100
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
log-append openvpn.log
verb 3
;mute 20
Пробовал менять tun на tap, server на server-bridge. Ничего не помогает - все равно всем клиентам выдается один и тот же IP-адрес (192.168.83.4 или 192.168.83.50 в случае bridge).
Также пробовал задавать диапозон адресов напрямую через ifconfig-pool - та же проблема.
Подскажите, в чем может быть проблема. Заранее благодарен!
ip из ipp.txt
в соответствии с ключиком присваиваться должны.
Насколько я понимаю все обстоит несколько иначе.
user@localhost
$ man openvpn
--ifconfig-pool-persist file [seconds]
Persist/unpersist ifconfig-pool data to file, at seconds inter‐
vals (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 assigned 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 use‐
ful 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 com‐
mon name will always receive the given IP address. If you want
guaranteed assignment, use --ifconfig-push
Данный файл нужен для назначения клиенту того же адреса в случае, например, перезагрузке сервера. Но он не предназначен для выдачи клиентам постоянных адресов.
ip из ipp.txt
в соответствии с ключиком присваиваться должны.
Насколько я понимаю все обстоит несколько иначе.
user@localhost
$ man openvpn
--ifconfig-pool-persist file [seconds]
Persist/unpersist ifconfig-pool data to file, at seconds inter‐
vals (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 assigned 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 use‐
ful 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 com‐
mon name will always receive the given IP address. If you want
guaranteed assignment, use --ifconfig-push
Данный файл нужен для назначения клиенту того же адреса в случае, например, перезагрузке сервера. Но он не предназначен для выдачи клиентам постоянных адресов.
разве ?
ifconfig-pool-persist /etc/openvpn/client-addresses.txt 0
Вам видео не скинуть?)
Откуда тогда по вашему клиенту настройки приезжают?))
Возможно я и ошибся.
Но у меня клиенты берут адрес из файла настроек находящегося в --client-config-dir. И обратите внимание, приведенная Вами строка ifconfig-pool-persist /etc/openvpn/client-addresses.txt 0 просто предоставляет данную возможность.
Спасибо за указание еще одной возможности.
Возможно я и ошибся.
Но у меня клиенты берут адрес из файла настроек находящегося в --client-config-dir. И обратите внимание, приведенная Вами строка ifconfig-pool-persist /etc/openvpn/client-addresses.txt 0 просто предоставляет данную возможность.
Спасибо за указание еще одной возможности.
client-config-dir /etc/openvpn/ccd
у меня это
root@inet:/etc/openvpn/ccd# ls
domovoy1 domovoy2 domovoy3
root@inet:/etc/openvpn/ccd# cat domovoy1
#роуты которые на клиенте локально выполняются.
push "route 192.168.11.0 255.255.255.0 10.8.0.1"
root@inet:/etc/openvpn/ccd#
Можете показать что у вас там?, буду только рад узнать что то более новое.