-
Notifications
You must be signed in to change notification settings - Fork 312
Open
Description
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
Labels
No labels