Remote_address()

Hello,

I’m managing CPE devices that are behind CGNAT (Carrier-Grade NAT). I need to capture and display the actual public IP address that the device uses to connect to my GenieACS server.

  • Device reports: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress = 100.66.x.x (CGNAT private IP)
  • GenieACS CWMP logs show the real public IP: ::ffff:xxx.xxx.xxx.xxx
  • I can capture this IP in a provision script using REMOTE_ADDRESS() args[0]

Is there a built-in way to store custom string values (like IP addresses) in the device data model without using an external extension?

I’ve implemented a solution using an extension script that stores IPs in a JSON file, which works but seems like overkill for this use case.

This virtual parameter will store an arbitrary string value.

let value;

if ("value" in args[1]) {
    // Set declared value
    value = args[1].value;
} else if ("value" in args[3]) {
    // No declared value, keep current value
    value = args[3].value;
} else {
    // No current value, use default
    value = ['{}', 'xsd:string'];
}

return {writable: true, value: value};

Thanks works