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

Add option to enable SO_REUSEPORT for co-operating with natmap on router. #510

Open
DiruSec opened this issue Feb 13, 2024 · 1 comment
Open

Comments

@DiruSec
Copy link

DiruSec commented Feb 13, 2024

natmap was used for TCP / UDP hole punching under a NAT1 environment.
For communication, user should:

  • Listen to a port bind by natmap, or
  • Add port forwarding (DNAT) rules to firewall, or
  • Use build-in forward method.

After some tries, seems only the first method can co-operate with udp2raw.
No data can be received by udp2raw server using port forwarding provided by firewall, and udp2raw client and server cannot establish connection using natmap's build-in forward feature.

#201 talked about add SO_REUSEPORT for performance purpose. But seems SO_REUSEPORT is still not enabled at current.

natmap's solution for bind same port requires Linux kernel 5.6 or newer, though there's a number of routers using kernel older than 5.6.

I've compiled an udp2raw binary with SO_REUSEPORT enabled and it just works, so any plans for adding it as an option?

@wangyu-
Copy link
Owner

wangyu- commented Apr 29, 2024

I've compiled an udp2raw binary with SO_REUSEPORT enabled and it just works, so any plans for adding it as an option?

can you show me which socket did you enable SO_REUSEPORT? (is it only server's listen socket?)

I can add it as an option in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants