Ubuntu 22.04 OpenVpn server error: write to TUN/TAP : Invalid argument (code=22)

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
sethi
OpenVpn Newbie
Posts: 2
Joined: Fri Apr 22, 2022 7:26 am

Ubuntu 22.04 OpenVpn server error: write to TUN/TAP : Invalid argument (code=22)

Post by sethi » Fri Apr 22, 2022 7:28 am

I start openvpn server with

Code: Select all

openvpn --dev tun --ifconfig 172.16.0.1 172.16.0.2 --cipher AES-256-CBC
on my Ubuntu 22.04 Linux Box

I generate the certificates and keys with easycert and copy everything on a Windows 10 client.

The connection doesn't work, and in the syslog I find a lot of

Code: Select all

write to TUN/TAP : Invalid argument (code=22)
write to TUN/TAP : Invalid argument (code=22)
...
What's wrong? This is my client configuration file:

Code: Select all

client
dev tun
proto udp
remote *MYSERVERIP* 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
remote-cert-tls server
cipher AES-256-CBC

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

Re: Ubuntu 22.04 OpenVpn server error: write to TUN/TAP : Invalid argument (code=22)

Post by TinCanTech » Fri Apr 22, 2022 11:09 am

sethi wrote:
Fri Apr 22, 2022 7:28 am
I start openvpn server with

Code: Select all

openvpn --dev tun --ifconfig 172.16.0.1 172.16.0.2 --cipher AES-256-CBC
That is not a server.

sethi
OpenVpn Newbie
Posts: 2
Joined: Fri Apr 22, 2022 7:26 am

Re: Ubuntu 22.04 OpenVpn server error: write to TUN/TAP : Invalid argument (code=22)

Post by sethi » Fri Apr 22, 2022 12:11 pm

TinCanTech wrote:
Fri Apr 22, 2022 11:09 am
sethi wrote:
Fri Apr 22, 2022 7:28 am
I start openvpn server with

Code: Select all

openvpn --dev tun --ifconfig 172.16.0.1 172.16.0.2 --cipher AES-256-CBC
That is not a server.
I was thinking that it could be a good way to make a debug for my client

Post Reply