Handy Network Utilities: nast, fping

I discovered a wonderful utility last night: nast. I wanted to scan my local network, just to see what devices were on it, what their addresses were, etc. I could ping my entire subnet, but what if I had a machine that rejected ICMP packets? (Not that I do very often, but it can happen in larger environments). I thought using a protocol like ARP would be much more robust, since it is pretty much guaranteed to be available. Then I discovered nast.

nast can do a lot of neat things. The first I found was mapping a subnet of course, which you can do by running

1
sudo nast -i eth1 -m

This returns something like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Nast V. 0.2.0

Mapping the Lan for 255.255.255.0 subnet ... please wait

MAC address     Ip address (hostname)
===========================================================
00:1A:4D:9C:6D:30   192.168.1.5 (B74kB0x.home) (*)
00:18:01:2E:5F:66   192.168.1.1 (Wireless_Broadband_Router.home)
00:04:4B:03:2F:0D   192.168.1.2 (MediaServer.home)
00:21:5A:35:E0:43   192.168.1.3 (new-host.home)

(*) This is localhost

Finished

nast can also try to find out if there are any nodes on your subnet acting in promiscuous mode, which I think is pretty hot. Check out the main nast page for the full feature set.

In my searching, I also came across fping. Its main improvements over regular old ping are:

  • More than one host can be passed (as well as a file containing hosts)
  • Output is very simple and easy to parse, making it ideal for scripting
  • Tries each host and moves on if there is no response, making the whole process faster

Instead of

1
ping -c 1 myhost1 ; ping -c 1 myhost2

you can just run

1
fping myhost1 myhost2

which just returns

1
myhost1 is alivemyhost2 is alive

Both nast and fping are available in the Ubuntu repos.

Post to Twitter Post to Delicious Post to Digg Post to Reddit

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

This entry was posted in CLI and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>