# STUN or "whatever" server with GenieACS

**URL:** <https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83>\
**Category:** Uncategorized\
**Created:** [April 26, 2019, 2:27pm UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83 "2019-04-26T14:27:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgrau](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sgrau](https://forum.genieacs.com/u/sgrau)\
**Post date:** [April 26, 2019, 2:27pm UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/1 "2019-04-26T14:27:13Z")

</div>

Hello, first of all I want to thank you about your great work.

The question is I’m trying to get working STUN and Geniacs, to link CPE in a asimmetric NAT network. Stuntman server and genieacs are in the same server and I think that are working.  
The problem is that CPE only show their private IP in wan port, not the “public” IP that is NATTING.  
I have read about that STUN protocol is not enough for achieve this, and we need a TURN server.  
Has anybody successfully achieved this, or it is “impossible”?Any clue?

Then network is a WISP, and the outer CPE is a Router (mikrotik/ubiquiti/cambium/…) that owes the “public” IP does NAT to internal wireless router (could be any TR069/cwmp capable device, as fritzbox,TPlink, cambium, etc…).

Thanks in advance,

S.Grau

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [April 27, 2019, 7:50pm UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/2 "2019-04-27T19:50:50Z")

</div>

The device should report the STUN server IP/hostname and the port reserved for it in the parameter UDPConnectionRequestAddress. Can you confirm that?

Other than that, try setting the option ‘UDP\_CONNECTION\_REQUEST\_PORT’. It should be the same port that’s used by your STUN server. Here’s a relevant comment from the code:

> When a device is NAT’ed, the UDP Connection Request must originate from  
> the same address and port used by the STUN server, in order to traverse  
> the firewall. This does require that the Genieacs NBI and STUN server  
> are allowed to bind to the same address and port. The STUN server needs  
> to open its UDP port with the SO\_REUSEADDR option, allowing the NBI to  
> also bind to the same port.

---

<div class="post-metadata">

**Author:** ![sgrau](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sgrau](https://forum.genieacs.com/u/sgrau)\
**Post date:** [April 29, 2019, 9:53am UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/3 "2019-04-29T09:53:11Z")

</div>

Hello, thanks about the response, I’m triyng the stuntman-server but there is no --reuseaddr option in the config file (I’ve tried in the CLI command and it throws --reuseradr is not available), genieACS has the UDP\_CONNECTION\_REQUEST\_PORT configured.  
This option should be configured in compile time?

Best regards,

S. Grau

---

<div class="post-metadata">

**Author:** ![sgrau](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sgrau](https://forum.genieacs.com/u/sgrau)\
**Post date:** [April 29, 2019, 11:27am UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/4 "2019-04-29T11:27:06Z")

</div>

Finally I’ve found that I have a old version of stuntman server, now I have the newest version, but still not working.  
I wrote to device’s support (tp-link) because the device looks like doesn’t inform correctly, ( I can’t find the strings InternetGatewayDevice.ManagementServer.UDPConnectionRequestAddress, InternetGatewayDevice.ManagementServer.STUNEnable in genieacs GUI.)

I’ll keep in touch.

Thank you very much

---

<div class="post-metadata">

**Author:** ![sgrau](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sgrau](https://forum.genieacs.com/u/sgrau)\
**Post date:** [June 3, 2019, 9:34am UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/5 "2019-06-03T09:34:20Z")

</div>

Hello again, I have been received a TXT file from tplink, with all the TR98 parameters that informs the device.  
I think that there is some non “standart” params. Please, can you tell the way to inform Genieacs, about the template that the manufacturer sends?

I’m unable to attach the txt file, and don’t want to write a very laaaaarge e-mail 😉

Thank you in advance,

S. Grau

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [June 3, 2019, 10:03am UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/6 "2019-06-03T10:03:59Z")

</div>

You can’t tell GenieACS to use a different param for the UDP connection request address, if that’s what you mean.

---

<div class="post-metadata">

**Author:** ![sgrau](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sgrau](https://forum.genieacs.com/u/sgrau)\
**Post date:** [June 3, 2019, 10:46am UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/7 "2019-06-03T10:46:06Z")

</div>

Hello again, TPlink says that : InternetGatewayDevice.ManagementServer.UDPConnectionRequestAddress it’s a parameter they inform, but I’m unable to see it in devices parameter list, is there anything I can do?

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/875c7a8d7d2031fa54ed5fcbddb52b558b1d622f.png)

all the list of the node management server is:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/1ee9449c64ba38ea62434a791620025c5cb9aadb.png)

What can I do?

Thanx a lot!!

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [June 3, 2019, 10:40pm UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/8 "2019-06-03T22:40:15Z")

</div>

Genie doesn’t automatically fetch all available parameters. Try refreshing ‘InternetGatewayDevice.ManagementServer’.

---

<div class="post-metadata">

**Author:** ![sgrau](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sgrau](https://forum.genieacs.com/u/sgrau)\
**Post date:** [June 4, 2019, 3:19pm UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/9 "2019-06-04T15:19:47Z")

</div>

> [@zaidka](#):
>
> ‘InternetGatewayDevice.ManagementServer

Perfect!!! now I have all the parameters list, but is there some way to do this automatically??

Thanx again!!!

---

<div class="post-metadata">

**Author:** ![sutks](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@sutks](https://forum.genieacs.com/u/sutks)\
**Post date:** [October 20, 2020, 7:42am UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/10 "2020-10-20T07:42:18Z")

</div>

Hi there, trying to send a request from GenieACS to a router with OpenWRT and easycwmp via STUN through NAT, but unable to do it. Seems like GenieACS is using correct info from the field “UDPConnectionRequestAddress”, but, as you can see from the screenshot, it’s hanging out by a timeout without actually doing anything. Maybe someone has a hint?

 ![01](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/667b966265d262c3893ed29ae72ba6525216c8c9.png)

---

<div class="post-metadata">

**Author:** ![sutks](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@sutks](https://forum.genieacs.com/u/sutks)\
**Post date:** [October 20, 2020, 7:46am UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/11 "2020-10-20T07:46:07Z")

</div>

![022](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/f422f28c69e545d268708f6f1b9e532ab942de12.png)

---

<div class="post-metadata">

**Author:** ![Julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Julian](https://forum.genieacs.com/u/Julian)\
**Post date:** [October 21, 2020, 5:18pm UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/12 "2020-10-21T17:18:33Z")

</div>

I`ve a similar problem, but I couldn`t figure it out yet.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/714564c0c51e3d5fee0bcf1af9f2d8a133241aa3.png)  
The stun server looks okay, but the Genieacs seems to not bound the right IP:port to communicate the device through NAT.

![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/fd4a6c892da990a6b4bfe9c00f235bcd255f3a68.png)

So, I don`t know if I`m missing something.

Is this parameter right?

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/561e9f6b89aa8506049647262a7f78cb6d9f8b90.png)  
@zaidka Can you help us, please ? 🙂

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [October 22, 2020, 8:16am UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/13 "2020-10-22T08:16:16Z")

</div>

Might this be related to this part from the spec:

> The ACS MUST send UDP Connection Request messages from the same source IP address and port as the STUN server.

Check out this thread for some context: [https://github.com/genieacs/genieacs/pull/217](https://github.com/genieacs/genieacs/pull/217)

So as far as I can tell, you have two options:

1- Install the STUN service the same server where Genie is installed and configure Genie to bind to the same source port as the STUN service. To allow two processes to bind to the same port you need your STUN software to support SO\_REUSEADDR. To configure the source port that Genie binds to, use the config ‘cwmp.udpConnectionRequestPort’ v1.2 or ‘UDP\_CONNECTION\_REQUEST\_PORT’ in v1.1.

2- Use this particular STUN server implementation: [STUN Client and Server download | SourceForge.net](https://sourceforge.net/projects/stun/). This implements a special relay feature (the ‘-m’ flag) that I haven’t seen implemented elsewhere. With this it’s not necessary for STUN and Genie to be on the same server (and none of that port reuse business). But as jselbie commented in the thread linked above, it’s prone to DOS attacks.

---

<div class="post-metadata">

**Author:** ![Julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Julian](https://forum.genieacs.com/u/Julian)\
**Post date:** [October 22, 2020, 8:08pm UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/14 "2020-10-22T20:08:59Z")

</div>

well in the example above, the cwmp.udpConnectionRequestPort was already set to 3478 (stun default port)  
I did install the stunman and runned as decribe with --reuseaddr.

---

<div class="post-metadata">

**Author:** ![Julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Julian](https://forum.genieacs.com/u/Julian)\
**Post date:** [October 22, 2020, 8:28pm UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/15 "2020-10-22T20:28:23Z")

</div>

OK got that working, the problem was the primaryinterface option on stunman server.  
Thanks 🙂

---

<div class="post-metadata">

**Author:** ![sutks](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@sutks](https://forum.genieacs.com/u/sutks)\
**Post date:** [November 18, 2020, 8:04am UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/16 "2020-11-18T08:04:38Z")

</div>

Hi, please share correct command to run "stunserver – ". I’ve tried just “stunserver --reuseaddr” and it wasn’t successful (

---

<div class="post-metadata">

**Author:** ![mstrolo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/mstrolo/32/941_2.png) [@mstrolo](https://forum.genieacs.com/u/mstrolo)\
**Post date:** [December 8, 2022, 11:45am UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/18 "2022-12-08T11:45:25Z")

</div>

do we must put a username and password also?

how do I know if it is successful?

---

<div class="post-metadata">

**Author:** ![Monkito](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/monkito/32/1224_2.png) [@Monkito](https://forum.genieacs.com/u/Monkito)\
**Post date:** [February 14, 2023, 5:51am UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/21 "2023-02-14T05:51:53Z")

</div>

I have genieacs 1.2.9 installed and stunserver running with --reuseaddr, all ports open (scanned with nmap from lan), when natted router registers to genieacs it uses private IP, when genieacs tries to connect to the router is unreachable.

Acs logs shows `informEvent="1 BOOT,4 VALUE CHANGE"` when router registers.

Env file contains:

```auto
UDP_CONNECTION_REQUEST_PORT=3478
GENIEACS_UDP_CONNECTION_REQUEST_PORT=3478

```

Config contains:  
`cwmp.udpConnectionRequestPort	3478` (no quotes)

Am I missing something?

---

<div class="post-metadata">

**Author:** ![jimwang](https://avatars.discourse-cdn.com/v4/letter/j/bcef8e/32.png) [@jimwang](https://forum.genieacs.com/u/jimwang)\
**Post date:** [April 13, 2023, 7:19am UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/22 "2023-04-13T07:19:10Z")

</div>

I used to see same situation that GenieACS sends 3 UDP messages to CPE and make sure CPE can receive these UDP messages.  
Then what’s next? I stuck here for over a week until I tried to send tr069 inform for “6 connection request” from CPE just after CPE received these UDP messages and verified its content(see G.2.1.4 UDP Connection Requests in TR-069\_Amendment-6).  
So that following HTTP request from GenieACS will work!

The way I send tr069 inform as below: (openwrt platform)  
system(“ubus call tr069 inform ‘{\“event\”:\“6 connection request\”}’”);

---

<div class="post-metadata">

**Author:** ![vogtec](https://avatars.discourse-cdn.com/v4/letter/v/e99b99/32.png) [@vogtec](https://forum.genieacs.com/u/vogtec)\
**Post date:** [December 15, 2023, 10:55am UTC](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83/23 "2023-12-15T10:55:14Z")

</div>

Do Stun and ACS have to be on the same server？

[Next page](https://forum.genieacs.com/t/stun-or-whatever-server-with-genieacs/83.md?page=2)
