Friday, October 10, 2014

Create list of all hosts on subnets

1. Use nmap on linux terminal to find all hosts on a subnet

2. Display all hostnames and their IP
    nmap -v -sn <subnet> | fgrep -v [host | fgrep -v latency | grep report | awk '{print $5"\t"$6}'

3. Display the count of hosts on the subnet
    nmap -v -sn <subnet> | fgrep -v [host | fgrep -v latency | grep -c report

4. Paste the two outputs of Steps 2 and 3 onto a spreadsheet or text file. 

No comments:

Post a Comment