S
S
Sergey Twin2020-05-24 20:28:48
linux
Sergey Twin, 2020-05-24 20:28:48

How to set static DHCP for OpenVPN client/server?

Good day!

I have been using OpenVPN for 2 years for secure transmission and connection to the server.
There was a need for each client to register static DHCP on the server (internal network 10.8.0.1/24)

What and where should be registered so that DHCP clients on the server are issued statically?

Client config

client
dev tun
proto udp
sndbuf 0
rcvbuf 0
remote IP 443
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
setenv opt block-outside-dns
key-direction 1
verb 3


Server config
port 443
proto udp
dev tun
sndbuf 0
rcvbuf 0
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-auth ta.key 0
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 88.208.9.14"
push "dhcp-option DNS 88.208.9.15"
keepalive 10 120
cipher AES-256-CBC
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
verb 3
crl-verify crl.pem


Issuance occurs using a modified script automatically

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmytro Yunh, 2020-05-24
@SergeyTwin

Sergey Twin , read about the server option:
client-config-dir

D
Dmitry, 2020-05-24
@Tabletko

In ipp and indicate the correspondence between the client and the address

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question