Hello TinCanTech, thnx for you're time/reply!
Here is my server.config:
#################################################
# Sample OpenVPN 2.0 config file for #
# multi-client server. #
# #
# This file is for the server side #
# of a many-clients <-> one-server #
# OpenVPN configuration. #
# #
# OpenVPN also supports #
# single-machine <-> single-machine #
# configurations (See the Examples page #
# on the web site for more info). #
# #
# This config should work on Windows #
# or Linux/BSD systems. Remember on #
# Windows to quote pathnames and use #
# double backslashes, e.g.: #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
# #
# Comments are preceded with '#' or ';' #
#################################################
# Which local IP address should OpenVPN
# listen on? (optional)
;local xx.xx.xx.xxx
# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one. You will need to
# open up this port on your firewall.
port 1855
# TCP or UDP server?
;proto tcp
proto udp
# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun
# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one. On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
dev-node Ethernet4
# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key). Each client
# and the server must have their own cert and
# key file. The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys. Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).
ca "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\server.crt"
key "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\server.key" # This file should be kept secret
# Diffie hellman parameters.
# Generate your own with:
# openssl dhparam -out dh1024.pem 1024
# Substitute 2048 for 1024 if you are using
# 2048 bit keys.
dh "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\dh1024.pem"
# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
topology subnet
server 172.16.1.0 255.255.255.0
;ifconfig 172.72.16.1 172.72.16.2
# Maintain a record of client <-> virtual IP address
# associations in this file. If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist ipp.txt
# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface. Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0. Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients. Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses. You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge
# Push routes to the client to allow it
# to reach other private subnets behind
# the server. Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
;push "route 172.72.16.0 255.255.255.0"
push "route 192.168.167.0 255.255.255.0"
;push "route 192.168.0.1 255.255.255.0"
;push "route 192.168.0.185 255.255.255.0"
;push "route 192.168.0.150 255.255.255.0"
# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).
# EXAMPLE: Suppose the client
# having the certificate common name "Thelonious"
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
# Then create a file ccd/Thelonious with this line:
# iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN. This example will only work
# if you are routing, not bridging, i.e. you are
# using "dev tun" and "server" directives.
# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
# ifconfig-push 10.9.0.1 10.9.0.2
# Suppose that you want to enable different
# firewall access policies for different groups
# of clients. There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
# group, and firewall the TUN/TAP interface
# for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
# modify the firewall in response to access
# from different clients. See man
# page for more info on learn-address script.
;learn-address ./script
# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
#push "redirect-gateway def1"
push "redirect-gateway def1 bypass-dhcp"
# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses. CAVEAT:
#
http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# push "dhcp-option DNS 192.168.167.169"
# DNS servers provided by opendns.com.
push "dhcp-option DNS 8.8.8.8"
# push "dhcp-option DNS 8.8.4.4"
# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
client-to-client
# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names. This is recommended
# only for testing purposes. For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
;duplicate-cn
# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120
# For extra security beyond that provided
# by SSL/TLS, create an "HMAC firewall"
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
# openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
;tls-auth ta.key 0 # This file is secret
# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
;cipher BF-CBC # Blowfish (default)
cipher AES-128-CBC # AES
;cipher DES-EDE3-CBC # Triple-DES
# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.
;comp-lzo
# The maximum number of concurrently connected
# clients we want to allow.
max-clients 3
# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
;user nobody
;group nobody
# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
;persist-key
persist-tun
# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status openvpn-status.log
# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the "\Program Files\OpenVPN\log" directory).
# Use log or log-append to override this default.
# "log" will truncate the log file on OpenVPN startup,
# while "log-append" will append to it. Use one
# or the other (but not both).
log openvpn.log
;log-append openvpn.log
# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 4
# Silence repeating messages. At most 20
# sequential messages of the same message
# category will be output to the log.
;mute 20
Here is my server log-file
Wed Dec 27 22:53:00 2017 us=739078 XX.YYY.ZZ.AA [laptop-eeepc] Peer Connection Initiated with [AF_INET6]::ffff:XX.YYY.ZZ.AA:57804
Wed Dec 27 22:53:00 2017 us=739078 laptop-eeepc/XX.YYY.ZZ.AA MULTI_sva: pool returned IPv4=172.16.1.8, IPv6=(Not enabled)
Wed Dec 27 22:53:00 2017 us=739078 laptop-eeepc/XX.YYY.ZZ.AA MULTI: Learn: 172.16.1.8 -> laptop-eeepc/XX.YYY.ZZ.AA
Wed Dec 27 22:53:00 2017 us=739078 laptop-eeepc/XX.YYY.ZZ.AA MULTI: primary virtual IP for laptop-eeepc/XX.YYY.ZZ.AA: 172.16.1.8
Wed Dec 27 22:53:04 2017 us=329189 laptop-eeepc/XX.YYY.ZZ.AA PUSH: Received control message: 'PUSH_REQUEST'
Wed Dec 27 22:53:04 2017 us=329189 laptop-eeepc/XX.YYY.ZZ.AA SENT CONTROL [laptop-eeepc]: 'PUSH_REPLY,route 192.168.167.0 255.255.255.0,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 8.8.8.8,route-gateway 172.16.1.1,topology subnet,ping 10,ping-restart 120,ifconfig 172.16.1.8 255.255.255.0,peer-id 0,cipher AES-256-GCM' (status=1)
Wed Dec 27 22:53:04 2017 us=329189 laptop-eeepc/XX.YYY.ZZ.AA Data Channel: using negotiated cipher 'AES-256-GCM'
Wed Dec 27 22:53:04 2017 us=329189 laptop-eeepc/XX.YYY.ZZ.AA Data Channel MTU parms [ L:1549 D:1450 EF:49 EB:406 ET:0 EL:3 ]
Wed Dec 27 22:53:04 2017 us=329189 laptop-eeepc/XX.YYY.ZZ.AA Data Channel Encrypt: Cipher 'AES-256-GCM' initialized with 256 bit key
Wed Dec 27 22:53:04 2017 us=329189 laptop-eeepc/XX.YYY.ZZ.AA Data Channel Decrypt: Cipher 'AES-256-GCM' initialized with 256 bit key
Wed Dec 27 22:58:33 2017 us=689886 laptop-eeepc/XX.YYY.ZZ.AA [laptop-eeepc] Inactivity timeout (--ping-restart), restarting
Wed Dec 27 22:58:33 2017 us=689886 laptop-eeepc/XX.YYY.ZZ.AA SIGUSR1[soft,ping-restart] received, client-instance restarting
Wed Dec 27 23:02:16 2017 us=138861 TCP/UDP: Closing socket
Wed Dec 27 23:02:16 2017 us=139858 Closing TUN/TAP interface
Wed Dec 27 23:02:16 2017 us=146859 TAP: DHCP address released
Wed Dec 27 23:02:16 2017 us=157072 SIGTERM[hard,] received, process exiting
Wed Dec 27 23:02:16 2017 us=157072 MANAGEMENT: >STATE:1514412136,EXITING,SIGTERM,,,,,
Here is my client-log: from my linux-computer
openvpn client_iphone_naar_beer.conf
Wed Dec 27 23:29:35 2017 us=352154 WARNING: file 'laptop-eeepc.key' is group or others accessible
Wed Dec 27 23:29:35 2017 us=352471 Current Parameter Settings:
Wed Dec 27 23:29:35 2017 us=352625 config = 'client_iphone_naar_beer.conf'
Wed Dec 27 23:29:35 2017 us=352773 mode = 0
Wed Dec 27 23:29:35 2017 us=352857 persist_config = DISABLED
Wed Dec 27 23:29:35 2017 us=352923 persist_mode = 1
Wed Dec 27 23:29:35 2017 us=353035 show_ciphers = DISABLED
Wed Dec 27 23:29:35 2017 us=353116 show_digests = DISABLED
Wed Dec 27 23:29:35 2017 us=353194 show_engines = DISABLED
Wed Dec 27 23:29:35 2017 us=353271 genkey = DISABLED
Wed Dec 27 23:29:35 2017 us=353345 key_pass_file = '[UNDEF]'
Wed Dec 27 23:29:35 2017 us=353416 show_tls_ciphers = DISABLED
Wed Dec 27 23:29:35 2017 us=353491 connect_retry_max = 0
Wed Dec 27 23:29:35 2017 us=353566 Connection profiles [0]:
Wed Dec 27 23:29:35 2017 us=353643 proto = udp
Wed Dec 27 23:29:35 2017 us=353714 local = '[UNDEF]'
Wed Dec 27 23:29:35 2017 us=353787 NOTE: --mute triggered...
Wed Dec 27 23:29:35 2017 us=353920 265 variation(s) on previous 15 message(s) suppressed by --mute
Wed Dec 27 23:29:35 2017 us=353991 OpenVPN 2.4.3 i686-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jun 30 2017
Wed Dec 27 23:29:35 2017 us=354090 library versions: OpenSSL 1.0.2l 25 May 2017, LZO 2.08
Wed Dec 27 23:29:35 2017 us=359663 Control Channel MTU parms [ L:1621 D:1212 EF:38 EB:0 ET:0 EL:3 ]
Wed Dec 27 23:29:35 2017 us=493910 Data Channel MTU parms [ L:1621 D:1450 EF:121 EB:406 ET:0 EL:3 ]
Wed Dec 27 23:29:35 2017 us=494218 Local Options String (VER=V4): 'V4,dev-type tun,link-mtu 1557,tun-mtu 1500,proto UDPv4,cipher AES-128-CBC,auth SHA1,keysize 128,key-method 2,tls-client'
Wed Dec 27 23:29:35 2017 us=494373 Expected Remote Options String (VER=V4): 'V4,dev-type tun,link-mtu 1557,tun-mtu 1500,proto UDPv4,cipher AES-128-CBC,auth SHA1,keysize 128,key-method 2,tls-server'
Wed Dec 27 23:29:35 2017 us=494535 TCP/UDP: Preserving recently used remote address: [AF_INET]xx.xx.xx.xx:1855
Wed Dec 27 23:29:35 2017 us=494726 Socket Buffers: R=[163840->163840] S=[163840->163840]
Wed Dec 27 23:29:35 2017 us=494853 UDP link local: (not bound)
Wed Dec 27 23:29:35 2017 us=494992 UDP link remote: [AF_INET]xx.xx.xx.xx:1855
Wed Dec 27 23:29:37 2017 us=790347 TLS: Initial packet from [AF_INET]xx.xx.xx.xx:1855, sid=74299c18 272708c9
Wed Dec 27 23:29:37 2017 us=832976 VERIFY OK: depth=1, C=NL, ST=LB, L=Hegelsom, O=OpenVPN, OU=ICT, CN=hvn, name=hvn, emailAddress=hvneerven@live.com
Wed Dec 27 23:29:37 2017 us=834580 VERIFY KU OK
Wed Dec 27 23:29:37 2017 us=834715 Validating certificate extended key usage
Wed Dec 27 23:29:37 2017 us=834806 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Wed Dec 27 23:29:37 2017 us=834887 VERIFY EKU OK
Wed Dec 27 23:29:37 2017 us=834964 VERIFY OK: depth=0, C=NL, ST=LB, L=Hegelsom, O=OpenVPN, OU=ICT, CN=server, name=server, emailAddress=hvneerven@live.com
Wed Dec 27 23:29:44 2017 us=775128 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 1024 bit RSA
Wed Dec 27 23:29:44 2017 us=775409 [server] Peer Connection Initiated with [AF_INET]xx.xx.xx.xx:1855
Wed Dec 27 23:29:45 2017 us=907195 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Wed Dec 27 23:29:45 2017 us=946671 PUSH: Received control message: 'PUSH_REPLY,route 192.168.167.0 255.255.255.0,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 8.8.8.8,route-gateway 172.16.1.1,topology subnet,ping 10,ping-restart 120,ifconfig 172.16.1.8 255.255.255.0,peer-id 0,cipher AES-256-GCM'
Wed Dec 27 23:29:45 2017 us=947321 OPTIONS IMPORT: timers and/or timeouts modified
Wed Dec 27 23:29:45 2017 us=947561 OPTIONS IMPORT: --ifconfig/up options modified
Wed Dec 27 23:29:45 2017 us=947733 OPTIONS IMPORT: route options modified
Wed Dec 27 23:29:45 2017 us=947900 OPTIONS IMPORT: route-related options modified
Wed Dec 27 23:29:45 2017 us=948066 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Wed Dec 27 23:29:45 2017 us=948307 OPTIONS IMPORT: peer-id set
Wed Dec 27 23:29:45 2017 us=948487 OPTIONS IMPORT: adjusting link_mtu to 1624
Wed Dec 27 23:29:45 2017 us=948637 OPTIONS IMPORT: data channel crypto options modified
Wed Dec 27 23:29:45 2017 us=948793 Data Channel: using negotiated cipher 'AES-256-GCM'
Wed Dec 27 23:29:45 2017 us=949039 Data Channel MTU parms [ L:1552 D:1450 EF:52 EB:406 ET:0 EL:3 ]
Wed Dec 27 23:29:45 2017 us=949905 Data Channel Encrypt: Cipher 'AES-256-GCM' initialized with 256 bit key
Wed Dec 27 23:29:45 2017 us=950160 Data Channel Decrypt: Cipher 'AES-256-GCM' initialized with 256 bit key
Wed Dec 27 23:29:45 2017 us=950959 ROUTE_GATEWAY 192.168.1.1/255.255.255.0 IFACE=wlan0 HWADDR=00:22:43:42:88:20
Wed Dec 27 23:29:45 2017 us=960429 TUN/TAP device tun0 opened
Wed Dec 27 23:29:45 2017 us=960588 TUN/TAP TX queue length set to 100
Wed Dec 27 23:29:45 2017 us=960689 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Wed Dec 27 23:29:45 2017 us=960790 /sbin/ip link set dev tun0 up mtu 1500
Wed Dec 27 23:29:45 2017 us=990249 /sbin/ip addr add dev tun0 172.16.1.8/24 broadcast 172.16.1.255
Wed Dec 27 23:29:46 2017 us=92511 /sbin/ip route add xx.xx.xx.xx/32 via 192.168.1.1
Wed Dec 27 23:29:46 2017 us=114795 /sbin/ip route add 0.0.0.0/1 via 172.16.1.1
Wed Dec 27 23:29:46 2017 us=160638 /sbin/ip route add 128.0.0.0/1 via 172.16.1.1
Wed Dec 27 23:29:46 2017 us=192979 /sbin/ip route add 192.168.167.0/24 via 172.16.1.1
Wed Dec 27 23:29:46 2017 us=211853 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Wed Dec 27 23:29:46 2017 us=213130 Initialization Sequence Completed
Can you ping the server on it's VPN IP address from the client (usually 10.8.0.1) ?
No,i can't:
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
^C
--- 172.16.1.1 ping statistics ---
13 packets transmitted, 0 received, 100% packet loss, time 12289ms
Can you ping the server on it's LAN IP address from the client (commonly 192.168.x.x) ?
No, i think not, 192.168.167.103 is the ip of the win10-computer which is running the openvpn server:
ping 192.168.167.103
PING 192.168.167.103 (192.168.167.103) 56(84) bytes of data.
^C
--- 192.168.167.103 ping statistics ---
12 packets transmitted, 0 received, 100% packet loss, time 11253ms
Can you ping the server side LAN gateway IP address from the client (commonly 192.168.x.1) ?
Yes, i think so:
ping 192.168.167.1
PING 192.168.167.1 (192.168.167.1) 56(84) bytes of data.
64 bytes from 192.168.167.1: icmp_seq=1 ttl=63 time=32.0 ms
64 bytes from 192.168.167.1: icmp_seq=2 ttl=63 time=34.6 ms
64 bytes from 192.168.167.1: icmp_seq=3 ttl=63 time=34.1 ms
64 bytes from 192.168.167.1: icmp_seq=4 ttl=63 time=33.6 ms
64 bytes from 192.168.167.1: icmp_seq=5 ttl=63 time=33.8 ms
I'm testing with to clients: one client is my linux-laptop and one client is my iphone running openvpn.
With both clients i can connect, but can't get internet. With my iphone i can get remote desktop from the win10-computer which is running the openvpn server.
Hope you can help me further!! 🙂