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

[Feature] ConeNAT support #177

Open
myloft opened this issue Oct 21, 2022 · 7 comments
Open

[Feature] ConeNAT support #177

myloft opened this issue Oct 21, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@myloft
Copy link
Contributor

myloft commented Oct 21, 2022

Description

From v2.4.1, the NAT type has changed to Symmetric NAT.

Is this feature related to a specific bug?

No response

Do you have a specific solution in mind?

No response

@myloft
Copy link
Contributor Author

myloft commented Oct 21, 2022

I'd be happy to help, although I don't know how to do it right now.

@xjasonlyu
Copy link
Owner

Before v2.4.0, the NAT part was written with a customized/unofficial UDP module, which makes it simple to implement Full-Cone NAT. But due to the aggressive gVisor update frequency, the API constantly changes, contributing the terrible code maintainability.

Therefore, starting from v2.4.0, the official gVisor net module was used to avoid regular code adaptations for its daily API updates. However, this also imported another issue - NAT. The gVisor abstracts its UDP module as a connection-based net, making it infeasible to receive packets from other sources, which causes the NAT type can only be symmetric for now.

To support Cone-NAT at this stage and keep the high code maintainability, we can only use a NAT table to map the connections and create a "fake" Port Restricted Cone NAT. The implementation can be done inside the tunnel/udp.go file. But it can be a bit complex and buggy at the beginning, and that's why I haven't implemented it yet. You're welcome if you want to contribute to this feature!

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Dec 20, 2022
@GektorUA
Copy link

Is there any possibility that Full Cone NAT will be back in future versions?

@xjasonlyu xjasonlyu removed the Stale label Dec 25, 2022
@xjasonlyu xjasonlyu pinned this issue Dec 25, 2022
@xjasonlyu xjasonlyu added the enhancement New feature or request label Feb 12, 2023
@rurirei
Copy link

rurirei commented Mar 4, 2023

The gVisor abstracts its UDP module as a connection-based net, making it infeasible to receive packets from other sources, which causes the NAT type can only be symmetric for now.

Is there any possibility that Full Cone NAT will be back in future versions?

maybe no.

@rurirei
Copy link

rurirei commented Mar 14, 2023

To support Cone-NAT at this stage and keep the high code maintainability, we can only use a NAT table to map the connections and create a "fake" Port Restricted Cone NAT. The implementation can be done inside the tunnel/udp.go file. But it can be a bit complex and buggy at the beginning,

how do we comfirm the source addr to map some *gonet.UDPConn connections?

@dksslq
Copy link

dksslq commented Mar 22, 2024

Nobody care this?

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

No branches or pull requests

5 participants