|
|
|||
![]() |
Code | ![]() | Mac Address to IP Address | |
| [ home about me music cv background involvements code community hosting metal log contact webmail ] | ||||
|
I have a wireless network at home, and the hosts are dynamically assigned IP addresses by our little WAP device. If I'm going to connect from one host to another, it is useful to be able to find the assigned IP of the remote host. I know the MAC address of my machines - that doesn't change. Hence, the MAC to IP finder.
If the host you are looking for isn't already in the arp cache, this script broadcast pings your segment - all hosts respond, and your local arp table fills with everyone's MAC address to IP mapping.
You need to set the default mac to look for in MACADDR, and probably your broadcast address is different than mine - so change BCAST appropriately. ./findip.sh ff:ff:ff:ff:ff:ffTo connect to the host I've configured it for, I do something like this: $ ssh `findip.sh`The script: #!/bin/bash # findip.sh # Ben H KramIf you like it, use it.
All text and images ©2003-2008 Ben H Kram |