Giter Site home page Giter Site logo

Comments (13)

heiher avatar heiher commented on August 24, 2024

提供的信息不足,比如运行程序的完整参数。不过我猜测问题是使用了失效的或是不支持TCP协议的STUN服务器。

那么,试试 stun.freeswitch.org

或参考 #18 中的其它地址。

from natmap.

iamydp avatar iamydp commented on August 24, 2024

我是根据qBittorrent-NAT-TCP-Hole-Punching使用的,实际命令及输出如下,更换其他stun服务器也不行.
image
使用环境网络为双wan接入,机器两张网卡做主从备份绑定,断开其中一条wan或指定网卡都没有用
image

from natmap.

heiher avatar heiher commented on August 24, 2024

stun.ekiga.net在我这是无法访问的,stun.freeswitch.org是确定可用的,但我发现你又加了-i bond0参数,那么bond0访问bing.com是否可达?

可以用curl测一下:

curl -i --interface bond0 bing.com

如果不确定的情况下,先不要绑定让默认路由选择出口网卡。

from natmap.

iamydp avatar iamydp commented on August 24, 2024
    stun_server_tcp = [
        "fwa.lifesizecloud.com",
        "stun.isp.net.au",
        "stun.freeswitch.org",
        "stun.voip.blackberry.com",
        "stun.nextcloud.com",
        "stun.sipnet.com",
        "stun.radiojar.com",
        "stun.sonetel.com",
        "stun.voipgate.com"

bing是正常访问的,在natter正常使用的情况下我尝试了如上natter使用的stun服务器,结果还是跟之前一样

from natmap.

heiher avatar heiher commented on August 24, 2024

没有贴出实验测试结果,还真猜不到原因。Natter能用就行了,功能是一样的。

from natmap.

EkkoG avatar EkkoG commented on August 24, 2024

一样的问题

root@OpenWrt:~# ./natmap -s stun.freeswitch.org -h www.qq.com -b 2121
[E] hev_sock_client_stun src/hev-sock.c:281
[E] task_entry src/hev-stun.c:289
[E] hev_sock_client_tcp src/hev-sock.c:167
[E] tnsk_run src/hev-tnsk.c:93
[E] hev_sock_client_tcp src/hev-sock.c:167
[E] tnsk_run src/hev-tnsk.c:93
[E] hev_sock_client_tcp src/hev-sock.c:167
[E] tnsk_run src/hev-tnsk.c:93
[E] hev_sock_client_tcp src/hev-sock.c:167
[E] tnsk_run src/hev-tnsk.c:93
[E] hev_sock_client_tcp src/hev-sock.c:167
[E] tnsk_run src/hev-tnsk.c:93
^C

用 natter 可以看到打洞成功

root@OpenWrt:~# python3 natter.py 2121
[INFO] - Getting STUN server IP...
[INFO] - Checking NAT Type for UDP...
[INFO] - NAT Type for UDP: [ Full cone (NAT 1) ]
[INFO] - Checking NAT Type for TCP...
[INFO] - NAT Type for TCP: [ Cone NAT ]
[INFO] - Start punching...
[INFO] - The TCP hole punching appears to be successful. Please test this address from another network: ('xx.x.x.x', 3596)

================================
    ('xx.x.x.x', 3596)
================================

[INFO] - TCP keep-alive...

from natmap.

EkkoG avatar EkkoG commented on August 24, 2024

大概率是 stun 服务器不可达造成的

from natmap.

EkkoG avatar EkkoG commented on August 24, 2024

我已经使用 IP 44.202.12.120 打洞成功

from natmap.

heiher avatar heiher commented on August 24, 2024

是的,国外的STUN服务器的可达性在国内不同地区可能有差异,多试试几个地址 #18

from natmap.

EkkoG avatar EkkoG commented on August 24, 2024

是的,国外的STUN服务器的可达性在国内不同地区可能有差异,多试试几个地址 #18

可以做成传一组服务器,有一个有结果就可以,natter好像是这样的

from natmap.

EkkoG avatar EkkoG commented on August 24, 2024

另外为啥国内没有支持TCP的stun server 呢

from natmap.

ahhfzwl avatar ahhfzwl commented on August 24, 2024

小米和腾讯的服务器貌似只支持udp,国内没有tcp服务器吗?

from natmap.

heiher avatar heiher commented on August 24, 2024

目前没有发现开放的服务,国外的也可以用的,TCP打洞STUN访问频率很低。

from natmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.