OpenVPN error "write to TUN/TAP : Invalid argument (code=22)"

Hello, I am receiving the above error in the subject line when trying to connect from my Gl-Inet router to the OpenVPN server that is running on my DDWRT router. Here is some information:

  • At one point on my GL-AR750S-EXT router, I was successfully able to connect from it to my OpenVPN server, but once I upgraded the AR750S to a newer firmware version, I could no longer connect.
    o unfortunately I do not recall the firmware version that it was previously working.

  • I also tried to connect from my GL-MT1300 to the same OpenVPN server on my DDWRT router and I get the same error.

  • However, I am successfully able to connect from my Windows 10 PC using OpenVPN GUI using the same .ovpn file that I installed and zipped along with ca.crt, client.crt, and client.key on the AR750S and MT1300.

  • I do have another DDWRT router that is operating as a OpenVPN client and it connects without a problem to the DDWRT.

Here is the error message on the Gl-Inet router:

daemon.err ovpnclient[29986]: write to TUN/TAP : Invalid argument (code=22)

Thank you

It is possible that the OVPN server is configured in TAP mode, but the OVPN client is TUN?

Please share the VPN profile with me via PM if possible, if not convenient, please share the screenshots about the GL WebUI and the profile key part.

Hello, thank you for getting back to me....this entire setup is a 'TAP' solution. Also, as mentioned, on my Windows 10 PC, I have OpenVPN installed using my .ovpn file (which has 'dev tap'), ca.crt, Client.crt, and Client.key and I can successfully connect to the remote OpenVPN server running on my DDWRT router. However, when I zip these same 4 files together to create a .zip file for either my AR-750S or MT1300 router, I receive the "Invalid argument (code=22)" error when I enable the VPN client.

I will send my .ovpn file to you via PM.

Thanks

Hi Bruce. I have the same issue, could you also help me out?
The router: mini smart vpn router - GL-MT300N-V2
Openvpn config file without certs:

###################
dev tun
tls-client

remote example.url.com 1194
client-cert-not-required

pull

proto udp

script-security 2

comp-lzo

reneg-sec 0

cipher AES-256-CBC
auth SHA512

auth-user-pass
###################
... here are the used certificates ...

Hello, I downgraded the firmware to 3.216 and it started working again.

1 Like