Dear team. ! We found that WireGuard does not work on the recent Windows 11 24H2. #1412

Closed
opened 2025-11-20 05:29:50 -05:00 by saavagebueno · 6 comments
Owner

Originally created by @polin-x on GitHub (Nov 13, 2024).

Dear team. !

 We found that WireGuard does not work on the recent Windows 11 24H2.
Originally created by @polin-x on GitHub (Nov 13, 2024). Dear team. ! We found that WireGuard does not work on the recent Windows 11 24H2.
saavagebueno added the clientwaiting-feedbackwindows labels 2025-11-20 05:29:50 -05:00
Author
Owner

@mgarces commented on GitHub (Nov 13, 2024):

Hello @polin-x ; can you please describe what you are experiencing?

I have tested 0.31.1 on Windows11 Pro 24H2 with all the latest updates, and works without any issues.

@mgarces commented on GitHub (Nov 13, 2024): Hello @polin-x ; can you please describe what you are experiencing? I have tested [0.31.1](https://github.com/netbirdio/netbird/releases/tag/v0.31.1) on Windows11 Pro 24H2 with all the latest updates, and works without any issues.
Author
Owner

@polin-x commented on GitHub (Dec 9, 2024):

Hello @mgarces

The problem occurred when I used netbirdio to build my own WireGuard Windows client. Below is my demo code.

package main

import (
	"bytes"
	"errors"
	"fmt"
	ifacee "github.com/netbirdio/netbird/client/iface"
	"go.uber.org/zap"
	"golang.org/x/sys/windows"
	"golang.zx2c4.com/wireguard/tun"
	"golang.zx2c4.com/wireguard/windows/elevate"
	"golang.zx2c4.com/wireguard/windows/tunnel/winipcfg"
	"log"
	"net"
	"net/netip"
	"strings"
	"syscall"
	"time"
	"unsafe"
)

func main() {
	opts := ifacee.WGIFaceOpts{
		IFaceName: "Kit",
		Address:   "172.25.3.252/32",
		WGPort:    30001,
		WGPrivKey: "",
		MTU:       1400,
	}

	iface, err := ifacee.NewWGIFace(opts)
	if err != nil {
		log.Fatal(err)
	}
	err = iface.Create()
	if err != nil {
		log.Fatal(err)
	}
	
	nativeTunDevice := iface.GetDevice().Device.(*tun.NativeTun)
	NID := winipcfg.LUID(nativeTunDevice.LUID())
	ifc, err := NID.IPInterface(windows.AF_INET)
	if err != nil {
		log.Fatal(err)
	}
	err = ifc.Set()
	fmt.Println(NID)

	var d []netip.Addr
	dnsIP := []string{"172.22.233.179"}
	for _, k := range dnsIP {
		addr, err := netip.ParseAddr(k)
		if err != nil {
			log.Fatal(err)
		}
		d = append(d, addr)
	}

	err = NID.SetDNS(windows.AF_INET, d, []string{"www.kuaishou.com"})
	if err != nil {
		log.Fatal(err)
	}

	_, err = iface.Up()
	if err != nil {
		log.Fatal(err)
	}
	keepAlive := 15 * time.Second

	addr, err := net.ResolveUDPAddr("udp", "xxxx:30001")
	if err != nil {
		fmt.Println(err)
		return
	}

	err = iface.UpdatePeer("", "0.0.0.0/0", keepAlive, addr, nil)
	if err != nil {
		log.Fatal(err)
	}
	
	v := NetVPNConf{
		Lid:      NID,
		Endpoint: "xxxx:30001",
		IP:       "172.25.3.252/32",
	}

	p, err := v.GetInterface(iface.Name())
	if err != nil {
		log.Fatal(err)
	}
	v.DevInterface = p

	if err := v.PhysicalNetRoute(); err != nil {
		log.Println("physical net route", err)
		//return err
	}

	if err := v.VirtualNetRoute([]string{"0.0.0.0/0"}); err != nil {
		log.Println("physical net route", err)
	}

	select {}
}

golang.zx2c4.com/wireguard v0.0.0-20230704135630-469159ecf7d1
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6 // indirect
golang.zx2c4.com/wireguard/windows v0.5.3
github.com/netbirdio/netbird v0.34.1

Looking forward to your reply very much.

@polin-x commented on GitHub (Dec 9, 2024): Hello @mgarces The problem occurred when I used netbirdio to build my own WireGuard Windows client. Below is my demo code. ``` package main import ( "bytes" "errors" "fmt" ifacee "github.com/netbirdio/netbird/client/iface" "go.uber.org/zap" "golang.org/x/sys/windows" "golang.zx2c4.com/wireguard/tun" "golang.zx2c4.com/wireguard/windows/elevate" "golang.zx2c4.com/wireguard/windows/tunnel/winipcfg" "log" "net" "net/netip" "strings" "syscall" "time" "unsafe" ) func main() { opts := ifacee.WGIFaceOpts{ IFaceName: "Kit", Address: "172.25.3.252/32", WGPort: 30001, WGPrivKey: "", MTU: 1400, } iface, err := ifacee.NewWGIFace(opts) if err != nil { log.Fatal(err) } err = iface.Create() if err != nil { log.Fatal(err) } nativeTunDevice := iface.GetDevice().Device.(*tun.NativeTun) NID := winipcfg.LUID(nativeTunDevice.LUID()) ifc, err := NID.IPInterface(windows.AF_INET) if err != nil { log.Fatal(err) } err = ifc.Set() fmt.Println(NID) var d []netip.Addr dnsIP := []string{"172.22.233.179"} for _, k := range dnsIP { addr, err := netip.ParseAddr(k) if err != nil { log.Fatal(err) } d = append(d, addr) } err = NID.SetDNS(windows.AF_INET, d, []string{"www.kuaishou.com"}) if err != nil { log.Fatal(err) } _, err = iface.Up() if err != nil { log.Fatal(err) } keepAlive := 15 * time.Second addr, err := net.ResolveUDPAddr("udp", "xxxx:30001") if err != nil { fmt.Println(err) return } err = iface.UpdatePeer("", "0.0.0.0/0", keepAlive, addr, nil) if err != nil { log.Fatal(err) } v := NetVPNConf{ Lid: NID, Endpoint: "xxxx:30001", IP: "172.25.3.252/32", } p, err := v.GetInterface(iface.Name()) if err != nil { log.Fatal(err) } v.DevInterface = p if err := v.PhysicalNetRoute(); err != nil { log.Println("physical net route", err) //return err } if err := v.VirtualNetRoute([]string{"0.0.0.0/0"}); err != nil { log.Println("physical net route", err) } select {} } ``` golang.zx2c4.com/wireguard v0.0.0-20230704135630-469159ecf7d1 golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6 // indirect golang.zx2c4.com/wireguard/windows v0.5.3 github.com/netbirdio/netbird v0.34.1 Looking forward to your reply very much.
Author
Owner

@wencaiwulue commented on GitHub (Dec 14, 2024):

@polin-x You can find the solution here . meet the same situation and fixed it
https://github.com/kubenetworks/kubevpn/issues/401

@wencaiwulue commented on GitHub (Dec 14, 2024): @polin-x You can find the solution [here](https://www.kubevpn.cn/docs/faq/6/) . meet the same situation and fixed it https://github.com/kubenetworks/kubevpn/issues/401
Author
Owner

@nazarewk commented on GitHub (Apr 28, 2025):

Hello @polin-x,

We're currently reviewing our open issues and would like to verify if this problem still exists in the latest NetBird version.

Could you please confirm if the issue is still there?

We may close this issue temporarily if we don't hear back from you within 2 weeks, but feel free to reopen it with updated information.

Thanks for your contribution to improving the project!

@nazarewk commented on GitHub (Apr 28, 2025): Hello @polin-x, We're currently reviewing our open issues and would like to verify if this problem still exists in the [latest NetBird version](https://github.com/netbirdio/netbird/releases). Could you please confirm if the issue is still there? We may close this issue temporarily if we don't hear back from you within **2 weeks**, but feel free to reopen it with updated information. Thanks for your contribution to improving the project!
Author
Owner

@polin-x commented on GitHub (Apr 28, 2025):

Hello @polin-x,

We're currently reviewing our open issues and would like to verify if this problem still exists in the latest NetBird version.

Could you please confirm if the issue is still there?

We may close this issue temporarily if we don't hear back from you within 2 weeks, but feel free to reopen it with updated information.

Thanks for your contribution to improving the project!

Is there any fix for windows 11 24h2 related problems? If not, then the problem still exists.

@polin-x commented on GitHub (Apr 28, 2025): > Hello [@polin-x](https://github.com/polin-x), > > We're currently reviewing our open issues and would like to verify if this problem still exists in the [latest NetBird version](https://github.com/netbirdio/netbird/releases). > > Could you please confirm if the issue is still there? > > We may close this issue temporarily if we don't hear back from you within **2 weeks**, but feel free to reopen it with updated information. > > Thanks for your contribution to improving the project! Is there any fix for windows 11 24h2 related problems? If not, then the problem still exists.
Author
Owner

@nazarewk commented on GitHub (Nov 4, 2025):

@polin-x I believe this is caused by a required Windows feature being turned off by default, the fix is at https://github.com/kubenetworks/kubevpn/issues/401 as previously mentioned.

@nazarewk commented on GitHub (Nov 4, 2025): @polin-x I believe this is caused by a required Windows feature being turned off by default, the fix is at https://github.com/kubenetworks/kubevpn/issues/401 as previously mentioned.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1412