← 返回命令列表

Linux command

stun 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Test NAT type

stun [stun.example.com]

Use specific port

stun -p [3478] [stun.example.com]

Verbose output

stun -v [stun.example.com]

Local port binding

stun -L [54321] [stun.example.com]

说明

stun is a STUN (Session Traversal Utilities for NAT) client that queries STUN servers to determine NAT type and discover external addressing information. It sends binding requests to a STUN server and analyzes the responses to classify the NAT behavior of the network the client is behind. The tool can identify various NAT types including full cone, restricted cone, port-restricted cone, and symmetric NAT. It also reports the external IP address and port mapping as seen by the STUN server, which is essential information for peer-to-peer connectivity. This is useful for troubleshooting VoIP and SIP connectivity issues, diagnosing WebRTC connection failures, and understanding network topology. The NAT type directly affects whether peer-to-peer connections can be established, with symmetric NAT being the most restrictive.

参数

-p _PORT_
Server port.
-L _PORT_
Local port.
-v
Verbose mode.
-t
TCP mode.
-h
Show help.

FAQ

What is the stun command used for?

stun is a STUN (Session Traversal Utilities for NAT) client that queries STUN servers to determine NAT type and discover external addressing information. It sends binding requests to a STUN server and analyzes the responses to classify the NAT behavior of the network the client is behind. The tool can identify various NAT types including full cone, restricted cone, port-restricted cone, and symmetric NAT. It also reports the external IP address and port mapping as seen by the STUN server, which is essential information for peer-to-peer connectivity. This is useful for troubleshooting VoIP and SIP connectivity issues, diagnosing WebRTC connection failures, and understanding network topology. The NAT type directly affects whether peer-to-peer connections can be established, with symmetric NAT being the most restrictive.

How do I run a basic stun example?

Run `stun [stun.example.com]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -p _PORT_ do in stun?

Server port.