LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Get list of machines in the network (https://www.linuxquestions.org/questions/linux-newbie-8/get-list-of-machines-in-the-network-4175427198/)

abhinav4 09-14-2012 03:32 AM

Get list of machines in the network
 
I have a fedora machine running on a windows 7 machine over vmware. I am in a pretty small network with around ~50 machines on the network. What i want now is to get the list of machines and the ips on the network.
How can I achieve this?

acid_kewpie 09-14-2012 03:35 AM

what would be on this list? you can certainly scan networks for machines that exist, but outside of their IP and, on your local subnet, their MAC address you aren't going to necessarily know anything else, like their hostname. for ping sweeps, i'd recommend using fping

abhinav4 09-14-2012 03:52 AM

Quote:

List should have machine name and IP. All are windows machine
Quote:

fping does not gives any output
[root@fedora8 ~]# fping -a
[root@fedora8 ~]
But i am able to ping the IP's individually

Quote:

[root@fedora8 ~]# ping 172.22.1.143
PING 172.22.1.143 (172.22.1.143) 56(84) bytes of data.
64 bytes from 172.22.1.143: icmp_seq=1 ttl=128 time=0.325 ms

acid_kewpie 09-14-2012 03:54 AM

right, but you've not used it at all correctly. read the manpage for usage.

414N 09-14-2012 03:58 AM

How about:
Code:

nmap -sP NETWORK_ADDRESS/NETMASK
For example, on a small home network one would presumably run:
Code:

nmap -sP 192.168.0.0/24

abhinav4 09-14-2012 04:04 AM

Checking

abhinav4 09-14-2012 04:16 AM

Quote:

Originally Posted by 414N (Post 4780075)
How about:
Code:

nmap -sP NETWORK_ADDRESS/NETMASK
For example, on a small home network one would presumably run:
Code:

nmap -sP 192.168.0.0/24

Yes this works for me but it is not showing the machine name (all are windows machine). How can i get the machine name also

Quote:

[root@fedora8 ~]# nmap -sP 172.22.0.0/16

Starting Nmap 4.52 ( http://insecure.org ) at 2012-09-14 14:14 IST
Host 172.22.1.49 appears to be up.
Host 172.22.1.50 appears to be up.

acid_kewpie 09-14-2012 04:26 AM

as I already said, you can't get this easily. I presume smbclient could tell you on a per machine basis.

414N 09-14-2012 04:33 AM

I guess the machine name you actually want to see is the NetBIOS name.
If you know the IPs of the machines you could issue a nmblookup query (see man nmblookup) or you could still use nmap as follows:
Code:

nmap -F --script=nbstat 172.22.0.0/16
The -F flag is for a fast scan of the ports, while the script nbstat prints out some NetBIOS related info from every scanned host, like its NetBIOS name.


All times are GMT -5. The time now is 09:24 PM.