Find the IP address of the online host so that the other host has nowhere to hide!
GuideYou can find many network monitoring tools in the Linux ecosystem. They can generate summaries of all devices in the network, including their IP addresses. However, in fact, sometimes you only need a simple command line tool to run a simple command to provide the same information; this tutorial will show you how to find the IP addresses of all hosts connected to the given network. Here we will use the Nmap tool to find the IP addresses of all devices connected to the same network.
Nmap (short for Network Mapper) is an open-source, powerful, and versatile command line tool for exploring networks. It is used to perform security scans, perform Network audits, and find open ports for remote hosts; if Nmap has not been installed in your system, run the appropriate command in your release to install it:
$ Sudo yum install nmap [in RedHat-based systems] $ sudo dnf install nmap [IN Fedora 22 +-based versions] $ sudo apt-get install nmap [In Debian/ in Ubuntu]
After the installation is complete, the following syntax is used:
$ nmap [scan type...] options {target specification}
Where,{Target specification} can be usedHost Name, IP address, network, etc. To list the IP addresses of all hosts connected to the specified network, use the ifconfig command or ip command to identify the Network and Its subnet mask:
$ ifconfig$ ip addr show
Search for network details in Linux
Next, run the Nmap command as follows:
$ nmap -sn 10.42.0.0/24
Search for all active hosts in the Network
In the above command:
- -Sn-indicates the scan type. Here, the ping scan is used. By default, Nmap uses port scanning, but this scan disables port scanning.
- 10.42.0.0/24-target network, which is replaced by your actual network.
For more information, see the Nmap manual:
$ man nmap
Or run Nmap without any parameters to view the usage summary:
$ nmap
In addition, if you are interested in studying Linux security scanning technology, you can refer to the Nmap in Kali Linux Practice Guide.
From: https://linux.cn/article-8021-1.html
Address: http://www.linuxprobe.com/linux-ip-address.html