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

set_network_addresses_tuple doesn't work for IPv6 on Windows 11 #15

Open
ReactorScram opened this issue Jan 4, 2024 · 3 comments
Open

Comments

@ReactorScram
Copy link
Contributor

The netsh syntax appears to be wrong. I'm not sure if it worked on older versions of Windows? But on my Win11 dev system it doesn't work.

This does work: netsh interface ipv6 set address interface="My Wintun Tunnel" address=f000::f000

So I'm working around it here https://github.com/firezone/firezone/pull/3120/files#diff-d3087e924a318d4651ba5e2d08ebc753563e4cd3d2a0f6acccf2475936595551R86-R95

I'm not sure if the CREATE_NO_WINDOW flag helps or not - It worked for Powershell windows I was trying to hide.

@TroyNeubauer
Copy link
Collaborator

Thanks for flagging!

I won't have access to a Win11 machine for a few weeks so feel free to submit a PR if you need this fixed faster

@TroyNeubauer
Copy link
Collaborator

@ReactorScram
Copy link
Contributor Author

ReactorScram commented Jan 5, 2024

No problem! For now I'm just shelling out to netsh directly instead of using the wintun function.

Yeah I've ended up using a lot of those IpHelper functions from the Windows crate in the Firezone client. (Edit: https://github.com/firezone/firezone/blob/3d8ed7f10ed596bb7fb3ca376888eb10a267bc50/rust/connlib/tunnel/src/device_channel/tun_windows.rs#L75-L99)

If anyone's reading this and doesn't want to shell out, ChatGPT recommends CreateUnicastIpAddressEntry for both IPv4 and IPv6 - https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/NetworkManagement/IpHelper/fn.CreateUnicastIpAddressEntry.html

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