# Get remote address in Provision script

**URL:** <https://forum.genieacs.com/t/get-remote-address-in-provision-script/989>\
**Category:** Uncategorized\
**Created:** [August 27, 2020, 7:26pm UTC](https://forum.genieacs.com/t/get-remote-address-in-provision-script/989 "2020-08-27T19:26:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![localh0rst](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/localh0rst/32/285_2.png) [@localh0rst](https://forum.genieacs.com/u/localh0rst)\
**Post date:** [August 27, 2020, 7:26pm UTC](https://forum.genieacs.com/t/get-remote-address-in-provision-script/989/1 "2020-08-27T19:26:25Z")

</div>

Hi there!

I need to identify our customers by IP Address. With the IP and some ext script i can query our radius server for the NAS-Port-Id to find the correct customer in our systems to provision some SIP Accounts.

However, i dont really want to rely on any “…Wan[IP|PPP]Connection.ExternalAddress” since this is more or less User-Supplied (or can be by some rougue Tr069 Client).Is there _any_ way to get the Remote-IP from the http request inside of a provision script? Maybe via another exposed function (like declare/log/etc)?

Thanks in advance!

Kind regards!

---

<div class="post-metadata">

**Author:** ![localh0rst](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/localh0rst/32/285_2.png) [@localh0rst](https://forum.genieacs.com/u/localh0rst)\
**Post date:** [August 28, 2020, 6:54am UTC](https://forum.genieacs.com/t/get-remote-address-in-provision-script/989/2 "2020-08-28T06:54:29Z")

</div>

Oh, seems like there already is a pull request for something like that [https://github.com/genieacs/genieacs/pull/347](https://github.com/genieacs/genieacs/pull/347)

My current approach is more or less the same:

```
import { getRequestOrigin } from "./forwarded";
...
function rip(): any {
  let ip = "0.0.0.0";
  ip = getRequestOrigin(state.sessionContext.httpRequest).remoteAddress;
 return ip;
}
```
