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 Hard NAT ↔ Easy NAT (mapvarydest) to our network topology test #13194

Open
bpmct opened this issue May 7, 2024 · 0 comments
Open

Add Hard NAT ↔ Easy NAT (mapvarydest) to our network topology test #13194

bpmct opened this issue May 7, 2024 · 0 comments
Assignees
Labels
chore Non-customer facing refactors, cleanup, or technical debt. networking Area: networking

Comments

@bpmct
Copy link
Member

bpmct commented May 7, 2024

Build a network topology integration test where peers are behind NATs, and one of the NATs uses destination-dependent mapping.

Some ideas on how to get this done:

iptables

In a netns that does the NAT, create a fixed set of IP rewriting rules for each IP in the test configuration. The rule matches on the destination IP address and assigns a fixed source port (in addition to the source IP shared by all rules).

I'm not sure if Linux will automatically add the right conntrack entries to translate the return packets. If not, we might need to configure the peers to use a fixed source port for the UDP connections, so that we can add a fixed set of rules to translate (de-NAT) the reverse packets.

NAT in userspace

Create a simple NAT in userspace with two TUN devices, and push the device ends of the TUNs into the peer and main router netns. The userspace program reads IP packets and rewrites the source IP and port, with a destination-dependent mapping.

@bpmct bpmct added the networking Area: networking label May 7, 2024
@coder-labeler coder-labeler bot added the chore Non-customer facing refactors, cleanup, or technical debt. label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Non-customer facing refactors, cleanup, or technical debt. networking Area: networking
Projects
None yet
Development

No branches or pull requests

2 participants