Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable wgctrl to control wireguard interface created on gvisor's netstack. #129

Open
ntnj opened this issue Jan 16, 2023 · 2 comments
Open

Comments

@ntnj
Copy link

ntnj commented Jan 16, 2023

I'm creating a wireguard interface using the netstack package. I'm able to use the text based protocol to configure the device using device.IpcSet.

But wgctrl-go is unable to see the interface created in gvisor stack, and I don't see any customization in public API to use custom Dial functions needed by gvisor.

@stv0g
Copy link
Contributor

stv0g commented Sep 11, 2023

I am not sure if I understand your issue. wgctrl-go uses a unix domain socket for configuring userspace devices. You only need to ensure that you open a socket in the correct location.

See:

func find() ([]string, error) {
return findUNIXSockets([]string{
// It seems that /var/run is a common location between Linux and the
// BSDs, even though it's a symlink on Linux.
"/var/run/wireguard",
})
}

@ntnj
Copy link
Author

ntnj commented Sep 13, 2023

Wireguard on netstack does not run in "userspace" as a userspace wireguard implementation. gvisor's netstack has its own IP stack implemented in userspace on top of which wireguard runs, so there is no unix domain socket to connect to.

gvisor implements linux syscalls in userspace and is written in go. Wireguard-go supports it (https://pkg.go.dev/golang.zx2c4.com/wireguard/tun/netstack)

I don't remember the context on what I specifically wanted in this issue though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants