Error reading data from Darwin Tun network card while writing to Linux Tun network card
Opened this issue · 0 comments
hxx258456 commented
Mac Tun device creation code
srcPrefix, err := netip.ParsePrefix("10.0.0.1/24")
if err != nil {
return nil, err
}
dstPrefix, err := netip.ParsePrefix("10.0.0.0/24")
if err != nil {
return nil, err
}
tun, err := stun.New(stun.Options{
Name: "utun3",
Inet4Address: []netip.Prefix{srcPrefix},
MTU: uint32(1420),
AutoRoute: true,
Inet4RouteAddress: []netip.Prefix{dstPrefix},
})
Linux Tun device creation code
srcPrefix, err := netip.ParsePrefix("10.0.0.2/24")
if err != nil {
return nil, err
}
option := stun.Options{
Name: "tun3",
Inet4Address: []netip.Prefix{srcPrefix},
MTU: uint32(1420),
}
tun, err := stun.New(option)
I established a tunnel between two machines, but when I forwarded the data packet read from the Mac tun device to the Linux tun device, he encountered this error
write tun: invalid argument