OpenVPN: tun tap invalid argument (code=22)

After upgrading my OpenVPN server to CentOS 7.5 I had trouble connecting to it. Specifically, I had two different issues: ** the laptop, which is running Fedora 28, was able to connect just fine but DNS resolution was broken. ** OpenVPN for Android was also connecting just fine but reporting a weird error: OpenVPN: tun tap invalid argument (code=22). The first one was caused by me because after the CentOS upgrade procedure was completed I also run yum autoremove which deleted dnsmasq; the solution was fairly simple, reinstall and reconfigure dnsmasq. For the second issue the solution was to enable comp-lzo and voilà, everything started working again. …

Posted on

OpenVPN server and CentOS

OpenVPN is the de facto standard VPN free open source software; it is widely used, tested, well documented and also included in the CentOS repos (EPEL). .:. Server side configuration yum install openvpn easy-rsa dnsmasq When yum is done installing the required packages, copy the sample config file. cp /usr/share/doc/openvpn-*/sample/sample-config-files/server.conf /etc/openvpn Uncomment/edit the following lines in /etc/openvpn/server.conf: port 1194 proto udp dev tun ca ca.crt cert server.crt key server.key dh dh4096.pem server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt push "redirect-gateway def1" push "dhcp-option DNS 10.8.0.1" keepalive 10 120 tls-auth ta.key 0 # This file is secret key-direction 0 tls-version-min 1.2 tls-cipher TLS-DHE-RSA-WITH-AES-256-CBC-SHA256 auth SHA512 cipher AES-256-GCM #comp-lzo # Disable LZO compression persist-key persist-tun status openvpn-status.log ;log openvpn.log # disable log, optional ;log-append openvpn.log # disable log, optional user nobody group nobody Now, create two folders easy-rsa/keys in /etc/openvpn and copy some files into them: …

Posted on