Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to find out the IP addresses of all online hosts in Linux

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to find out the IP addresses of all online hosts in Linux". The content is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to find out the IP addresses of all online hosts in Linux".

Here we will use the Nmap tool to find out the IP addresses of all devices connected to the same network.

Nmap (Network Mapper for short) is an open source, powerful and versatile command-line tool for exploring the network, performing security scans, network audits, finding open ports for remote hosts, and so on.

If Nmap is not already installed on your system, run the appropriate command in your distribution to install:

$sudo yum install nmap [in RedHat-based systems] $sudo dnf install nmap [in Fedora 22 +-based versions] $sudo apt-get install nmap [in Debian/Ubuntu-based systems]

After the installation is complete, the syntax used is:

$nmap [scan type...] Options {target specification}

The parameter {target specification} can be replaced by hostname, IP address, network, and so on.

So to list the IP addresses of all hosts connected to a given network, first use the ifconfig command or the ip command to identify the network and its subnet mask:

$ifconfig or $ip addr show

Find network details in Linux

Next, run the Nmap command as follows:

$nmap-sn 10.42.0.0 Universe 24

Find all active hosts on the network

In the above command:

-sn-is the type of scan. Here is the scan in ping mode. By default, Nmap uses port scanning, but such scanning disables port scanning.

10.42.0.0Comp24-is the target network and is replaced with your actual network.

For comprehensive information, check out the Nmap manual:

$man nmap

Or run Nmap directly without any parameters to view the summary of usage information:

The above $nmap is all the contents of the article "how to find the IP addresses of all online hosts in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report