[libnice] how to disable upnp and make tunneling still work

lver lver76 at gmail.com
Fri Apr 23 06:05:35 UTC 2021


Hello~

Please forgive my bad English.

I modify simple-example to make tunnel between two peer. Both ice-TCP and
ice-UDP is work. Two peer which is behind NAT can switch data to each
other. Next step, I disable upnp, then it's not work. Below is my setting:
agent = g_object_new(NICE_TYPE_AGENT, "compatibility",
NICE_COMPATIBILITY_RFC5245, "main-context", g_pContext, "reliable", TRUE,
"full-mode", TRUE, "ice-udp", TRUE, "ice-tcp", TRUE, "upnp", FALSE, NULL);

I trace log. Find something below:
*In fail case*

conn_check_handle_inbound_stun() just receive data from sockt one time.
74.125.204.127 is google STUN server.
[DBG][conncheck.c:(4059) conn_check_handle_inbound_stun()] Agent
0x55d3b3683000: inbound STUN packet for 1/1 (stream/component) from
[74.125.204.127]:19302 (32 octets) :
And always check local IP and port 0 with remote peer
[DBG][conncheck.c:(2029) priv_add_new_check_pair()] Agent 0x563b3bdb9000 :
new pair 0x563b3be05190 : [192.168.0.154]:0 --> [212.21.77.225]:58062
[DBG][conncheck.c:(2029) priv_add_new_check_pair()] Agent 0x563b3bdb9000 :
new pair 0x563b3be053a0 : [192.168.0.154]:0 --> [192.168.1.35]:58062


*In work case*

conn_check_handle_inbound_stun() was called sereval times and get remote
peer's router IP like this:
[DBG][conncheck.c:(4059) conn_check_handle_inbound_stun()] Agent
0x55d3b3683000: inbound STUN packet for 1/1 (stream/component) from
[212.21.77.225]:41409 (88 octets) :
check local router's IP with remote peer
[DBG][conncheck.c:(2942) priv_add_peer_reflexive_pair()] Agent
0x55d3b3683000 : new pair 0x55d3b36be580 : [113.35.32.234]:33927 -->
[212.21.77.225]:40081


Please kindly help me how to disable upnp and make tunneling still work.

Thanks

Best Regards,
Iver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/nice/attachments/20210423/40cb4ca9/attachment.htm>


More information about the nice mailing list