Skip to content

Windows 11 TUN only capture packet with Src 0.0.0.0 #106

@ulfaric

Description

@ulfaric

Really need someone to help me figure this out, here is a test code:

package main

import (
"log"

"github.com/songgao/water"
"golang.org/x/net/ipv4"

)

func main() {

ifce, err := water.New(water.Config{
	DeviceType: water.TUN,
})
if err != nil {
	log.Fatal(err)
}

for {
	frame := make([]byte, 65535)
	n, err := ifce.Read(frame)
	if err != nil {
		log.Fatal(err)
	}
	frame = frame[:n]
	log.Printf("%s Received packet, length: %d", ifce.Name(), n)
	ipHeader, err := ipv4.ParseHeader(frame)
	if err != nil {
		log.Printf("Error parsing IP header: %v", err)
	} else {
		log.Printf("Received packet from %s to %s", ipHeader.Src, ipHeader.Dst)

	}
}

}

I used the OpenVPN TAP driver 9.27, installed by "devcon install OemVista.inf tap0901". The adapter seems working fine.

I have set the IP, default gateway etc for the adapter. But no matter what I do, the go program only sees packets with Src 0.0.0.0. I have compiled it and run it as admin, still the same...

Then I tried to turn off network isolation according to GPT by "netsh interface set interface <interface_name> admin=enabled". Still no help....

Tried TAP too, seems still can not say any non-broadcast packets...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions