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:
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:
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.
Confirm the NAT pool addresses are registered:
bashSample output:
txtConfirm the SGi interface is set as the NAT outside interface:
bashSample output:
txtConfirm the MSS clamping value, when spec.nat.mssClamping is set:
bashSample output:
txtWhen MSS clamping is not configured, the output is
mss-clamping disabled.After traffic has flowed, list the active translations:
bashSample output:
txtEach worker thread reports the sessions it owns. The
i2o/o2ilines 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).