External CGNAT
External CGNAT transfers Network Address Translations (NAT) and Network Address Port Translations (NAPT) to an external device and account subscriber activity by correlating RADIUS‑reported public IPv4 addresses and port blocks with individual subscriber sessions.
External CGNAT enables broadband service providers to transfer Network Address Translation (NAT) and Network Address Port Translations (NAPT) processing to a dedicated CGNAT device while retaining subscriber termination and control functions on the Broadband Network Gateway (BNG) router. The BNG maintains full subscriber context—including authentication state, access interface, and service profiles—and forwards subscriber traffic to the external CGNAT system for address and port translation.
When you enable external CGNAT and accounting service, the BNG records public IP address and public port block information received from the CGNAT system through RADIUS Vendor-Specific Attribute (VSA) 238. Each subscriber session on the BNG is uniquely identified using an internal session identifier, which is mapped to the assigned public IP address, port block, and timestamp. Upon subscriber login, the BNG creates an accounting entry (Account-Start), and upon subscriber logout, the entry is cleared (Account-Stop). These mappings are maintained in an internal database to ensure accurate correlation between subscriber identity and post-NAT address usage. This capability enables service providers to track and report subscriber activity even when NAT translation occurs outside the BNG, supporting billing, monitoring, and regulatory compliance requirements.
Configure external CGNAT
Follow the steps below to enable external CGNATS and thereby report the Ipv4 public address and port block to the RADIUS server as part of subscriber accounting:
Enable CGNAT accounting service on the BNG device.
[edit] system services subscriber-management { cgnat { reporting-method [accounting | accounting-delta]; source [syslog]; } }Enable external CGNAT feature using one of the following methods:
Add the
external-naptstatement under the[edit dynamic-profiles name services]hierarchy to enable external CGNAT for individual subscriber sessions. For example:[edit] dynamic-profiles { cgnat-profile { services { external-napt; } } }Note:Inline CGNAT and external CGNAT are exclusive features. You can enable only one at a time, as configuring both prevents committing.
Enable external CGNAT from the RADIUS server using the predefined variable
$junos-external-napt-control, which sends over the RADIUS vendor-specific attribute (VSA) 237. For example:[edit] dynamic-profiles { cgnat-profile { services { external-napt { “disable:$junos-external-napt-control”; } } } }The conditional statement
disable:$junos-external-napt-controlused in the configuration above is to disable the external CGNAT feature if RADIUS server does not return a value for the variable.You can define a default value for the
$junos-external-napt-controlvariable. To configure a default value, use the following command:[edit dynamic-profiles cgnat-profile] set predefined-variable-defaults external-napt-control (enable | disable)
Note:When a default value is not configured for the variable
$junos-external-napt-controland RADIUS fails to return a value, the external CGNAT feature remains disabled by default.
Verify Subscriber Mapping
Use the show subscribers id id command to verify the
subscriber mapping details. For example:
show subscribers id 69 extensive Type: PPPoE User Name: pppoe_tester IP Address: 172.16.200.3 IP Netmask: 255.255.255.255 Logical System: default Routing Instance: default Interface: pp0.3221225539 Interface type: Dynamic Underlying Interface: demux0.3221225538 Dynamic Profile Name: ppp-client-profile MAC Address: 00:12:01:00:00:01 State: Active Radius Accounting ID: 69 Session ID: 69 PFE Flow ID: 100 Stacked VLAN Id: 1 VLAN Id: 1 Login Time: 2026-01-20 06:00:32 PST External NAPT Mapping: Public IP Address Port Block Allocation Time Free Time 10.64.1.2 3762 2026-01-20 06:01:28 PST - IP Address Pool: apm_pool1-default Accounting interval: 600