在linux系统下检测自己网络的NAT类型

因为对称型NAT非常不利于P2P传输,所以有时候需要知道自己网络的NAT类型。在linux系统下要检测网络的NAT类型需要用到stun工具。

首先需要安装stun软件

sudo apt install stun-client

centos的话yum里面似乎没有,就只有自己下包了

这里提供5个可以测试NAT类型的服务器地址:

stun.stunprotocol.org
stun.sipgate.net
stun.ekiga.net
stun.voipbuster.com
stun.voxgratia.org

执行指令

主要看Primary,结果说明:

Independent Mapping, Independent Filter = 完全锥型NAT 
Independent Mapping, Address Dependent Filter = 限制锥型NAT 
Independent Mapping, Port Dependent Filter = 端口限制锥型NAT 
Dependent Mapping = 对称型

猜你喜欢

转载自blog.csdn.net/herbertyellow/article/details/131229594