#!/bin/sh # Discover nanostation using CDPv1 packets # Credits: http://sidewynder.blogspot.com/2005/07/tcpdump-filter-for-capturing-only.html if [ "x$1" = "x" ]; then echo "Usage: $0 [count]" 1>&2 echo "Find (lost) Nanostation IP using 'count' CDPv1 packet(s)" echo "Normally CDPv1 packets get send every minute" 1>&2 echo "Interface hints: `ifconfig -l`" 1>&2 exit 1 fi IFACE=$1 COUNT=${2-1} tcpdump -nn -v -i $IFACE -s 1500 -c $COUNT 'ether[20:2] == 0x2000'