wireguard trouble
James Cook
falsifian at falsifian.org
Sun Jun 6 14:20:36 PDT 2021
On Mon, May 31, 2021 at 09:31:57AM +0800, Aaron LI wrote:
> Hi James,
>
> I knew this issue quite some time ago (> 1 year). It’s an issue in the golang’s net/route package. It was broken by the RTM_VERSION bump in DragonFly and first reported at:
>
> https://github.com/golang/go/issues/34368
>
> Although the above issue has been resolved, I think it’s a partial fix. So there is the tun creation issue we’re having in wireguard.
>
> I tried a bit to investigate the issue but without a result then. Then I suspended the work since I was (and still am) not using wireguard.
>
> Cheers,
> Aaron
Thanks Aaron. I'm currently trying to puzzle my way through what's
going on.
Question, for anyone who knows: was there some time in the past when
opening /dev/tun0 would create the tun0 interface?
I ask because the CreateTUN function in the dfly patch for wireguard-go
(net/wireguard-go/dragonfly/patch-tun_tun__dragonfly.go) seems to just
try opening /dev/tun0. As far as I can tell, that's not the correct way
to create a tun interface: instead, you're supposed to open /dev/tun.
This leads to the error I posted earlier:
Failed to create TUN device: open /dev/tun0: no such file or directory
The message is printed by wireguard-go, which is called from the
add_if() function of wg-quick.
Either (a) I am misunderstanding how wireguard setup is supposed to
work, or (b) something has changed since the dfly patch was written.
I'm going to proceed on the assumption that it's (b), but it would be
nice to know for sure.
--
James
More information about the Users
mailing list