angristan / openvpn-install

Set up your own OpenVPN server on Debian, Ubuntu, Fedora, CentOS or Arch Linux.
https://stanislas.blog
MIT License
13.65k stars 2.97k forks source link

Could not determine IPv4/IPv6 protocol. Using AF_INET #756

Open joksik opened 3 years ago

joksik commented 3 years ago

hello when i check status services for openvpn i have one warning:

lis 04 14:28:40 anarchy openvpn[2327]: Could not determine IPv4/IPv6 protocol. Using AF_INET

i simple fix this in config by change "proto udp" to "proto udp4" we do the same if we use tcp protocol. it`s small fix but maybe you include this into script

randshell commented 3 years ago

Thanks for reporting this bug, would you like to open a PR for it?

this message is printed when no IPv4/v6 preference is given in the config (i.e. proto udp/tcp is used) and OpenVPN is running as a server. In this case OpenVPN falls back on what the OS prefers (based on getaddrinfo() result) - in my case AF_INET - and the message is printed to show the decision.

When using udp4/udp6 (or tcp4/tcp6) no message is printed because the socket family to use has been provided by the user.

Source: https://community.openvpn.net/openvpn/ticket/805.

testbughub commented 3 years ago

I don't have anything to add here, but this just happened to me as well, and made it impossible for me to connect. Making the change suggested by @joksik fixed it though, so thank you for that! If any info is needed, I can add it if requested.

mmplanet commented 3 years ago

@joksik that simple change took me hours to debug to. Kudos to you!

TinCanTech commented 3 years ago

FTR: In Openvpn, a warning message is simply a warning, there is nothing wrong with your VPN. If there were actually something wrong then there would be a FATAL message and Openvpn would exit.

In Openvpn, --proto udp6 will become the default and automatically fallback to udp4, if needed.

I don't think this issue requires the bug label.