Skip to content

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

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

Closed
bpmct opened this issue May 7, 2024 · 0 comments · Fixed by #13314
Closed

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

bpmct opened this issue May 7, 2024 · 0 comments · Fixed by #13314
Assignees
Labels
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.

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

Successfully merging a pull request may close this issue.

2 participants