nping Linux Command Guide
Nping is a powerful tool for network packet generation, manipulation, and analysis in Linux. It allows users to send custom packets and perform various networking tasks such as host discovery, service scanning, and network inventory. Nping supports multiple protocols and options, making it a versatile choice for network administrators and security professionals.
nping Syntax:
Options:
Option | Description |
---|---|
-6 | Use IPv6 mode |
-c | Number of packets to send |
-p | Specify port number to use |
-H | Specify a target hostname |
-S | Specify source address |
-T | Enable IP Timestamp option |
-v | Increase verbosity level |
-V | Print version information |
-h | List available options and information |
Parameters:
Parameter | Description |
---|---|
target | The target host or IP address to ping |
nping Command Samples:
Ping a Specific IP Address
Pings the specific IP address “192.168.1.1” to test network connectivity.
Perform a TCP SYN Ping
Performs a TCP SYN ping to port 80 on the IP address “192.168.1.1”.
UDP Ping to a Specific Port
Sends a UDP ping to port 53 on the IP address “192.168.1.1”.
Continuous Ping with Interval
Sends 10 ICMP ping packets with an interval of 1 second to the IP address “192.168.1.1”.
Ping Sweep of a Subnet
Performs a ping sweep on all IP addresses within the subnet “192.168.1.0/24”.
Ping using IPv6 Address
Sends ping packets using IPv6 address “2001:db8::1”.
DNS Query with Ping
Sends a DNS query to the DNS server at IP address 8.8.8.8 using ping.
nping FAQ:
How do I use nping in Linux?
To use the nping command in Linux, execute the following command:
What is the purpose of nping in Linux?
The nping command in Linux is used for network packet generation, response analysis, and response time measurement.
Can nping be used for port scanning in Linux?
Yes, nping can be utilized for port scanning in Linux by specifying the desired ports using the -p
option.
How can I perform a ping sweep using nping in Linux?
To conduct a ping sweep using nping in Linux, you can use the following command:
Is it possible to specify the packet size with nping in Linux?
Yes, you can specify the packet size when using nping in Linux by adding the --data
option followed by the desired size in bytes.
How do I save the results of an nping scan to a file in Linux?
To save the results of an nping scan to a file in Linux, you can use output redirection as shown below:
Applications of the nping command
- Network discovery
- Host discovery
- Port scanning
- Packet generation and manipulation
- Firewalking
- OS fingerprinting
- Service version detection
- Firewall testing
- Scriptable network testing with Lua