T
T
Typ6o_CycJIuk2015-08-15 15:08:18
openvpn
Typ6o_CycJIuk, 2015-08-15 15:08:18

How to setup static ip address for OpenVPN client by one key?

I broke my head ... more than sure the issue is solved in a couple of lines, I would like to know which ones ...
Task:
There is a server with a deployed OPENVPN, there are, say, 2 clients (located on the other side of the city), it is necessary to view certain client files from the server, clients ping to the ip-address assigned to the WindowsTAP network card, and of course, I see the shared files I need. So, naively, I tried to manually enter the ip address I needed for the openvpn network card, but every time the client PC is rebooted, the network card defaults = \ After reading a mountain of topics on this problem, I realized that there was a problem in the configs. In general, I need to assign the ip addresses I need to client PCs.
Server config

# Поднимаем L3-туннель
dev tun
# Протокол
proto udp
# Порт который слушает впн
port (такой-то)
# Ключи и сертификаты
duplicate-cn
ca ca.crt
cert server.crt
key server.key 
dh dh1024.pem
# Грубо говоря экономим адреса
topology subnet
# Пул адресов
server 192.168.2.0 255.255.255.0
# Метод шифрования
cipher AES-128-CBC
# Сжатие
comp-lzo
# Немного улучшит пинг
mssfix
# Время жизни клиентов, если не откликнулся — отключает
keepalive 10 120
# Уровень отладки
verb 3
client-to-client
push «dhcp-option DNS 192.168.2.1»

Client config
client
dev tun
proto udp
# Адрес и порт сервера
remote (здесь имя подключения и порт)
# Ключи должны лежать в папке с конфигом
ca ca.crt
cert client.crt
key client.key
cipher AES-128-CBC
nobind
comp-lzo
persist-key
persist-tun
verb 3

PS I got this miracle without any explanations and documentation, it was configured by a person with whom there is no connection ... The whole scheme works on one key, i.e. all clients have the same encryption key. Also, all machines are in the domain, although it seems to me that this is not important here.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem @Jump, 2015-08-15
Tag

ifconfig-pool-persist ipp.txt

T
Typ6o_CycJIuk, 2015-08-15
@Typ6o_CycJIuk

Added a line
after the line to the server config
Then created ipp.txt in the same directory where the openvpn config is located in it the
following
code Or even reboot the server?
Guys, the topic is still relevant ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question