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

Error reading data from Darwin Tun network card while writing to Linux Tun network card #28

Open
hxx258456 opened this issue May 22, 2024 · 0 comments
Labels
question Further information is requested

Comments

@hxx258456
Copy link

hxx258456 commented May 22, 2024

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
@nekohasekai nekohasekai added the question Further information is requested label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants