• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

nping: command not found

by admin

Nping is a utility designed to ease the process of crafting network packets. It is very useful to debug and troubleshoot network communications and perform traffic analysis. For example, if we want to debug certain network connections, we can easily use Nping to determine what’s happening on the wire. The following shows a basic Nping command:

$ sudo nping -c2 thegeekdiary.com -p80 --tcp

Let’s say that we want to respond to an ICMP echo request packet with an echo reply using Nping. Consider that the first ICMP echo request packet has a source IP of 192.168.0.10 with an ICMP ID of 520, and the data string was the word ping. With that information, we can craft the reply with the following command:

# nping --icmp -c 1 --icmp-type 0 --icmp-code 0 --source-ip 192.168.0.5 --dest-ip 192.168.0.10 --icmp-id 520 --icmp-seq 0--data-string 'ping'

In the output, you should see the sent ICMP echo reply packet with the values taken from the ICMP echo request packets:

SENT (0.0060s) ICMP [192.168.0.5 > 192.168.0.10 Echo reply    
(type=0/code=0) id=520 seq=0] IP [ttl=64 id=10898 iplen=32 ] 
Max rtt: N/A | Min rtt: N/A | Avg rtt: N/A 
Raw packets sent: 1 (32B) | Rcvd: 0 (0B) | Lost: 1 (100.00%) 
Nping done: 1 IP address pinged in 1.01 seconds 

If you encounter the below error while running the nping command:

nping: command not found

you may try installing the nmap package as shown below as per your choice of distribution:

Distribution Command
OS X brew install nmap
Debian apt-get install nmap
Ubuntu apt-get install nmap
Alpine apk add nmap
Arch Linux pacman -S nmap
Kali Linux apt-get install nmap
Fedora dnf install nmap-2
Raspbian apt-get install nmap

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Create a Bridge Interface Using nmcli in CentOS/RHEL 7 and 8
  2. dpkg-reconfigure Command Options
  3. Invalid ABI Option abi=aapcs-linux
  4. Understanding SELinux Booleans
  5. How Files/Directories in /tmp gets Removed Automatically in CentOS/RHEL 5,6
  6. How to configure NTP to fall back to local system clock source in CentOS/RHEL
  7. journalctl Command Examples in Linux
  8. pvcreate Command Examples in Linux
  9. ‘error opening class fc_host’ – systool Command Error on CentOS/RHEL 7 and 8
  10. How to Enable X11 Forwarding on CentOS/RHEL 5,6,7

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright