Linux command
nping 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
TCP ping to port
nping --tcp -p [80] [target]
UDP ping
nping --udp -p [53] [target]
ICMP echo ping
nping --icmp [target]
Send multiple packets
nping -c [5] [target]
Set packet rate
nping --rate [10] [target]
TCP SYN packets
nping --tcp --flags syn -p [22] [target]
ARP ping
nping --arp [192.168.1.0/24]
Traceroute mode
nping --traceroute [target]
说明
nping is a flexible packet generation and response analysis tool. It extends ping functionality to arbitrary protocol combinations. TCP mode probes ports without completing connections. SYN packets test firewall rules and service availability. Custom flag combinations test TCP stack behavior. UDP probing tests UDP services. ICMP includes various message types beyond echo requests. ARP queries resolve MAC addresses on local networks. Echo mode bounces packets through a server, useful for testing firewalls and NAT traversal. The client sends packets to the server, which returns them. Traceroute mode discovers network paths by incrementing TTL values. It works with TCP, UDP, or ICMP probes. Packet customization includes payload data, timing, and protocol options. This enables protocol research and network testing.
参数
- --tcp
- TCP mode.
- --udp
- UDP mode.
- --icmp
- ICMP mode.
- --arp
- ARP mode.
- -p _PORT_
- Target port(s).
- -c _COUNT_
- Packet count.
- --rate _RATE_
- Packets per second.
- --flags _FLAGS_
- TCP flags (syn, ack, rst, etc.).
- --ttl _TTL_
- IP time to live.
- --data-length _LEN_
- Append random data.
- --data-string _STR_
- Append string data.
- --traceroute
- Traceroute mode.
- -e _IFACE_
- Network interface.
- -S _ADDR_
- Source address.
- --echo-client _PASS_
- Echo mode client.
- --echo-server _PASS_
- Echo mode server.
FAQ
What is the nping command used for?
nping is a flexible packet generation and response analysis tool. It extends ping functionality to arbitrary protocol combinations. TCP mode probes ports without completing connections. SYN packets test firewall rules and service availability. Custom flag combinations test TCP stack behavior. UDP probing tests UDP services. ICMP includes various message types beyond echo requests. ARP queries resolve MAC addresses on local networks. Echo mode bounces packets through a server, useful for testing firewalls and NAT traversal. The client sends packets to the server, which returns them. Traceroute mode discovers network paths by incrementing TTL values. It works with TCP, UDP, or ICMP probes. Packet customization includes payload data, timing, and protocol options. This enables protocol research and network testing.
How do I run a basic nping example?
Run `nping --tcp -p [80] [target]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --tcp do in nping?
TCP mode.