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 support for SNAT randomization exclusion ranges #3174

Open
ethan-gallant opened this issue Jan 16, 2025 · 0 comments
Open

Add support for SNAT randomization exclusion ranges #3174

ethan-gallant opened this issue Jan 16, 2025 · 0 comments

Comments

@ethan-gallant
Copy link

What would you like to be added:
The ability to use randomized SNAT but exclude specific port ranges from randomization.

Why is this needed:
Randomized SNAT is extremely useful in multi-tenant workloads like Kubernetes. It greatly enhances the stability of the network and prevents traffic from being dropped should two pods send an outbound request from the same port.
However several protocols such as Bittorrent and other P2P protocols that rely on predictable NAT behavior will fail with fully randomized SNAT. Specifically, the following protocols are incompatible with --randomize-fully:

  • STUN (Session Traversal Utilities for NAT) - Used for NAT traversal and network discovery
  • ICE (Interactive Connectivity Establishment) - Critical for WebRTC and other real-time communications
  • UDP hole punching protocols - Used by many P2P applications and games
  • SIP with direct media - Used for VoIP and video conferencing
  • BitTorrent and other P2P file sharing protocols - Require predictable port mapping
  • WebRTC in peer-to-peer mode - Used for browser-based real-time communication
  • Cryptocurrency wallet P2P discovery - Many blockchain nodes use NAT traversal for peer discovery and connection

The ability to exclude specific port ranges from randomization would allow us to maintain the benefits of randomized SNAT for general traffic while preserving compatibility with these protocols in designated port ranges.
Would you like me to add any additional sections to the issue template, such as potential implementation approaches or specific use cases?

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

No branches or pull requests

1 participant