I've installed openvpn on Centos 7 server. My client can connect but I need use a static ip. I 've search many solutions on web but I've not fix the problem.
Beneath you can view my configuration files
Thanks a lot for any suggestions
port 1193
proto udp4
dev tun
# OpenVPN Server Certificate - CA, server key and certificate
ca /etc/openvpn/server/ca.crt
cert /etc/openvpn/server/hakase-server.crt
key /etc/openvpn/server/hakase-server.key
user nobody
group nobody
daemon
#DH and CRL key
dh /etc/openvpn/server/dh.pemcrl-verify /etc/openvpn/server/crl.pem
# Network Configuration - Internal network
# Redirect all Connection through OpenVPN Server
server 10.8.0.0 255.255.255.0
push "route 192.168.x.0 255.255.255.0" #use subnet to access at server end
topology subnet
--compress lzo
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
remote-cert-eku "TLS Web Client Authentication"
# Client config directory
# client-config-dir clientstatici
ifconfig-pool-persist clientstatici/ipp.txt 0
tls-auth server/ta.key 0
client-to-client
# TLS Security
cipher AES-256-CBC
tls-version-min 1.2
tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-$
auth SHA512
auth-nocache
# Other Configuration
keepalive 20 60
persist-key
persist-tun
comp-lzo yes
daemon
user nobody
group nobody
# OpenVPN Log
log-append /var/log/openvpn.log
status /var/log/openvpn-status.log
verb 3
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
##############################################
client
dev tun
proto udp
# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
remote aaa.bbb.ccc.ddd 1193
# Choose a random host from the remote
# list for load-balancing. Otherwise
# try hosts in the order specified.
;remote-random
# Most clients don't need to bind to
# a specific local port number.
nobind
# Downgrade privileges after initialization (non-Windows only)
;user nobody
;group nobody
# Try to preserve some state across restarts.
persist-key
persist-tun
ca ca.crt
cert clientIP10.crt
key clientIP10.key
tls-auth ta.key 1
remote-cert-tls server
cipher AES-256-CBC
auth SHA512
auth-nocache
tls-version-min 1.2
tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-128-CBC-SHA256
resolv-retry infinite
compress lzo
nobind
persist-key
persist-tun
mute-replay-warnings
verb 3
ipp.txt
clientIP10,10.8.0.10
clientIP11,10.8.0.11
clientIP12,10.8.0.12
clientIP13,10.8.0.13
clientIP14,10.8.0.14
clientIP15,10.8.0.15
clientIP16,10.8.0.16
clientIP17,10.8.0.17
clientIP18,10.8.0.18
clientIP19,10.8.0.19
clientIP20,10.8.0.20
this is /var/log/openvpn.log after a restart of service
Fri May 29 14:52:57 2020 OpenVPN 2.4.9 x86_64-redhat-linux-gnu [Fedora EPEL patched] [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Apr 24 2020
Fri May 29 14:52:57 2020 library versions: OpenSSL 1.0.2k-fips 26 Jan 2017, LZO 2.06
Fri May 29 14:52:57 2020 Diffie-Hellman initialized with 2048 bit key
Fri May 29 14:52:57 2020 CRL: loaded 1 CRLs from file /etc/openvpn/server/crl.pem
Fri May 29 14:52:57 2020 Outgoing Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Fri May 29 14:52:57 2020 Incoming Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Fri May 29 14:52:57 2020 TUN/TAP device tun0 opened
Fri May 29 14:52:57 2020 TUN/TAP TX queue length set to 100
Fri May 29 14:52:57 2020 /sbin/ip link set dev tun0 up mtu 1500
Fri May 29 14:52:57 2020 /sbin/ip addr add dev tun0 10.8.0.1/24 broadcast 10.8.0.255
Fri May 29 14:52:57 2020 Socket Buffers: R=[212992->212992] S=[212992->212992]
Fri May 29 14:52:57 2020 UDPv4 link local (bound): [AF_INET][undef]:1193
Fri May 29 14:52:57 2020 UDPv4 link remote: [AF_UNSPEC]
Fri May 29 14:52:57 2020 GID set to nobody
Fri May 29 14:52:57 2020 UID set to nobody
Fri May 29 14:52:57 2020 MULTI: multi_init called, r=256 v=256
Fri May 29 14:52:57 2020 IFCONFIG POOL: base=10.8.0.2 size=252, ipv6=0
Fri May 29 14:52:57 2020 ifconfig_pool_read(), in='clientIP10,10.8.0.10', TODO: IPv6
Fri May 29 14:52:57 2020 succeeded -> ifconfig_pool_set()
Fri May 29 14:52:57 2020 ifconfig_pool_read(), in='clientIP11,10.8.0.11', TODO: IPv6
Fri May 29 14:52:57 2020 succeeded -> ifconfig_pool_set()
Fri May 29 14:52:57 2020 ifconfig_pool_read(), in='clientIP12,10.8.0.12', TODO: IPv6
Fri May 29 14:52:57 2020 succeeded -> ifconfig_pool_set()
Fri May 29 14:52:57 2020 ifconfig_pool_read(), in='clientIP13,10.8.0.13', TODO: IPv6
Fri May 29 14:52:57 2020 succeeded -> ifconfig_pool_set()
Fri May 29 14:52:57 2020 ifconfig_pool_read(), in='clientIP14,10.8.0.14', TODO: IPv6
Fri May 29 14:52:57 2020 succeeded -> ifconfig_pool_set()
Fri May 29 14:52:57 2020 ifconfig_pool_read(), in='clientIP15,10.8.0.15', TODO: IPv6
Fri May 29 14:52:57 2020 succeeded -> ifconfig_pool_set()
Fri May 29 14:52:57 2020 ifconfig_pool_read(), in='clientIP16,10.8.0.16', TODO: IPv6
Fri May 29 14:52:57 2020 succeeded -> ifconfig_pool_set()
Fri May 29 14:52:57 2020 ifconfig_pool_read(), in='clientIP17,10.8.0.17', TODO: IPv6
Fri May 29 14:52:57 2020 succeeded -> ifconfig_pool_set()
Fri May 29 14:52:57 2020 ifconfig_pool_read(), in='clientIP18,10.8.0.18', TODO: IPv6
Fri May 29 14:52:57 2020 succeeded -> ifconfig_pool_set()
Fri May 29 14:52:57 2020 ifconfig_pool_read(), in='clientIP19,10.8.0.19', TODO: IPv6
Fri May 29 14:52:57 2020 succeeded -> ifconfig_pool_set()
Fri May 29 14:52:57 2020 ifconfig_pool_read(), in='clientIP20,10.8.0.20', TODO: IPv6
Fri May 29 14:52:57 2020 succeeded -> ifconfig_pool_set()
Fri May 29 14:52:57 2020 ifconfig_pool_read(), in='', TODO: IPv6
Fri May 29 14:52:57 2020 IFCONFIG POOL LIST
Fri May 29 14:52:57 2020 clientIP10,10.8.0.10
Fri May 29 14:52:57 2020 clientIP11,10.8.0.11
Fri May 29 14:52:57 2020 clientIP12,10.8.0.12
Fri May 29 14:52:57 2020 clientIP13,10.8.0.13
Fri May 29 14:52:57 2020 clientIP14,10.8.0.14
Fri May 29 14:52:57 2020 clientIP15,10.8.0.15
Fri May 29 14:52:57 2020 clientIP16,10.8.0.16
Fri May 29 14:52:57 2020 clientIP17,10.8.0.17
Fri May 29 14:52:57 2020 clientIP18,10.8.0.18
Fri May 29 14:52:57 2020 clientIP19,10.8.0.19
Fri May 29 14:52:57 2020 clientIP20,10.8.0.20
Fri May 29 14:52:57 2020 Initialization Sequence Completed