Configure IPv4 and IPv6

Need help configuring your VPN? Just post here and you'll get that help.

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
Lithimlin
OpenVpn Newbie
Posts: 1
Joined: Tue Dec 27, 2022 2:10 pm

Configure IPv4 and IPv6

Post by Lithimlin » Tue Dec 27, 2022 2:44 pm

I'm trying to setup my OpenVPN server to handle both IPv4 and IPv6 connections.
From what I gathered from various sources and the man-page, it should suffice to set the proto option to udp without any number following it, or even not set it at all:

Code: Select all

--proto p
          Use protocol p for communicating with remote host. p can be udp,
          tcp-client, or tcp-server. You can also  limit  OpenVPN  to  use
          only  IPv4  or  only  IPv6 by specifying p as udp4, tcp4-client,
          tcp4-server or udp6, tcp6-client, tcp6-server, respectively.

          The default protocol is udp when --proto is not specified.
However, when I do so, the IPv4 connection works fine, but I cannot connect using IPv6. Instead, I get a TLS error:

Code: Select all

2022-12-27 15:38:37 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
2022-12-27 15:38:37 TLS Error: TLS handshake failed
2022-12-27 15:38:37 SIGUSR1[soft,tls-error] received, process restarting
2022-12-27 15:38:37 Restart pause, 5 second(s)
After this, it connects to the IPv4 address.

Here is my relevant config:

Code: Select all

# local listen ip
# If unspecified, OpenVPN will bind to all interfaces.
;local vpn.my-host.tld

# listen on port 1194 udp
port 1194

# protocol
# can be udp, tcp-client, or tcp-server. You can also  limit  OpenVPN
# to  use only  IPv4  or  only  IPv6 by specifying p as udp4, tcp4-client,
# tcp4-server or udp6, tcp6-client, tcp6-server, respectively.
proto udp

# we use tun interface
dev-type tun
dev vpn_OpenVPN
What's going wrong here?

User avatar
ordex
OpenVPN Inc.
Posts: 444
Joined: Wed Dec 28, 2016 2:32 am
Location: IRC #openvpn-devel @ libera.chat

Re: Configure IPv4 and IPv6

Post by ordex » Fri Dec 30, 2022 3:38 pm

if the server is running Linux, you need to specify udp6 (weird eh?), because on Linux IPv6 sockets are dual stack unless otherwise instructed.

Post Reply