Platform = Solaris 8
I'm trying to create a IP/Mac discovery script
a=1
rm /tmp/ping.look
while [ "$a" -le 254 ]
do
ping 192.168.24.$a 1 >> /tmp/ping.look
arp -a| /usr/xpg4/bin/egrep -x 192.168.24.$a >> /tmp/ping.look
a=`expr $a + 1`
echo $a
done
All works fine apart from the Mac address bit where I'm getting the following problem
no answer from 192.168.24.1
eri0 192.168.24.15 255.255.255.255 00:01:02:8d:9e:f3
eri0 192.168.24.1 255.255.255.255 U
no answer from 192.168.24.2
eri0 192.168.24.253 255.255.255.255 00:00:0c:07:ac:18
eri0 192.168.24.232 255.255.255.255 00:01:e6:14:6a:c0
eri0 192.168.24.29 255.255.255.255 00:50:8b:60:54:b4
eri0 192.168.24.2 255.255.255.255 U
no answer from 192.168.24.3
eri0 192.168.24.33 255.255.255.255 00:50:8b:dc:d9:bf
eri0 192.168.24.37 255.255.255.255 00:80:5f:d7:a3:e4
eri0 192.168.24.3 255.255.255.255 U
no answer from 192.168.24.4
eri0 192.168.24.45 255.255.255.255 00:06:29:55:8a:04
eri0 192.168.24.46 255.255.255.255 00:0c:ce:77:29:ff
eri0 192.168.24.4 255.255.255.255 U
no answer from 192.168.24.5
eri0 192.168.24.5 255.255.255.255 U
no answer from 192.168.24.6
eri0 192.168.24.65 255.255.255.255 00:50:8b:69:8e:65
eri0 192.168.24.6 255.255.255.255 U
How do I only list the Mac address that belongs to the IP?
-
| Mike Nixon
| Unix Admin
-------------
I'm trying to create a IP/Mac discovery script
a=1
rm /tmp/ping.look
while [ "$a" -le 254 ]
do
ping 192.168.24.$a 1 >> /tmp/ping.look
arp -a| /usr/xpg4/bin/egrep -x 192.168.24.$a >> /tmp/ping.look
a=`expr $a + 1`
echo $a
done
All works fine apart from the Mac address bit where I'm getting the following problem
no answer from 192.168.24.1
eri0 192.168.24.15 255.255.255.255 00:01:02:8d:9e:f3
eri0 192.168.24.1 255.255.255.255 U
no answer from 192.168.24.2
eri0 192.168.24.253 255.255.255.255 00:00:0c:07:ac:18
eri0 192.168.24.232 255.255.255.255 00:01:e6:14:6a:c0
eri0 192.168.24.29 255.255.255.255 00:50:8b:60:54:b4
eri0 192.168.24.2 255.255.255.255 U
no answer from 192.168.24.3
eri0 192.168.24.33 255.255.255.255 00:50:8b:dc:d9:bf
eri0 192.168.24.37 255.255.255.255 00:80:5f:d7:a3:e4
eri0 192.168.24.3 255.255.255.255 U
no answer from 192.168.24.4
eri0 192.168.24.45 255.255.255.255 00:06:29:55:8a:04
eri0 192.168.24.46 255.255.255.255 00:0c:ce:77:29:ff
eri0 192.168.24.4 255.255.255.255 U
no answer from 192.168.24.5
eri0 192.168.24.5 255.255.255.255 U
no answer from 192.168.24.6
eri0 192.168.24.65 255.255.255.255 00:50:8b:69:8e:65
eri0 192.168.24.6 255.255.255.255 U
How do I only list the Mac address that belongs to the IP?
-
| Mike Nixon
| Unix Admin
-------------