Openvpn authenticate decrypt packet error bad packet id may be a replay

When using OpenVPN to connect multiple tunnels together, you may get some errors along the way. These are normal and easy to fix.

When using OpenVPN to connect multiple tunnels together, you may get some errors along the way. These are normal and easy to fix. For some in particular you may get the following error.

AEAD Decrypt error: bad packet ID (may be a replay)

This error only occurs when you are running your tunnel in UDP. Of course, an easy fix would be to append the following into both your client and server configuration files to mute the messages:

--mute-replay-warning

You do not want to do this when your VPN is running in an environment where security matters greatly(enterprise and production). This error in particular may indicate an attempted attack on your VPN tunnel. Encrypted packets may be intercepted by a “middle man” or what we’d like to call “Man In The Middle Attack”(or MITM for short).

This style of malicious behavior is very unlikely given that your OpenVPN tunnel is protected and encrypted utilizing “remote-cert-tls” and “tls-auth” as well as your connection being identified by the certificate’s “EKU” value. If you’re running your tunnel in TCP and are experiencing this error, then you may want to investigate it.

MTU

Another cause(and most likely the issue at hand) is your MTU. MTU(Maximum Transmissions Unit) determines the maximum a single data packet can traverse the network, in other words the internet. There is something called “overhead” though, which takes away from the current MTU value. An overhead contains information that defines a data packet and make its way to a destination. In OpenVPN, a packet requires 41 bytes for security, 28 for the tunnel with a total for 69.

For example if you’re using DSL as your internet connection, then your MTU is most likely set to 1492 by default in your router/modem. In most cases, it is not and can be much lower. In order to find the correct value, we are going to open up Command Prompt and type in the following

ping -l 1492 -f 1.1.1.1

You are then told that “Your packets needs to be fragmented but DF set.” which means that you will need to continue to lower your tested MTU value from “1492” until you get a successful reply. In my case, the true MTU value is 1414.

MSS stands for Max Segment Size. This one is specific to the TCP protocol, and restricts how big a packet can be sent through and received. This is usually calculated by your MTU size minus 40. For example we have figured out our true MTU value, which for me is 1414 – 40 is 1374. My MSS for TCP-based software and connections such as FTP, HTTP/S is 1374. In OpenVPN we are now going to subtract it by 69 which gives us 1305 for our tunnel.

We will now append both our client and server configurations with the following:

mssfix 1305

Save both configurations and restart your client and server connections. Try moving large files with a TCP-based solution such as FTP. Be wary that something such as FTPS requires additional overhead for encryption on top of the VPN tunnel, and will require you to lower your mssfix value even further. Otherwise, you will receive the “AED Decrypt error” again.

You should no longer be getting this error. If you are, then I suggest you change your protocol to “proto tcp” under the server and client configurations.

Tom7320

OpenVPN User
Posts: 38
Joined: Thu Jan 28, 2016 7:44 pm

Authenticate/Decrypt packet error

Hi!

Recently I have two problems with the iOS app:

First there are a lot of «Authenticate/Decrypt packet error: bad packet ID (may be a replay)» and following «TLS Error: incoming packet authentication failed from [AF_INET]» errors in the server log. Here a (reduced) log of a session:

Code: Select all

Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 TLS: Initial packet from [AF_INET]93.221.134.138:49512, sid=90625056 80ee0ef3
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 VERIFY OK: depth=1, C=DE, ST=RLP, L=Sprendlingen, O=Praxis am Wißberg, OU=IT, CN=OpenVPN_PAW_CA, emailAddress=paw@fenta.org
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 Validating certificate key usage
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 ++ Certificate has key usage  0080, expects 0080
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 VERIFY KU OK
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 Validating certificate extended key usage
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 ++ Certificate has EKU (str) TLS Web Client Authentication, expects TLS Web Client Authentication
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 VERIFY EKU OK
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 VERIFY OK: depth=0, C=DE, ST=RLP, L=Sprendlingen, O=Praxis am Wißberg, OU=IT, CN=OpenVPN_PAW_ts, emailAddress=paw@fenta.org
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 peer info: IV_GUI_VER=net.openvpn.connect.ios_1.2.9-0
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 peer info: IV_VER=3.2
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 peer info: IV_PLAT=ios
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 peer info: IV_NCP=2
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 peer info: IV_TCPNL=1
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 peer info: IV_PROTO=2
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 peer info: IV_AUTO_SESS=1
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: 93.221.134.138:49512 [OpenVPN_PAW_ts] Peer Connection Initiated with [AF_INET]93.221.134.138:49512
Apr 26 10:16:36 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 MULTI_sva: pool returned IPv4=10.205.76.3, IPv6=(Not enabled)
Apr 26 10:16:38 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 OPTIONS IMPORT: reading client specific options from: /tmp/openvpn_cc_f9a82f3430d0ccff686693203517f495.tmp
Apr 26 10:16:38 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 MULTI: Learn: 10.205.76.3 -> OpenVPN_PAW_ts/93.221.134.138:49512
Apr 26 10:16:38 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 MULTI: primary virtual IP for OpenVPN_PAW_ts/93.221.134.138:49512: 10.205.76.3
Apr 26 10:16:38 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 PUSH: Received control message: 'PUSH_REQUEST'
Apr 26 10:16:38 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 SENT CONTROL [OpenVPN_PAW_ts]: 'PUSH_REPLY,route 192.168.193.0 255.255.255.0,route-gateway 10.205.76.1,topology subnet,ping 10
,ping-restart 60,ifconfig 10.205.76.3 255.255.255.0,peer-id 1,cipher AES-256-GCM' (status=1)
Apr 26 10:16:38 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 Data Channel Encrypt: Cipher 'AES-256-GCM' initialized with 256 bit key
Apr 26 10:16:38 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 Data Channel Decrypt: Cipher 'AES-256-GCM' initialized with 256 bit key
Apr 26 10:16:38 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #9 / time = (1524730596) Thu Apr 26 10:16:36 2018 ] -- s
ee the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
Apr 26 10:16:38 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 TLS Error: incoming packet authentication failed from [AF_INET]93.221.134.138:49512
Apr 26 10:16:38 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 PUSH: Received control message: 'PUSH_REQUEST'
Apr 26 10:16:39 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #9 / time = (1524730596) Thu Apr 26 10:16:36 2018 ] -- s
ee the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
Apr 26 10:16:39 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 TLS Error: incoming packet authentication failed from [AF_INET]93.221.134.138:49512
Apr 26 10:16:39 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #10 / time = (1524730596) Thu Apr 26 10:16:36 2018 ] --
see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
Apr 26 10:16:39 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 TLS Error: incoming packet authentication failed from [AF_INET]93.221.134.138:49512
Apr 26 10:16:46 openvpn ovpn-OpenVPN_PAW_Server_udp[317]: OpenVPN_PAW_ts/93.221.134.138:49512 SIGTERM[soft,remote-exit] received, client-instance exiting

The exact same config file on a client Windows notebook _does not_ produce any Auth/Decrypt packet errors?!

Thus I wanted to see what’s going on and tried to have a look at the log on the iOS device. But unfortunately the app crashes reproducible as soon as I open the log viewer within the app.

Here is the server config (2.4.0 on raspbian):

server

proto udp
port 1194
dev tun
server 10.205.76.0 255.255.255.0
topology subnet
persist-key
persist-tun
keepalive 10 60
#duplicate-cn
#ccd-exclusive
user nobody
group nogroup
daemon
verb 3
tls-version-min 1.2
cipher AES-256-CBC
auth SHA256
remote-cert-tls client
management 127.0.0.1 5555

client-config-dir /etc/openvpn/ccd
tls-auth /etc/openvpn/keys/ta.key 0
dh /etc/openvpn/keys/dh2048.pem
pkcs12 /etc/openvpn/keys/OpenVPN_PAW_Server.p12
crl-verify /etc/openvpn/keys/OpenVPN_PAW_CRL.pem

push «route 192.168.193.0 255.255.255.0»
route 192.168.0.0 255.255.255.0

client-connect /etc/openvpn/statuschange.sh
client-disconnect /etc/openvpn/statuschange.sh
script-security 2

The client’s config:

client

proto udp
port 1194
dev tun
client
remote remote.site.com
nobind
key-direction 1
verb 3
tls-version-min 1.2
cipher AES-256-CBC
auth SHA256
remote-cert-tls server

<ca>
——BEGIN CERTIFICATE——

——END CERTIFICATE——
</ca>

<cert>
——BEGIN CERTIFICATE——

——END CERTIFICATE——
</cert>

<key>
——BEGIN PRIVATE KEY——

</key>

<tls-auth>
——BEGIN OpenVPN Static key V1——

——END OpenVPN Static key V1——
</tls-auth>

Are this known problems? Is there a solution available?

THX a lot!


TinCanTech

OpenVPN Protagonist
Posts: 11142
Joined: Fri Jun 03, 2016 1:17 pm

Re: Authenticate/Decrypt packet error

Post

by TinCanTech » Thu Apr 26, 2018 2:07 pm

Try adding to the server config —ncp-disable


Tom7320

OpenVPN User
Posts: 38
Joined: Thu Jan 28, 2016 7:44 pm

Re: Authenticate/Decrypt packet error

Post

by Tom7320 » Thu Apr 26, 2018 2:15 pm

Thx for answering but unfortunately no effect.
BTW exact same config works without errors with 2.3.10 server version.


TinCanTech

OpenVPN Protagonist
Posts: 11142
Joined: Fri Jun 03, 2016 1:17 pm

Re: Authenticate/Decrypt packet error

Post

by TinCanTech » Thu Apr 26, 2018 2:19 pm

Is it an old iOS device ?


Tom7320

OpenVPN User
Posts: 38
Joined: Thu Jan 28, 2016 7:44 pm

Re: Authenticate/Decrypt packet error

Post

by Tom7320 » Thu Apr 26, 2018 3:47 pm

I tested with iPad Air 2 and iPhone 6s. Both with recent iOS 11.3.1. Same behavior.
It’s ok with openvpn server 2.3.10, but not with 2.4.



Tom7320

OpenVPN User
Posts: 38
Joined: Thu Jan 28, 2016 7:44 pm

Re: Authenticate/Decrypt packet error

Post

by Tom7320 » Thu Apr 26, 2018 6:18 pm

Well as I said unfortunately I can not see the log since the app alway crashes as soon as I try to show the log. Is there another way to see the log files?


TinCanTech

OpenVPN Protagonist
Posts: 11142
Joined: Fri Jun 03, 2016 1:17 pm

Re: Authenticate/Decrypt packet error

Post

by TinCanTech » Thu Apr 26, 2018 6:26 pm

Tom7320 wrote: ↑

Thu Apr 26, 2018 3:47 pm


I tested with iPad Air 2 and iPhone 6s. Both with recent iOS 11.3.1. Same behavior.

Any log ..


Tom7320

OpenVPN User
Posts: 38
Joined: Thu Jan 28, 2016 7:44 pm

Re: Authenticate/Decrypt packet error

Post

by Tom7320 » Thu Apr 26, 2018 7:29 pm

This is a connection from a Windows client to the 2.4.0 server:

Code: Select all

Thu Apr 26 21:27:34 2018 OpenVPN 2.4.4 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Sep 26 2017
Thu Apr 26 21:27:34 2018 Windows version 6.2 (Windows 8 or greater) 64bit
Thu Apr 26 21:27:34 2018 library versions: OpenSSL 1.0.2l  25 May 2017, LZO 2.10
Enter Management Password:
Thu Apr 26 21:27:34 2018 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Thu Apr 26 21:27:34 2018 Need hold release from management interface, waiting...
Thu Apr 26 21:27:34 2018 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Thu Apr 26 21:27:35 2018 MANAGEMENT: CMD 'state on'
Thu Apr 26 21:27:35 2018 MANAGEMENT: CMD 'log all on'
Thu Apr 26 21:27:35 2018 MANAGEMENT: CMD 'echo all on'
Thu Apr 26 21:27:35 2018 MANAGEMENT: CMD 'hold off'
Thu Apr 26 21:27:35 2018 MANAGEMENT: CMD 'hold release'
Thu Apr 26 21:27:35 2018 Outgoing Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Thu Apr 26 21:27:35 2018 Incoming Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Thu Apr 26 21:27:35 2018 MANAGEMENT: >STATE:1524770855,RESOLVE,,,,,,
Thu Apr 26 21:27:35 2018 TCP/UDP: Preserving recently used remote address: [AF_INET]93.221.134.162:1194
Thu Apr 26 21:27:35 2018 Socket Buffers: R=[65536->65536] S=[64512->64512]
Thu Apr 26 21:27:35 2018 UDP link local: (not bound)
Thu Apr 26 21:27:35 2018 UDP link remote: [AF_INET]93.221.134.162:1194
Thu Apr 26 21:27:35 2018 MANAGEMENT: >STATE:1524770855,WAIT,,,,,,
Thu Apr 26 21:27:35 2018 MANAGEMENT: >STATE:1524770855,AUTH,,,,,,
Thu Apr 26 21:27:35 2018 TLS: Initial packet from [AF_INET]93.221.134.162:1194, sid=edd58e78 1632ae62
Thu Apr 26 21:27:35 2018 VERIFY OK: depth=1, C=DE, ST=RLP, L=Sprendlingen, O=Praxis am Wißberg, OU=IT, CN=OpenVPN_PAW_CA, emailAddress=paw@fenta.org
Thu Apr 26 21:27:35 2018 VERIFY KU OK
Thu Apr 26 21:27:35 2018 Validating certificate extended key usage
Thu Apr 26 21:27:35 2018 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Thu Apr 26 21:27:35 2018 VERIFY EKU OK
Thu Apr 26 21:27:35 2018 VERIFY OK: depth=0, C=DE, ST=RLP, L=Sprendlingen, O=Praxis am Wißberg, OU=IT, CN=OpenVPN_PAW_Server, emailAddress=paw@fenta.org
Thu Apr 26 21:27:35 2018 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Thu Apr 26 21:27:35 2018 [OpenVPN_PAW_Server] Peer Connection Initiated with [AF_INET]93.221.134.162:1194
Thu Apr 26 21:27:36 2018 MANAGEMENT: >STATE:1524770856,GET_CONFIG,,,,,,
Thu Apr 26 21:27:36 2018 SENT CONTROL [OpenVPN_PAW_Server]: 'PUSH_REQUEST' (status=1)
Thu Apr 26 21:27:37 2018 PUSH: Received control message: 'PUSH_REPLY,route 192.168.193.0 255.255.255.0,route-gateway 10.205.76.1,topology subnet,ping 10,ping-restart 60,ifconfig 10.205.76.3 255.255.255.0,peer-id 1,cipher AES-256-GCM'
Thu Apr 26 21:27:37 2018 OPTIONS IMPORT: timers and/or timeouts modified
Thu Apr 26 21:27:37 2018 OPTIONS IMPORT: --ifconfig/up options modified
Thu Apr 26 21:27:37 2018 OPTIONS IMPORT: route options modified
Thu Apr 26 21:27:37 2018 OPTIONS IMPORT: route-related options modified
Thu Apr 26 21:27:37 2018 OPTIONS IMPORT: peer-id set
Thu Apr 26 21:27:37 2018 OPTIONS IMPORT: adjusting link_mtu to 1624
Thu Apr 26 21:27:37 2018 OPTIONS IMPORT: data channel crypto options modified
Thu Apr 26 21:27:37 2018 Data Channel: using negotiated cipher 'AES-256-GCM'
Thu Apr 26 21:27:37 2018 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Thu Apr 26 21:27:37 2018 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Thu Apr 26 21:27:37 2018 interactive service msg_channel=660
Thu Apr 26 21:27:37 2018 ROUTE_GATEWAY 192.168.0.1/255.255.255.0 I=8 HWADDR=00:22:4d:aa:94:21
Thu Apr 26 21:27:37 2018 open_tun
Thu Apr 26 21:27:37 2018 TAP-WIN32 device [OpenVPN] opened: \.Global{B202F078-0016-4AAB-867F-670016FE15A8}.tap
Thu Apr 26 21:27:37 2018 TAP-Windows Driver Version 9.21 
Thu Apr 26 21:27:37 2018 Set TAP-Windows TUN subnet mode network/local/netmask = 10.205.76.0/10.205.76.3/255.255.255.0 [SUCCEEDED]
Thu Apr 26 21:27:37 2018 Notified TAP-Windows driver to set a DHCP IP/netmask of 10.205.76.3/255.255.255.0 on interface {B202F078-0016-4AAB-867F-670016FE15A8} [DHCP-serv: 10.205.76.254, lease-time: 31536000]
Thu Apr 26 21:27:37 2018 Successful ARP Flush on interface [7] {B202F078-0016-4AAB-867F-670016FE15A8}
Thu Apr 26 21:27:37 2018 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Thu Apr 26 21:27:37 2018 MANAGEMENT: >STATE:1524770857,ASSIGN_IP,,10.205.76.3,,,,
Thu Apr 26 21:27:42 2018 TEST ROUTES: 1/1 succeeded len=1 ret=1 a=0 u/d=up
Thu Apr 26 21:27:42 2018 MANAGEMENT: >STATE:1524770862,ADD_ROUTES,,,,,,
Thu Apr 26 21:27:42 2018 C:WINDOWSsystem32route.exe ADD 192.168.193.0 MASK 255.255.255.0 10.205.76.1
Thu Apr 26 21:27:42 2018 Route addition via service succeeded
Thu Apr 26 21:27:42 2018 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Thu Apr 26 21:27:42 2018 Initialization Sequence Completed
Thu Apr 26 21:27:42 2018 MANAGEMENT: >STATE:1524770862,CONNECTED,SUCCESS,10.205.76.3,93.221.134.162,1194,,
Thu Apr 26 21:27:49 2018 C:WINDOWSsystem32route.exe DELETE 192.168.193.0 MASK 255.255.255.0 10.205.76.1
Thu Apr 26 21:27:49 2018 Route deletion via service succeeded
Thu Apr 26 21:27:49 2018 Closing TUN/TAP interface
Thu Apr 26 21:27:49 2018 TAP: DHCP address released
Thu Apr 26 21:27:49 2018 SIGTERM[hard,] received, process exiting
Thu Apr 26 21:27:49 2018 MANAGEMENT: >STATE:1524770869,EXITING,SIGTERM,,,,,


Tom7320

OpenVPN User
Posts: 38
Joined: Thu Jan 28, 2016 7:44 pm

Re: Authenticate/Decrypt packet error

Post

by Tom7320 » Fri Apr 27, 2018 7:17 am

Addendum:
In my opinion the app must have at least a bug regarding the crash while showing the log! This used to work in earlier versions of the app! Is there another way to show the log files?


TinCanTech

OpenVPN Protagonist
Posts: 11142
Joined: Fri Jun 03, 2016 1:17 pm

Re: Authenticate/Decrypt packet error

Post

by TinCanTech » Fri Apr 27, 2018 11:38 am

Tom7320 wrote: ↑

Fri Apr 27, 2018 7:17 am


the app must have at least a bug regarding the crash while showing the log!

You are the only person to report this problem ..

Tom7320 wrote: ↑

Fri Apr 27, 2018 7:17 am


Is there another way to show the log files?

Use one of the logs from one of these:

Tom7320 wrote: ↑

Thu Apr 26, 2018 3:47 pm


I tested with iPad Air 2 and iPhone 6s. Both with recent iOS 11.3.1. Same behavior.

Not the Windows client which obviously connects …..


Tom7320

OpenVPN User
Posts: 38
Joined: Thu Jan 28, 2016 7:44 pm

Re: Authenticate/Decrypt packet error

Post

by Tom7320 » Fri Apr 27, 2018 3:58 pm

Well the app crashes reproducible on _four_ tested iOS devices as soon as I want to show the log file!! If you don’t believe me here is a very short video:

https://nextcloud.steinbrenner-lahn.de/ … eYQQLrt76n

The app connects. In the server log I find the mentioned errors.


Tom7320

OpenVPN User
Posts: 38
Joined: Thu Jan 28, 2016 7:44 pm

Re: Authenticate/Decrypt packet error

Post

by Tom7320 » Wed May 02, 2018 4:57 am

Is there a place where I can submit a ticket concerning the two issues I have with the iOS app?


TinCanTech

OpenVPN Protagonist
Posts: 11142
Joined: Fri Jun 03, 2016 1:17 pm

Re: Authenticate/Decrypt packet error

Post

by TinCanTech » Sun May 06, 2018 6:27 pm

TinCanTech wrote: ↑

Thu Apr 26, 2018 2:07 pm


Try adding to the server config —ncp-disable

Also, restart the server after making the change.

Tom7320 wrote: ↑

Thu Apr 26, 2018 2:15 pm


Thx for answering but unfortunately no effect.
BTW exact same config works without errors with 2.3.10 server version.

But you did not post any log ..

And then:

Tom7320 wrote: ↑

Thu Apr 26, 2018 7:29 pm


This is a connection from a Windows client to the 2.4.0 server:

Code: Select all

Thu Apr 26 21:27:34 2018 OpenVPN 2.4.4 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Sep 26 2017
Thu Apr 26 21:27:34 2018 Windows version 6.2 (Windows 8 or greater) 64bit
Thu Apr 26 21:27:34 2018 library versions: OpenSSL 1.0.2l  25 May 2017, LZO 2.10

Thu Apr 26 21:27:37 2018 PUSH: Received control message: 'PUSH_REPLY,route 192.168.193.0 255.255.255.0,route-gateway 10.205.76.1,topology subnet,ping 10,ping-restart 60,ifconfig 10.205.76.3 255.255.255.0,peer-id 1,cipher AES-256-GCM'

Thu Apr 26 21:27:37 2018 OPTIONS IMPORT: data channel crypto options modified
Thu Apr 26 21:27:37 2018 Data Channel: using negotiated cipher 'AES-256-GCM'
Thu Apr 26 21:27:37 2018 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Thu Apr 26 21:27:37 2018 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key

** Negotiated Cipher Protocol is still in use **

In order to rule out an NCP error:

  • Please disable Negotiated Cipher Protocol by using —ncp-disable in your server config.
    And post the server log @ verb 4 of a connection attempt from one of your afflicted devices ..


Tom7320

OpenVPN User
Posts: 38
Joined: Thu Jan 28, 2016 7:44 pm

Re: Authenticate/Decrypt packet error

Post

by Tom7320 » Mon May 07, 2018 6:59 am

OK. I added ncp-disable and verb 4 and restarted the server. Here is a connection log:

Code: Select all

May  7 08:57:21 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: MULTI: multi_create_instance called
May  7 08:57:21 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 Re-using SSL/TLS context
May  7 08:57:21 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 Control Channel MTU parms [ L:1621 D:1172 EF:78 EB:0 ET:0 EL:3 ]
May  7 08:57:21 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 Data Channel MTU parms [ L:1621 D:1450 EF:121 EB:406 ET:0 EL:3 ]
May  7 08:57:21 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 Local Options String (VER=V4): 'V4,dev-type tun,link-mtu 1569,tun-mtu 1500,proto UDPv4,keydir 0,cipher AES-256-CBC,auth SHA256,keysize 256,tl
s-auth,key-method 2,tls-server'
May  7 08:57:21 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 Expected Remote Options String (VER=V4): 'V4,dev-type tun,link-mtu 1569,tun-mtu 1500,proto UDPv4,keydir 1,cipher AES-256-CBC,auth SHA256,keys
ize 256,tls-auth,key-method 2,tls-client'
May  7 08:57:21 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 TLS: Initial packet from [AF_INET]93.221.143.162:55604, sid=f887bbe3 2f7b6fb5
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 VERIFY OK: depth=1, C=DE, ST=RLP, L=Sprendlingen, O=Praxis am Wißberg, OU=IT, CN=OpenVPN_PAW_CA, emailAddress=paw@fenta.org
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 Validating certificate key usage
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 ++ Certificate has key usage  0080, expects 0080
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 VERIFY KU OK
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 Validating certificate extended key usage
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 ++ Certificate has EKU (str) TLS Web Client Authentication, expects TLS Web Client Authentication
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 VERIFY EKU OK
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 VERIFY OK: depth=0, C=DE, ST=RLP, L=Sprendlingen, O=Praxis am Wißberg, OU=IT, CN=OpenVPN_PAW_ts, emailAddress=paw@fenta.org
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 peer info: IV_GUI_VER=net.openvpn.connect.ios_1.2.9-0
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 peer info: IV_VER=3.2
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 peer info: IV_PLAT=ios
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 peer info: IV_NCP=2
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 peer info: IV_TCPNL=1
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 peer info: IV_PROTO=2
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 peer info: IV_AUTO_SESS=1
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 Data Channel Encrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 Data Channel Encrypt: Using 256 bit message hash 'SHA256' for HMAC authentication
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 Data Channel Decrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 Data Channel Decrypt: Using 256 bit message hash 'SHA256' for HMAC authentication
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: 93.221.143.162:55604 [OpenVPN_PAW_ts] Peer Connection Initiated with [AF_INET]93.221.143.162:55604
May  7 08:57:22 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 MULTI_sva: pool returned IPv4=10.205.76.3, IPv6=(Not enabled)
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 OPTIONS IMPORT: reading client specific options from: /tmp/openvpn_cc_f8ce32f1eb327d5649a5f9daca5d7458.tmp
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 MULTI: Learn: 10.205.76.3 -> OpenVPN_PAW_ts/93.221.143.162:55604
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 MULTI: primary virtual IP for OpenVPN_PAW_ts/93.221.143.162:55604: 10.205.76.3
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 PUSH: Received control message: 'PUSH_REQUEST'
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 SENT CONTROL [OpenVPN_PAW_ts]: 'PUSH_REPLY,route 192.168.193.0 255.255.255.0,route-gateway 10.205.76.1,topology subnet,ping 10
,ping-restart 60,ifconfig 10.205.76.3 255.255.255.0,peer-id 1' (status=1)
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 PID_ERR replay [0] [TLS_WRAP-0] [022222233] 1525676241:9 1525676241:9 t=1525676244[0] r=[-3,64,15,0,1] sl=[55,9,64,272]
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #9 / time = (1525676241) Mon May  7 08:57:21 2018 ] -- s
ee the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 TLS Error: incoming packet authentication failed from [AF_INET]93.221.143.162:55604
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 PUSH: Received control message: 'PUSH_REQUEST'
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 PID_ERR replay-window backtrack occurred [1] [TLS_WRAP-0] [0022222233] 1525676241:10 1525676241:9 t=1525676244[0] r=[-3,64,15,
1,1] sl=[54,10,64,272]
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 PID_ERR replay [1] [TLS_WRAP-0] [0022222233] 1525676241:10 1525676241:9 t=1525676244[0] r=[-3,64,15,1,1] sl=[54,10,64,272]
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #9 / time = (1525676241) Mon May  7 08:57:21 2018 ] -- s
ee the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 TLS Error: incoming packet authentication failed from [AF_INET]93.221.143.162:55604
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 PID_ERR replay [0] [TLS_WRAP-0] [0022222233] 1525676241:10 1525676241:10 t=1525676244[0] r=[-3,64,15,1,1] sl=[54,10,64,272]
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #10 / time = (1525676241) Mon May  7 08:57:21 2018 ] --
see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
May  7 08:57:24 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 TLS Error: incoming packet authentication failed from [AF_INET]93.221.143.162:55604
May  7 08:57:39 openvpn ovpn-OpenVPN_PAW_Server_udp[354]: OpenVPN_PAW_ts/93.221.143.162:55604 SIGTERM[soft,remote-exit] received, client-instance exiting


TinCanTech

OpenVPN Protagonist
Posts: 11142
Joined: Fri Jun 03, 2016 1:17 pm

Re: Authenticate/Decrypt packet error

Post

by TinCanTech » Mon May 07, 2018 11:52 am

Once you make that connection above can you ping the server ? It should be possible ..

Personally, I believe you have a virus, or something like that, on all your iOS devices ..

Or it could be that your network link, I presume WIFI, is a very poor quality ..
Can you try any other network ?


Tom7320

OpenVPN User
Posts: 38
Joined: Thu Jan 28, 2016 7:44 pm

Re: Authenticate/Decrypt packet error

Post

by Tom7320 » Mon May 07, 2018 1:12 pm

Yes fortunately I can ping the server!
Well it might be possible to have some malaicious software on one of the tested devices but I think it is unlikely to have it on all tested devices!
I tested with WIFI on different locations and very fast 4G links. Same problem…


TinCanTech

OpenVPN Protagonist
Posts: 11142
Joined: Fri Jun 03, 2016 1:17 pm

Re: Authenticate/Decrypt packet error

Post

by TinCanTech » Mon May 07, 2018 1:59 pm

TinCanTech wrote: ↑

Mon May 07, 2018 11:52 am


Once you make that connection above can you ping the server ? It should be possible ..

Tom7320 wrote: ↑

Mon May 07, 2018 1:12 pm


Yes fortunately I can ping the server!

OK ..

Tom7320 wrote: ↑

Mon May 07, 2018 6:59 am


PID_ERR replay [0] [TLS_WRAP-0] [022222233] 1525676241:9 1525676241:9 t=1525676244[0] r=[-3,64,15,0,1] sl=[55,9,64,272]

Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #9 / time = (1525676241) Mon May 7 08:57:21 2018 ] — see the man page entry for —no-replay and —replay-window for more info or silence this warning with —mute-replay-warnings

TLS Error: incoming packet authentication failed from [AF_INET]93.221.143.162:55604

You can read about this under —replay-window in the manual, you could try adjusting that (make the values larger) but I would not use —no-replay

Also,

The Manual wrote:OpenVPN also adds TCP transport as an option (not offered by IPSec) in which case OpenVPN can adopt a very strict attitude towards message deletion and reordering: Don’t allow it. Since TCP guarantees reliability, any packet loss or reordering event can be assumed to be an attack.

Try using TCP.

TinCanTech wrote: ↑

Mon May 07, 2018 11:52 am


Personally, I believe you have a virus, or something like that, on all your iOS devices ..

Tom7320 wrote: ↑

Mon May 07, 2018 1:12 pm


Well it might be possible to have some malaicious software on one of the tested devices but I think it is unlikely to have it on all tested devices!

Tom7320 wrote: ↑

Fri Apr 27, 2018 3:58 pm


Well the app crashes reproducible on _four_ tested iOS devices as soon as I want to show the log file!!

It seems reasonable to me that all four of your devices have the same problem, what ever that is ..

Nobody else has ever reported this problem and even two openvpn developers are sceptical about it.

Where did you download the App from ?

Also, what country are you in ? Perhaps there are restrictions on you ..


Tom7320

OpenVPN User
Posts: 38
Joined: Thu Jan 28, 2016 7:44 pm

Re: Authenticate/Decrypt packet error

Post

by Tom7320 » Mon May 07, 2018 3:19 pm

Well I just did a factory reset of my iPad. After that I installed the iOS OpenVPN Connect app as the only app. Same thing. The app crashes as soon as I want to show the log. I don’t even have to be connected to an OpenVPN server!!! I downloaded the app from the official Apple app store. No «hacks». Country is Germany, thus the language of the iPad is German. It used to work with an older version of the app! I also did not have the bad package ID errors with 2.3.x server. It startet with 2.4 server version. Strange things….

Anyway THX for trying to help me!


TinCanTech

OpenVPN Protagonist
Posts: 11142
Joined: Fri Jun 03, 2016 1:17 pm

Re: Authenticate/Decrypt packet error

Post

by TinCanTech » Mon May 07, 2018 3:35 pm

Tom7320 wrote: ↑

Mon May 07, 2018 3:19 pm


Well I just did a factory reset of my iPad. After that I installed the iOS OpenVPN Connect app as the only app. Same thing. The app crashes as soon as I want to show the log.

Can you give full details of your device ? iOS Versions, device name/version etc .. as much detail as you can find. I do not know enough about iOS to identify what you are using but it is possible some incompatibility or even bug has got into openvpn .. This is why we need as much detail as you can give :geek:

Also, please try a —proto tcp tunnel, the result of that can give some very useful indicators ..

Edit: Also, just an idea .. can you try running the server on a Linux PC .. not your ARM Raspberry Pi.
(alternatively, I could give you a temporary account on my system)


Содержание

  1. OpenVPN Support Forum
  2. Authenticate/Decrypt packet error
  3. Authenticate/Decrypt packet error
  4. OpenVPN Support Forum
  5. Authenticate/Decrypt packet error present with udp, but not with tcp.
  6. Authenticate/Decrypt packet error present with udp, but not with tcp.
  7. Re: Authenticate/Decrypt packet error present with udp, but not with tcp.
  8. Re: Authenticate/Decrypt packet error present with udp, but not with tcp.
  9. Re: Authenticate/Decrypt packet error present with udp, but not with tcp.
  10. Re: Authenticate/Decrypt packet error present with udp, but not with tcp.
  11. Re: Authenticate/Decrypt packet error present with udp, but not with tcp.
  12. Re: Authenticate/Decrypt packet error present with udp, but not with tcp.
  13. Re: Authenticate/Decrypt packet error present with udp, but not with tcp.
  14. Re: Authenticate/Decrypt packet error present with udp, but not with tcp.
  15. Re: Authenticate/Decrypt packet error present with udp, but not with tcp.

OpenVPN Support Forum

Community Support Forum

Authenticate/Decrypt packet error

Authenticate/Decrypt packet error

Post by Tom7320 » Thu Apr 26, 2018 8:30 am

Recently I have two problems with the iOS app:

First there are a lot of «Authenticate/Decrypt packet error: bad packet ID (may be a replay)» and following «TLS Error: incoming packet authentication failed from [AF_INET]» errors in the server log. Here a (reduced) log of a session:

The exact same config file on a client Windows notebook _does not_ produce any Auth/Decrypt packet errors?!

Thus I wanted to see what’s going on and tried to have a look at the log on the iOS device. But unfortunately the app crashes reproducible as soon as I open the log viewer within the app.

Here is the server config (2.4.0 on raspbian):

proto udp
port 1194
dev tun
server 10.205.76.0 255.255.255.0
topology subnet
persist-key
persist-tun
keepalive 10 60
#duplicate-cn
#ccd-exclusive
user nobody
group nogroup
daemon
verb 3
tls-version-min 1.2
cipher AES-256-CBC
auth SHA256
remote-cert-tls client
management 127.0.0.1 5555

client-config-dir /etc/openvpn/ccd
tls-auth /etc/openvpn/keys/ta.key 0
dh /etc/openvpn/keys/dh2048.pem
pkcs12 /etc/openvpn/keys/OpenVPN_PAW_Server.p12
crl-verify /etc/openvpn/keys/OpenVPN_PAW_CRL.pem

push «route 192.168.193.0 255.255.255.0»
route 192.168.0.0 255.255.255.0

client-connect /etc/openvpn/statuschange.sh
client-disconnect /etc/openvpn/statuschange.sh
script-security 2

The client’s config:

proto udp
port 1194
dev tun
client
remote remote.site.com
nobind
key-direction 1
verb 3
tls-version-min 1.2
cipher AES-256-CBC
auth SHA256
remote-cert-tls server

——BEGIN OpenVPN Static key V1——
.
——END OpenVPN Static key V1——

Are this known problems? Is there a solution available?

Источник

OpenVPN Support Forum

Community Support Forum

Authenticate/Decrypt packet error present with udp, but not with tcp.

Authenticate/Decrypt packet error present with udp, but not with tcp.

Post by net.admin » Sun Oct 08, 2017 11:36 am

I’d really appreciate it if you could take a look at the below error in the client log. Now, to be clear, I am getting a UDP connection despite these errors. But if I change the server and client to connect using TCP, the errors vanish and I get a quicker connection.

I’d prefer to use udp so I can also use ‘explicit-exit-notify 1’ — to notify a previously connected client that the server is up and can now reconnect. However it’s not supported on udp.

Notes:
Software firewalls — turned off at both ends.
Firewall/router rules (for incoming connection to openvpn server): set for udp and tcp to local ip address of server.
openvpn server is running Windows 7 as an Oracle Virtual Box.

Again, it works with udp AND tcp. But the below error are only present when i connect via udp. What’s I don’t understand is why.

Re: Authenticate/Decrypt packet error present with udp, but not with tcp.

Post by TinCanTech » Sun Oct 08, 2017 1:17 pm

Re: Authenticate/Decrypt packet error present with udp, but not with tcp.

Post by net.admin » Mon Oct 09, 2017 1:04 am

Thanks TCT, but I’m not certain it is in this case. I’ve set up a second client machine which is on the same physical network as the OpenVPN server. It’s also a Windows 7 machine, but it can connect (using the ovpn’s server’s local ip address) with udp and zero errors or warming. Same client cfg — only difference is the ip address. As the Ovpn server is a Windows 7 Virtual Box, wouldn’t I have the same issue with connectivity from a local system as I do with the remote?

I’ve also noticed that every few minutes the connection from the offsite client machine will fall over every few minutes, then go through a reconnect (with the same errors as posted above). This only happens with udp. If I switch to tcp, all errors and drop outs stop immediately.

I’m happy to file this under something to look at later and *just* use tcp, but if I do is there a way I can have automatic reconnects in the event of a drop out of server outage? Ie: like I do with ‘explicit-exit-notify 1’ and udp. If not, then I need to figure this out using udp.

Looking at the only difference, the boarder router for my network, is only 1194 (tcp and udp) required to be opened and routed to the ovpn server? Do you think it may be prudent to use another port number (with updates to both client and server ovpn profiles) to test? Is there any reason I can’t use something obscure like port 2525? I’ll give it a try as I’m somewhat stuck for other ideas. I’m also posting client and server configs below as they currently stand.

Re: Authenticate/Decrypt packet error present with udp, but not with tcp.

Post by net.admin » Mon Oct 09, 2017 1:10 am

This is the current client cfg

client
dev tun
;proto tcp
proto udp
;remote 192.11.5.199 1194
remote wan-ip-address 1194

resolv-retry infinite
nobind
persist-key
persist-tun

ca «C:\Program Files\OpenVPN\config\ca.crt»
cert «C:\Program Files\OpenVPN\config\client1.crt»
key «C:\Program Files\OpenVPN\config\client1.key»

tls-auth «C:\Program Files\OpenVPN\config\ta.key» 1

verb 3
mute 20
;comp-lzo no

This is the current 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 a.b.c.d

# 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 1194

# 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 MyTap

# 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\config\ca.crt»
cert «C:\Program Files\OpenVPN\config\server.crt»
key «C:\Program Files\OpenVPN\config\server.key»

# This file should be kept secret

# Diffie hellman parameters.
# Generate your own with:
# openssl dhparam -out dh2048.pem 2048
dh «C:\Program Files\OpenVPN\config\dh4096.pem»

# Network topology
# Should be subnet (addressing via IP)
# unless Windows clients v2.0.9 and lower have to
# be supported (then net30, i.e. a /30 per client)
# Defaults to net30 (not recommended)
;topology subnet

# 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.
server 10.8.0.0 255.255.255.0

# 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 192.168.10.0 255.255.255.0»
;push «route 192.168.20.0 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 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
# DNS servers provided by opendns.com.
;push «dhcp-option DNS 208.67.222.222»
;push «dhcp-option DNS 208.67.220.220»

# 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 «C:\Program Files\OpenVPN\config\ta.key» 0
# This file is secret

# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
# Note that v2.4 client/server will automatically
# negotiate AES-256-GCM in TLS mode.
# See also the ncp-cipher option in the manpage
cipher AES-256-CBC

# Enable compression on the VPN link and push the
# option to the client (v2.4+ only, for earlier
# versions see below)
;compress lz4-v2
;push «compress lz4-v2»

# For compression compatible with older clients use comp-lzo
# 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 100

# 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 FilesOpenVPNlog» 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

# Notify the client that when the server restarts so it
# can automatically reconnect.
;explicit-exit-notify 1

;duplicate-cn
;comp-lzo no

Re: Authenticate/Decrypt packet error present with udp, but not with tcp.

Post by net.admin » Mon Oct 09, 2017 1:52 am

Update:
The problem is still present with a different port number for client and server (2555). I opened up the port on the boarder router and routed it to the openvpn server. The above posted errors are present and the connection drops out regularly. Via tcp both problems vanish.

When I changed the local machine (on the same network at the ovpn server) to use port 2555 and udp, it connects without issue.

Any ideas to resolve greatly appreciated.

Re: Authenticate/Decrypt packet error present with udp, but not with tcp.

Post by TinCanTech » Mon Oct 09, 2017 11:53 am

The problem only occurs using UDP and cannot occur with TCP due to the difference in the protocols.

You do not need —explicit-exit-notify with TCP because TCP does that for you.

When I use VBox I get the problem locally and remotely.

It is possible that there is some other additional cause but VBox is definitely the main culprit.

Re: Authenticate/Decrypt packet error present with udp, but not with tcp.

Post by net.admin » Mon Oct 09, 2017 3:20 pm

Hi TCT, thanks for your reply.

Okay I accept I have to run tcp atm. I wasn’t aware tcp did a reconnect itself because I simply didn’t wait long enough. It looks like it’s doing the reconnect at just over 2 minutes from connection loss. Is there anyway to tweak that to a shorter retry interval?

You get the same errors with udp connecting to virtual box locally? I don’t (which is why I thought it a router/porting issue). Maybe we’re running different versions/configurations? I’ll post the log from my local udp connections and vb info tomorrow (2am here atm).

I’m guessing this is a Windows thing also. I mean if it wasn’t then A.S couldn’t run on virtual box using udp.

More when I have it. Thanks for your help and input. Much appreciated.

Re: Authenticate/Decrypt packet error present with udp, but not with tcp.

Post by TinCanTech » Mon Oct 09, 2017 6:47 pm

As for this problem:

Don’t use a VM .. just try it.

Re: Authenticate/Decrypt packet error present with udp, but not with tcp.

Post by net.admin » Tue Oct 10, 2017 12:30 am

Thanks again for your response and advice.

RTM — got it I am trying to work through problems as I find them, but double checking my own work is a flawed science sometimes. I will try to refer to the manual more. Time is unfortunately my scarcest resource.

Unfortunately at the moment I have to use a vm for the server. I’d like to use ubuntu as the platform for it, but I don’t have time atm to take my understanding of linux to a high enough level to confidently run openvpn on it.

The vm vulnerability by Thomas and Scott is a very interesting read (not claiming to understand all of it). Not because of this paper (because I didn’t know about it until now), but the reason I didn’t want to run the A.S vm snapshot is because if everyone uses it then inherently it’s subject to reverse engineering with a lead to exploitation at the weakest link. Does that mean easy-rsa is equally subject to reverse engineering, or is the generation of the keys not the problem, but the commonly available environment they are placed in?

Is it possible to add a layer of protection (further challenge/response) to prevent a replay being forced? Or is this the function of tls-auth in so much that the error being generated in my log is a response of a suspect packet being dropped if it fails the hmac sig test? If so, then I can live with that error so long as I have stability in the connection. I have to admit to being at a complete loss as to why I have no error with a local client, but do with a remote one using the same keys.

Sorry for all the questions. I’m trying to wrap my head around the problem and how I can work around it without creating a new problem in the process.

Re: Authenticate/Decrypt packet error present with udp, but not with tcp.

Post by net.admin » Tue Oct 10, 2017 1:51 am

As promised, here are the privacy edited logs (client and server) which relate to the same client performing a single connection. One from a remote source, one from a local. Both udp on port 2555 (randomly picked for testing purposes)

I’m providing this information as my local results via udp and a vm differ from your own. I’m presuming we would have different local addressing and port numbers.

Notes:
1. The Local udp connection presents no replay errors. The Remote connection does significantly.
2. Packet loss with local udp connection From client log at start of remote udp connection:

Tue Oct 10 11:34:23 2017 OpenVPN 2.4.4 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Sep 26 2017
Tue Oct 10 11:34:23 2017 Windows version 6.1 (Windows 7) 64bit
Tue Oct 10 11:34:23 2017 library versions: OpenSSL 1.0.2l 25 May 2017, LZO 2.10
Enter Management Password:
Tue Oct 10 11:34:23 2017 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Tue Oct 10 11:34:23 2017 Need hold release from management interface, waiting.
Tue Oct 10 11:34:24 2017 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Tue Oct 10 11:34:24 2017 MANAGEMENT: CMD ‘state on’
Tue Oct 10 11:34:24 2017 MANAGEMENT: CMD ‘log all on’
Tue Oct 10 11:34:24 2017 MANAGEMENT: CMD ‘echo all on’
Tue Oct 10 11:34:24 2017 MANAGEMENT: CMD ‘hold off’
Tue Oct 10 11:34:24 2017 MANAGEMENT: CMD ‘hold release’
Tue Oct 10 11:34:24 2017 Outgoing Control Channel Authentication: Using 160 bit message hash ‘SHA1’ for HMAC authentication
Tue Oct 10 11:34:24 2017 Incoming Control Channel Authentication: Using 160 bit message hash ‘SHA1’ for HMAC authentication
Tue Oct 10 11:34:24 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]ip-add:2555
Tue Oct 10 11:34:24 2017 Socket Buffers: R=[8192->8192] S=[8192->8192]
Tue Oct 10 11:34:24 2017 UDP link local: (not bound)
Tue Oct 10 11:34:24 2017 UDP link remote: [AF_INET]ip-add:2555
Tue Oct 10 11:34:24 2017 MANAGEMENT: >STATE:1507595664,WAIT.
Tue Oct 10 11:34:24 2017 MANAGEMENT: >STATE:1507595664,AUTH.
Tue Oct 10 11:34:24 2017 TLS: Initial packet from [AF_INET]ip-add:2555, sid=822c191e 057e83d3
Tue Oct 10 11:34:24 2017 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #1 / time = (1507595640) Tue Oct 10 11:34:00 2017 ] — see the man page entry for —no-replay and —replay-window for more info or silence this warning with —mute-replay-warnings
Tue Oct 10 11:34:24 2017 TLS Error: incoming packet authentication failed from [AF_INET]ip-add:2555
Tue Oct 10 11:34:24 2017 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #2 / time = (1507595640) Tue Oct 10 11:34:00 2017 ] — see the man page entry for —no-replay and —replay-window for more info or silence this warning with —mute-replay-warnings
Tue Oct 10 11:34:24 2017 TLS Error: incoming packet authentication failed from [AF_INET]ip-add:2555

from server log when connected remotely with udp and constant small packet ping

