Hello guys,
It has been a month since I have a strange issue with my openvpn server. I am able to connect to my openvpn server and start doing staff when suddenly (randomly) my client disconnects.
I will give you some implementation information about network topology first:
1. Openvpn Server with 2 interfaces: Wan (static nat) with a DMZ-WAN vlan (10.10.10.10) and a DMZ-LAN vlan (internal) 10.0.111.254 directly connected in l2 core-switch.
2. Switch redirects traffic to our FW/Edge Router WAN subinterface (Juniper SRX 550) and then to our ISP
3.Edge FW--Juniper SRX 550 with a static nat (NOT DNAT) with my Openvpn server. Public IP for Openvpn-->Internal IP of Openvpn
2. scrnat for OpenVPn to access internet
4. Specific Policies for openvpn subnets to access our internal vlan subnets
Now let's go to configs and logs
server config
local 10.10.10.10
port 1202
proto udp
dev tun
ca /var/etc/openvpn/test.crt
cert /var/etc/openvpn/test.cert
key /var/etc/openvpn/test.key # This file should be kept secret
dh /etc/dh-parameters.2048
topology subnet
server 192.168.46.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 10.0.0.0 255.0.0.0"
push "route x.x.x.x 255.255.255.0"
push "ping 10"
push "ping-restart 60"
push "dhcp-option DNS 10.10.0.10"
push "dhcp-option DNS 10.10.0.15"
push "dhcp-option DOMAIN my.local"
duplicate-cn
keepalive 30 120
tls-auth /var/etc/openvpn/test.tls-auth 0
cipher AES-128-CBC # AES
persist-key
persist-tun
status /var/log/openvpn/status_test.log
log /var/log/openvpn/test.log
verb 5
mute 20
auth SHA256
reneg-sec 0
txqueuelen 1000
client
client
dev tun
persist-tun
persist-key
cipher AES-128-CBC
ncp-disable
auth SHA256
tls-client
resolv-retry infinite
remote x.x.x.x 1202 udp
auth-user-pass
verb 5
remote-cert-tls server
[olog]wrWrWrWRwRwRwRwRwRwRwrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWrWr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rWRwrWRwrWRwrWrWrWrWRFri May 24 11:35:41 2019 us=703056 gstamatiou/223.197.229.203:55046 TLS: new session incoming connection from [AF_INET]223.197.229.203:55046
WRWWRWRWWRWFri May 24 11:36:41 2019 us=693670 test/x.x.x.x:55046 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Fri May 24 11:36:41 2019 us=693779 test/x.x.x.x:55046 TLS Error: TLS handshake failed
WRFri May 24 11:36:46 2019 us=564008 test/x.x.x.x:55046 TLS: new session incoming connection from [AF_INET]x.x.x.x:55046
WRWWRWRWRWFri May 24 11:37:46 2019 us=206721 test/x.x.x.x:55046 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Fri May 24 11:37:46 2019 us=206825 test/x.x.x.x:55046 TLS Error: TLS handshake failed
[/olog]
TROUBLESHOOTING
1. Changed public ip and provider in case our connection had issue.... keeps disconnecting
2. changed interface card and txqueuelen to 1000 because i saw dropped packets on tun interfaces..keeps disconnecting
3.changed keepalive to a little higher values... keeps disconnecting
4.same disconnections happened to other users with different public ips and different OS( windows linux and macos)
5.THE WEIRDEST thing: started a record with a tcpdump and while tcpdump was recording (in both ways) vpn stayed up for 2 days!!!! when stopped disconnections started again
Do you thing that this has to do with my FW/Router?Or drops session due to inactivity of openvpn?
or is something that has to do with my openvpn config? Before our implementation of Openvpn in the same public ip with the same Router config we had a pptp server and everything was working perfect
Also i am thinking that i should i increase more timers (ping and ping restart) on client side?????
Thank you in advance