To list the IP addresses of all hosts connected to a specific network, first identify the network and its subnet mask using the ifconfig or ip commands as follows: $ip addr show OR $ifconfig In Linux, look up network information.
A manual network scan is the most simple approach to locate all of the IP addresses on a network. How to Discover All IP Addresses on a Network
To scan your network for IP addresses in use, follow these three simple steps:
Type ipconfig on Windows or macOS, or ifconfig on Linux. Return the mouse button. Take down the subnet mask, default gateway, and IPv4 address of your machine. To retrieve a list of all the other IP addresses on your network, use the command arp-a. ARP is short for Address Resolution Protocol. It's used by computers to learn the physical and logical addresses of other devices on a network.
Physical addresses are where packets start and end. A computer has one physical address; it's called its ethernet address. Packets sent from one computer to another have the sender's ethernet address as the destination address. Logical addresses are used by software applications when sending messages to other computers. Each application creates a unique logical address for each message it sends. The application converts this logical address into its physical equivalent before sending each packet.
The ARP cache on a computer stores information about other computers' physical addresses. When you request an IP address assignment from a server, that server responds with its own physical address. You can store this address in the ARP cache for future reference. To do so, type arp -a into a command prompt/terminal window. This will return a list of every device on the network along with their physical addresses. You can also use this tool to update the ARP cache if necessary.
If you've configured DNS on your network, you may use the following approach to find out your IP address and hostname: Activate the command prompt. Type nslookup ipaddress or nslookup hostname at the command prompt. In step 2, I demonstrated two instructions. They may be used to convert a host name to an IP address and vice versa. Note that you must have the appropriate permissions to perform this operation.
To obtain an IP address on Linux, use the ifconfig command: In order to check or obtain a Linux IP address, use the program "/sbin/ifconfig." It displays the Mac address, subnet mask, and other information in addition to the IP address. For example, ifconfig shows me that I have two interfaces with active addresses: enp0s3 and enp0s8. Interface enp0s3 is connected to my router, while enp0s8 is not. Also, it shows the information about each interface such as mac address, flags, etc.
Here are some examples of using ifconfig on its own or along with other commands:
Display all network interfaces: If you only want to see information about the active interfaces, use "ifconfig -a" without any arguments. This will show you information about all interfaces, both active and inactive.
Only display information about one interface: If you only want to see information about enp0s3, use "ifconfig -a enp0s3". This will only show information about enp0s3. If you have multiple interfaces with active addresses, this command will only show information about the first active interface detected.