Tue Oct 10 11:51:59 2017 us=975155 user/ip-add AEAD Decrypt error: bad packet ID (may be a replay): [ #890 ] — see the man page entry for —no-replay and —replay-window for more info or silence this warning with —mute-replay-warnings
Tue Oct 10 11:52:09 2017 us=368709 user/ip-add PID_ERR replay [0] [SSL-0] [0>EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE] 0:891 0:891 t=1507596729[0] r=[0,64,15,2,1] sl=[5,64,64,528]

From client log at start of local udp connection:

Tue Oct 10 12:11:06 2017 us=95227 Current Parameter Settings:
Tue Oct 10 12:11:06 2017 us=95227 config = ‘client.ovpn’
Tue Oct 10 12:11:06 2017 us=95227 mode = 0
Tue Oct 10 12:11:06 2017 us=95227 show_ciphers = DISABLED
Tue Oct 10 12:11:06 2017 us=95227 show_digests = DISABLED
Tue Oct 10 12:11:06 2017 us=95227 show_engines = DISABLED
Tue Oct 10 12:11:06 2017 us=95227 genkey = DISABLED
Tue Oct 10 12:11:06 2017 us=95227 key_pass_file = ‘[UNDEF]’
Tue Oct 10 12:11:06 2017 us=95227 show_tls_ciphers = DISABLED
Tue Oct 10 12:11:06 2017 us=95227 connect_retry_max = 0
Tue Oct 10 12:11:06 2017 us=95227 Connection profiles [0]:
Tue Oct 10 12:11:06 2017 us=95227 proto = udp
Tue Oct 10 12:11:06 2017 us=95227 local = ‘[UNDEF]’
Tue Oct 10 12:11:06 2017 us=95227 local_port = ‘[UNDEF]’
Tue Oct 10 12:11:06 2017 us=95227 remote = ‘192.11.5.199’
Tue Oct 10 12:11:06 2017 us=95227 remote_port = ‘2555’
Tue Oct 10 12:11:06 2017 us=95227 remote_float = DISABLED
Tue Oct 10 12:11:06 2017 us=95227 bind_defined = DISABLED
Tue Oct 10 12:11:06 2017 us=95227 bind_local = DISABLED
Tue Oct 10 12:11:06 2017 us=95227 bind_ipv6_only = DISABLED
Tue Oct 10 12:11:06 2017 us=95227 NOTE: —mute triggered.
Tue Oct 10 12:11:06 2017 us=95227 271 variation(s) on previous 20 message(s) suppressed by —mute
Tue Oct 10 12:11:06 2017 us=95227 OpenVPN 2.4.2 i686-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on May 11 2017
Tue Oct 10 12:11:06 2017 us=95227 Windows version 6.1 (Windows 7) 32bit
Tue Oct 10 12:11:06 2017 us=95227 library versions: OpenSSL 1.0.2k 26 Jan 2017, LZO 2.10
Enter Management Password:
Tue Oct 10 12:11:06 2017 us=95227 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25343
Tue Oct 10 12:11:06 2017 us=95227 Need hold release from management interface, waiting.
Tue Oct 10 12:11:06 2017 us=500560 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25343
Tue Oct 10 12:11:06 2017 us=609687 MANAGEMENT: CMD ‘state on’
Tue Oct 10 12:11:06 2017 us=609687 MANAGEMENT: CMD ‘log all on’
Tue Oct 10 12:11:06 2017 us=687636 MANAGEMENT: CMD ‘echo all on’
Tue Oct 10 12:11:06 2017 us=703226 MANAGEMENT: CMD ‘hold off’
Tue Oct 10 12:11:06 2017 us=703226 MANAGEMENT: CMD ‘hold release’
Tue Oct 10 12:11:07 2017 us=61789 Outgoing Control Channel Authentication: Using 160 bit message hash ‘SHA1’ for HMAC authentication
Tue Oct 10 12:11:07 2017 us=61789 Incoming Control Channel Authentication: Using 160 bit message hash ‘SHA1’ for HMAC authentication
Tue Oct 10 12:11:07 2017 us=61789 Control Channel MTU parms [ L:1621 D:1184 EF:66 EB:0 ET:0 EL:3 ]
Tue Oct 10 12:11:07 2017 us=61789 Data Channel MTU parms [ L:1621 D:1450 EF:121 EB:406 ET:0 EL:3 ]
Tue Oct 10 12:11:07 2017 us=61789 Local Options String (VER=V4): ‘V4,dev-type tun,link-mtu 1557,tun-mtu 1500,proto UDPv4,keydir 1,cipher AES-256-CBC,auth SHA1,keysize 256,tls-auth,key-method 2,tls-client’
Tue Oct 10 12:11:07 2017 us=61789 Expected Remote Options String (VER=V4): ‘V4,dev-type tun,link-mtu 1557,tun-mtu 1500,proto UDPv4,keydir 0,cipher AES-256-CBC,auth SHA1,keysize 256,tls-auth,key-method 2,tls-server’
Tue Oct 10 12:11:07 2017 us=61789 TCP/UDP: Preserving recently used remote address: [AF_INET]192.11.5.199:2555
Tue Oct 10 12:11:07 2017 us=61789 Socket Buffers: R=[8192->8192] S=[8192->8192]
Tue Oct 10 12:11:07 2017 us=61789 UDP link local: (not bound)
Tue Oct 10 12:11:07 2017 us=61789 UDP link remote: [AF_INET]192.11.5.199:2555
Tue Oct 10 12:11:07 2017 us=61789 MANAGEMENT: >STATE:1507597867,WAIT.
Tue Oct 10 12:11:07 2017 us=124148 MANAGEMENT: >STATE:1507597867,AUTH.
Tue Oct 10 12:11:07 2017 us=124148 TLS: Initial packet from [AF_INET]192.11.5.199:2555, sid=f6951177 608664fc
Tue Oct 10 12:11:07 2017 us=139737 VERIFY OK: depth=1, C=AU, ST=NSW, L=Sydney, cert info
Tue Oct 10 12:11:07 2017 us=155327 VERIFY KU OK
Tue Oct 10 12:11:07 2017 us=155327 Validating certificate extended key usage
Tue Oct 10 12:11:07 2017 us=155327 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Tue Oct 10 12:11:07 2017 us=155327 VERIFY EKU OK
Tue Oct 10 12:11:07 2017 us=155327 VERIFY OK: depth=0, C=AU, ST=NSW, L=Sydney, cert info
Tue Oct 10 12:11:07 2017 us=420352 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 4096 bit RSA
Tue Oct 10 12:11:07 2017 us=420352 [server] Peer Connection Initiated with [AF_INET]192.11.5.199:2555
Tue Oct 10 12:11:08 2017 us=668502 MANAGEMENT: >STATE:1507597868,GET_CONFIG.
Tue Oct 10 12:11:08 2017 us=684092 SENT CONTROL [server]: ‘PUSH_REQUEST’ (status=1)
Tue Oct 10 12:11:08 2017 us=699682 PUSH: Received control message: ‘PUSH_REPLY,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5,peer-id 0,cipher AES-256-GCM’
Tue Oct 10 12:11:08 2017 us=699682 OPTIONS IMPORT: timers and/or timeouts modified
Tue Oct 10 12:11:08 2017 us=699682 OPTIONS IMPORT: —ifconfig/up options modified
Tue Oct 10 12:11:08 2017 us=699682 OPTIONS IMPORT: route options modified
Tue Oct 10 12:11:08 2017 us=699682 OPTIONS IMPORT: peer-id set
Tue Oct 10 12:11:08 2017 us=699682 OPTIONS IMPORT: adjusting link_mtu to 1624
Tue Oct 10 12:11:08 2017 us=699682 OPTIONS IMPORT: data channel crypto options modified
Tue Oct 10 12:11:08 2017 us=699682 Data Channel MTU parms [ L:1552 D:1450 EF:52 EB:406 ET:0 EL:3 ]
Tue Oct 10 12:11:08 2017 us=699682 Data Channel Encrypt: Cipher ‘AES-256-GCM’ initialized with 256 bit key
Tue Oct 10 12:11:08 2017 us=699682 Data Channel Decrypt: Cipher ‘AES-256-GCM’ initialized with 256 bit key
Tue Oct 10 12:11:08 2017 us=699682 interactive service msg_channel=0
Tue Oct 10 12:11:08 2017 us=715271 ROUTE_GATEWAY 192.11.6.250/255.255.255.0 I=18 HWADDR=00:16:6f:6c:05:22
Tue Oct 10 12:11:08 2017 us=715271 open_tun
Tue Oct 10 12:11:08 2017 us=715271 TAP-WIN32 device [Local Area Connection 2] opened: \.Global<8e91daa7-93b4-46ec-9aa8-64b74c82322d>.tap
Tue Oct 10 12:11:08 2017 us=715271 TAP-Windows Driver Version 9.21
Tue Oct 10 12:11:08 2017 us=715271 TAP-Windows MTU=1500
Tue Oct 10 12:11:08 2017 us=730861 Notified TAP-Windows driver to set a DHCP IP/netmask of 10.8.0.6/255.255.255.252 on interface <8e91daa7-93b4-46ec-9aa8-64b74c82322d>[DHCP-serv: 10.8.0.5, lease-time: 31536000]
Tue Oct 10 12:11:08 2017 us=730861 Successful ARP Flush on interface [24] <8e91daa7-93b4-46ec-9aa8-64b74c82322d>
Tue Oct 10 12:11:08 2017 us=730861 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Tue Oct 10 12:11:08 2017 us=730861 MANAGEMENT: >STATE:1507597868,ASSIGN_IP,,10.8.0.6.
Tue Oct 10 12:11:13 2017 us=205105 TEST ROUTES: 1/1 succeeded len=1 ret=1 a=0 u/d=up
Tue Oct 10 12:11:13 2017 us=205105 MANAGEMENT: >STATE:1507597873,ADD_ROUTES.
Tue Oct 10 12:11:13 2017 us=205105 C:Windowssystem32route.exe ADD 10.8.0.1 MASK 255.255.255.255 10.8.0.5
Tue Oct 10 12:11:13 2017 us=205105 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=20 and dwForwardType=4
Tue Oct 10 12:11:13 2017 us=205105 Route addition via IPAPI succeeded [adaptive]
Tue Oct 10 12:11:13 2017 us=205105 Initialization Sequence Completed
Tue Oct 10 12:11:13 2017 us=205105 MANAGEMENT: >STATE:1507597873,CONNECTED,SUCCESS,10.8.0.6,192.11.5.199,2555,,

from server log when connected locally with udp and same ping

Tue Oct 10 12:00:54 2017 us=738377 Initialization Sequence Completed
Tue Oct 10 12:10:50 2017 us=83942 MULTI: multi_create_instance called
Tue Oct 10 12:10:50 2017 us=83942 192.11.5.251 Re-using SSL/TLS context
Tue Oct 10 12:10:50 2017 us=83942 192.11.5.251 Control Channel MTU parms [ L:1621 D:1184 EF:66 EB:0 ET:0 EL:3 ]
Tue Oct 10 12:10:50 2017 us=83942 192.11.5.251 Data Channel MTU parms [ L:1621 D:1450 EF:121 EB:406 ET:0 EL:3 ]
Tue Oct 10 12:10:50 2017 us=83942 192.11.5.251 Local Options String (VER=V4): ‘V4,dev-type tun,link-mtu 1557,tun-mtu 1500,proto UDPv4,keydir 0,cipher AES-256-CBC,auth SHA1,keysize 256,tls-auth,key-method 2,tls-server’
Tue Oct 10 12:10:50 2017 us=83942 192.11.5.251 Expected Remote Options String (VER=V4): ‘V4,dev-type tun,link-mtu 1557,tun-mtu 1500,proto UDPv4,keydir 1,cipher AES-256-CBC,auth SHA1,keysize 256,tls-auth,key-method 2,tls-client’
Tue Oct 10 12:10:50 2017 us=83942 192.11.5.251 TLS: Initial packet from [AF_INET6]::ffff:192.11.5.251:51194, sid=4e595384 5fb2a4b5
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 VERIFY OK: depth=1, C=AU, ST=NSW, L=Sydney, normal cert info
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 VERIFY OK: depth=0, C=AU, ST=NSW, L=Sydney, normal cert info
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 peer info: IV_VER=2.4.2
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 peer info: IV_PLAT=win
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 peer info: IV_PROTO=2
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 peer info: IV_NCP=2
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 peer info: IV_LZ4=1
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 peer info: IV_LZ4v2=1
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 peer info: IV_LZO=1
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 peer info: IV_COMP_STUB=1
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 peer info: IV_COMP_STUBv2=1
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 peer info: IV_TCPNL=1
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 peer info: IV_GUI_VER=OpenVPN_GUI_11
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 4096 bit RSA
Tue Oct 10 12:10:50 2017 us=365192 192.11.5.251 [client] Peer Connection Initiated with [AF_INET6]::ffff:192.11.5.251:51194
Tue Oct 10 12:10:50 2017 us=365192 client/192.11.5.251 MULTI_sva: pool returned IPv4=10.8.0.6, IPv6=(Not enabled)
Tue Oct 10 12:10:50 2017 us=365192 client/192.11.5.251 MULTI: Learn: 10.8.0.6 -> client/192.11.5.251
Tue Oct 10 12:10:50 2017 us=365192 client/192.11.5.251 MULTI: primary virtual IP for client/192.11.5.251: 10.8.0.6
Tue Oct 10 12:10:51 2017 us=504254 client/192.11.5.251 PUSH: Received control message: ‘PUSH_REQUEST’
Tue Oct 10 12:10:51 2017 us=504254 client/192.11.5.251 SENT CONTROL [client]: ‘PUSH_REPLY,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5,peer-id 0,cipher AES-256-GCM’ (status=1)
Tue Oct 10 12:10:51 2017 us=504254 client/192.11.5.251 Data Channel: using negotiated cipher ‘AES-256-GCM’
Tue Oct 10 12:10:51 2017 us=504254 client/192.11.5.251 Data Channel MTU parms [ L:1549 D:1450 EF:49 EB:406 ET:0 EL:3 ]
Tue Oct 10 12:10:51 2017 us=504254 client/192.11.5.251 Outgoing Data Channel: Cipher ‘AES-256-GCM’ initialized with 256 bit key
Tue Oct 10 12:10:51 2017 us=504254 client/192.11.5.251 Incoming Data Channel: Cipher ‘AES-256-GCM’ initialized with 256 bit key
Tue Oct 10 12:10:51 2017 us=926129 client/192.11.5.251 MULTI: bad source address from client [::], packet dropped

Источник

Topic: OpenVPN log show Authenticate/Decrypt packet error: bad packet ID may be replay  (Read 8639 times)

Hello,

I enabled netflow for local capture on several OPNsense machines for LAN and WAN interfaces. These machines have a site-to-site VPN setup.
Once netflow was enabled the connection to the LAN for the remote OPNsense machines went down. Each for around 10 to 15 minutes.

I looked at our main firewall these remote sites connect to and the OpenVPN tunnel to each site never showed as down. So it seems only the connection to the LAN went down.

The version of OPNsense we’re using is 20.1.6
I did see this message in the VPN log file on the remote OPNsense machines:
Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #1552650 / time = (1590696725) Thu May 28 16:12:05 2020 ] — see the man page entry for —no-replay and —replay-window for more info or silence this warning with —mute-replay-warnings

I’ve not seen this message before, but it’s only in the log of the remote OPNsense machine, not our main firewall these machines connect to. The «authenticatedecrypt packet error» message shows in the VPN log as starting when the connection was lost and ending when the connection came back up.

Has anyone else experienced this before?

Kind regards,
penley

« Last Edit: June 11, 2020, 02:14:41 pm by penley »


Logged


The remote OPNsense machines went unavailable again and then connectivity came back after 12 minutes. I looked in their VPN log and see the message again- Authenticate/Decrypt packet error: bad packet ID (may be a replay):  — see the man page entry for —no-replay and —replay-window for more info or silence this warning with —mute-replay-warnings.

Is this message because I do not have the ovpn interface listed in the listening interfaces within the Netflow configuration? These firewalls are using a site to site OpenVPN connection.


Logged


I’d like to close the loop on this one. I think I’ve figured out my mistake.
Our primary HA are VMs and their WAN and LAN IP addresses were in the same subnet. This has been changed and ever since then I’ve not seen the «Authenticate/Decrypt packet error: bad packet ID » message in the OpenVPN log. I still have netflow disabled, but have been trying to change one thing at a time to figure this out.

For anyone else who reads this, do not make my mistake and set the WAN and LAN addresses in the same subnet. It causes issues.

Kind regards,
penley


Logged


This topic has been deleted. Only users with topic management privileges can see it.

  • Hi I have just noticed this error mulitple times in my openvpn system logs:

    Jan 15 05:27:02 openvpn[50203]: Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #3179030 ] – see the man page entry for —no-replay and —replay-window for more info or silence this warning with —mute-replay-warnings
    Jan 15 05:32:02 openvpn[50203]: Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #3507028 ] – see the man page entry for —no-replay and —replay-window for more info or silence this warning with —mute-replay-warnings
    Jan 15 05:42:02 openvpn[50203]: Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #227671 ] – see the man page entry for —no-replay and —replay-window for more info or silence this warning with —mute-replay-warnings

    It actually repeats non stop, I followed a pfsense VPN guide but I am unsure how to go about fixing this error ?

    Any advice is welcome cheers

  • That can be a few different things but usually it boils down to one of two:

    1. The clock is off on one or both sides
    2. The internet connection is bad between the two, causing packets to arrive out of order or multiple times.

  • Some outside services are injecting packets to the stream to get a bounce containing info on the download. It’s just a way to see what’s the content of the stream by a thrd party.

  • Wow! Resurrecting a 2 year thread.

    In my case, I switched from UDP to TCP and the messages stopped.

  • @gjaltemba:

    Wow! Resurrecting a 2 year thread.

    In my case, I switched from UDP to TCP and the messages stopped.

    I second that, same config, but install set to use TCP, connects instantly (instead of waiting, then timing out).

  • I got this error on a UDP too where I have a mis match in cipher, server was none and client was AES-128-CBC and a mismatch in the comp-lzo, server said no and client was comp-lzo.


  • Referenced by 

    Gertjan Gertjan 


  • Referenced by 

    Gertjan Gertjan 

  • Понравилась статья? Поделить с друзьями:

    Читайте также:

  • Openvpn agent request error
  • Openvpn aead decrypt error bad packet id may be a replay
  • Opensslerrorstack error 03000086 digital envelope routines initialization error
  • Openssl ssl connect ssl error syscall
  • Openssl mac verify error invalid password

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии