Get real IP / synced from IP

Victor Smirnov victorvsmirnov at gmail.com
Thu Feb 28 18:22:45 EST 2019


Hi Rick,
If you are desperate, here's a quick fix:
https://github.com/genieacs/genieacs/pull/335

then in your provision script you can have:

let thiscontext = getContext();
log ("INFO scriptname: Remote IP: " +
thiscontext.httpRequest.connection.remoteAddress);

There's clearly a need and a good reason why (parts of) the context  should
be available inside the sandbox.

Victor Smirnov


Den tor. 28. feb. 2019 kl. 20:30 skrev Rickard Johansson <
rickard.johansson at equiinet.com>:

> Hi,
>
> A couple of my CPE's are behind NAT and therefore reports a local IP
> in InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress.
>
> I wonder if it is possible to get the real / synced from IP, maybe using a
> Virtual Parameter?
> Genie obviously knows the IP as it's included in the log files, but can it
> be accessed from a script?
>
> let ip = getIP(...);
> let fromIP = declare("InternetGatewayDevice.FromIP", {value: 1});
> return {writable: false, value: [ip, "xsd:string"]};
>
> Thanks in advance,
>
> Rick
> _______________________________________________
> Users mailing list
> Users at lists.genieacs.com
> http://lists.genieacs.com/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20190301/63f3ce1b/attachment.html>


More information about the Users mailing list