I am trying to connect a handful of hosts via OpenVPN over an untrusted local network.
I can't connect more than one client. Why?
The setup works with every client, but when a second client connects, the first loses the link.
More exactly, after the second connection the ping from the first one (192.168.178.16) fails and the log in the server shows:
Code: Select all
TLS Error: local/remote TLS keys are out of sync: [AF_INET]192.168.178.16:1194 (received key id: 0, known key ids: [key#0 state=S_GENERATED_KEYS auth=KS_AUTH_TRUE id=0 sid=506476f0 82b6b527] [key#1 state=S_UNDEF auth=KS_AUTH_FALSE id=0 sid=00000000 00000000] [key#2 state=S_UNDEF auth=KS_AUTH_FALSE id=0 sid=00000000 00000000])The problem occurs with both PKI and fingerprint authentications.
Note that, since the network is simple, the vpn is configured in a static way.
Code: Select all
# Local iface
local 192.168.178.2
# set protocol
proto udp
# set port
port 1194
# set interface
dev tun1
# set the topology
topology subnet
# Subnet with static IPs (no dhcp, no ruoute, no dns)
ifconfig 192.168.100.2 255.255.255.0
# persistent device
persist-tun
# Type
tls-server
# certificates and keys paths
ca server/ca.crt
cert server/home.crt
key server/home.key
dh server/dh.pem
# persistent keys
persist-key
# connection
keepalive 60 300
# notify clients on deamon restart to reconnect quickly
explicit-exit-notify 1
# run the server as system user/group nobody
user openvpn
group openvpn
# Log
status /tmp/openvpn-status.log
verb 4
mute 10Code: Select all
# Local iface
local 192.168.178.16
# set protocol
proto udp
# set port
port 1194
# set interface
dev tun1
# set the topology
topology subnet
# Subnet with static IPs (no dhcp, no ruoute, no dns)
ifconfig 192.168.100.16 255.255.255.0
# persistent device
persist-tun
# set the target IP of trusted server
remote 192.168.178.2
# Type
tls-client
# keys settings
ca client/ca.crt
cert client/media.crt
key client/media.key
# persistent keys
persist-key
# run the server as system user/group nobody
user openvpn
group openvpn
status /tmp/openvpn-status.log
verb 4
mute 10Regards,
HUjuice

