For AI agents: this documentation is indexed for you in llms.txt, and all of it in /llms.txt. Every page is also available as markdown: append .md to its address.

Basic NAT

User Plane Gateway (UPG) supports basic NAT on the SGi interface for Packet Gateway (PGW) and Traffic Detection Function (TDF) deployments. Basic NAT uses late-binding: mappings are allocated dynamically in the datapath when the first packet of a flow is forwarded, with no Control Plane involvement. This is the main difference from CG-NAT, where the Control Plane pre-allocates a NAT port block per PFCP session.

Note

Limitation: Basic NAT is currently incompatible with NAT on additional data interfaces — all translations share the SGi NWI's address pool regardless of egress. This applies to both basic and nat44-ei types.

NAT types

UPG basic NAT supports two types, configured through the nat.type parameter:

  • basic — endpoint-dependent NAT (NAT44-ED). A separate mapping is created for each destination IP and port pair, so the outside port allocated for an internal source depends on the destination it talks to.
  • nat44-ei — endpoint-independent NAT (NAT44-EI). The same internal source is always translated to the same outside IP and port regardless of destination, allowing external hosts to reach the UE through that mapping.

Note

nat44-ei is an alpha feature and is not suitable for production deployments.

Configuration

For a complete deployment, follow the Packet Gateway guide and add the basic NAT configuration to the spec of the UPGDeployment CR.

Add the following to the UPGDeployment values:

yaml

The spec.nat.enabled flag activates NAT, and spec.nat.type selects the type (basic or nat44-ei). The spec.instances.{name}.nat.ranges list defines the NAT pool address ranges on the SGi interface.

The spec.nat.maxNatFlows field sets the maximum number of concurrent NAT sessions tracked across all worker threads (default 1000000). When the table is full, new flows are dropped until idle sessions are reaped.

Per-protocol session idle timeouts (in seconds) are set under spec.nat.timeouts:

  • icmp — ICMP idle timeout (default 60)
  • tcpEstablished — TCP established idle timeout (default 1800)
  • tcpTransitory — TCP transitory idle timeout (default 240)
  • udp — UDP idle timeout (default 300)

For the full list of NAT parameters, see the UPGDeployment CRD reference.

TCP MSS clamping

To rewrite the TCP Maximum Segment Size (MSS) on packets passing through basic NAT, set spec.nat.mssClamping to the desired MSS value:

yaml

When spec.nat.mssClamping is not set, MSS clamping is disabled. MSS clamping applies to both basic and nat44-ei types.

Verification

Check the basic NAT state with vppctl in the UPG pod. The commands differ between the two NAT types. Use the nat44 ... form for basic and the nat44 ei ... form for nat44-ei.

  1. Confirm the NAT pool addresses are registered:

    bash

    Sample output:

    txt
  2. Confirm the SGi interface is set as the NAT outside interface:

    bash

    Sample output:

    txt
  3. Confirm the MSS clamping value, when spec.nat.mssClamping is set:

    bash

    Sample output:

    txt

    When MSS clamping is not configured, the output is mss-clamping disabled.

  4. After traffic has flowed, list the active translations:

    bash

    Sample output:

    txt

    Each worker thread reports the sessions it owns. The i2o/o2i lines show the pre-NAT and post-NAT 5-tuple for the inbound-to-outbound and outbound-to-inbound directions.

For nat44-ei, replace nat44 with nat44 ei in the commands above (for example, vppctl show nat44 ei addresses).