Skip to contentSkip to conversation

In P2P and IPv6 only mode: do_ifconfig() does not set up tun interface

Openvpn-devel Michael Kress 2 participants 2 messages Aug 12, 2017

lore
Share & tools
lore
#0 lore raw

Hello list,

it seems that OpenVPN in P2P mode (static keys) doesn't configure and start the tun interface when there are no configured IPv4 addresses:

OpenVPN 2.4.3
In "void do_ifconfig()" of tun.c line 881: if (tt->did_ifconfig_setup)

The flag tt->did_ifconfig_ipv6_setup is not considered at all. Is there a reason to not start an IPv6 only tun device? Maybe this has simply been overseen?

For testing I changed it to:
if (tt->did_ifconfig_setup || tt->did_ifconfig_ipv6_setup)

I'm on Linux. The IPv4 addresses are initialized with 0.0.0.0, the "ip" tool doesn't complain, the IPv6 address is configured, the tun interface gets up.

A trick would be to use something like this in the config file:
ifconfig 0.0.0.0 0.0.0.1

Alternatively one would have to set up the tun interface manually after starting the tunnel.

Signature · 2 lines
Servus
  Michael
#1 lore raw

Hi,

Quoted 9 lines · Michael Kress

it seems that OpenVPN in P2P mode (static keys) doesn't configure and start the tun interface when there are no configured IPv4 addresses:

OpenVPN 2.4.3
In "void do_ifconfig()" of tun.c line 881: if (tt->did_ifconfig_setup)

The flag tt->did_ifconfig_ipv6_setup is not considered at all. Is there a reason to not start an IPv6 only tun device? Maybe this has simply been overseen?

IPv6-only is currently not supported (it works if you do not use any ifconfig at all inside OpenVPN, but not with --ifconfig/ifconfig-ipv6).

The reason is fairly simple - there's lots of assumptions inside OpenVPN about "IPv4 will be there" and nobody has checked everything to make sure nothing will blow up (or the blowups are fixed) in case IPv4 is not.

No hard technical reason, just a matter of available time.

(The routing layer *nowadays* actually happily deals with "no IPv4 routes" - initially, the scenario "IPv6 routes, no IPv4 routes" caused a segfault...)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...