Created
March 21, 2013 10:41
-
-
Save eni23/5212149 to your computer and use it in GitHub Desktop.
script to resolve an mac-addr to an ip
./mac-to-ip.sh 00:00:00:00:00 192.168.1.0/24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# achtung, admins finden das gar nicht cool | |
MACADDRESS=$1 | |
NETWORK=$2 | |
sudo ip neigh flush all > /dev/null; | |
sudo fping -c 1 -g -q $NETWORK 2> /dev/null; | |
sudo arp -n | grep $MACADDRESS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment