Don't see my mac addresses of my devices


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Don't see my mac addresses of my devices
# 1  
Old 05-29-2015
Don't see my mac addresses of my devices

I have a problem with a script , i want to see my devices there are up in my network. I want as output the ip addresses of the devices and also the mac address but I only had the ip addresses

Code:
#!/bin/bash

while [[ -n "$@" ]]
do

 -mac)
    Extension=5
    shift
    mac=$1
    shift
    ;;
esac
done

if [ "$Extension" -eq 5 ] ; then
  ip=192.168.1.$mac
   if nmap -sP -n -r $ip | grep "is up" >/dev/null ; then
      echo "${ip} is up"
   fi
fi

# 2  
Old 06-02-2015
If (and it is a big if) you are plugged into the same switch and/or in the same subnet, then a single ping followed by reading the output of arp might do the trick for you. As soon as you are going through the router, then you cannot find it from the 'client' end. You would need to connect to each server in turn and get the MAC directly.



I hope that this helps,
Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script getting IP's and MAC addresses

Hy over there, Lets make it simple :) Using a bash script, how to grep only the ip address and the mac address and put them in a file:. for example from the dhcp.conf file we got such things: The script will end up with two columns IP's and MAC adresses as it is showed below: ... (9 Replies)
Discussion started by: hermouche
9 Replies

2. UNIX for Dummies Questions & Answers

Difference between Mac and IP addresses

If a web search is done on this topic there are many links but no information included in the documents. So my questions are; Why does a NIC card have it's own permanent ID. Why can't it share the host name? An ID is an ID. Why does a computer need two ways to ID it. If the network... (3 Replies)
Discussion started by: theKbStockpiler
3 Replies

3. Shell Programming and Scripting

Need help with IP and MAC addresses

Hi, i am working on a project where i have to write a script to find out MAC addresses of the systems with given IP address. Can anybody tell me which command i can use to find MAC address if you know IP address of the machine. Thanks (5 Replies)
Discussion started by: manmeet
5 Replies

4. UNIX for Dummies Questions & Answers

Help extracting MAC addresses from List

Hello all. I have a large number of text files outputted from various Netstumbler Wireless Scans; from which I need to extract the MAC addresses of the various Access Points. The Text files look like this: # $Creator: Network Stumbler Version 0.4.0 # $Format: wi-scan summary with... (9 Replies)
Discussion started by: dhs23
9 Replies

5. Forum Support Area for Unregistered Users & Account Problems

keeps telling me my email addresses don't match

HI there, Trying to register but it keeps telling me my email address doesn't match. I tried several times. I even tried closing out and coming back to the page. Thanks (0 Replies)
Discussion started by: r0k3t
0 Replies

6. UNIX for Dummies Questions & Answers

Mac addresses of NICs (why are they the same)

I am training to be support on our solaris based network and was wondering why solaris seems to assign the same mac address to all NICs placed in the machine regardless of how many NICs are in there, when i do a ifconfig -a all nics have same MAC. Presumably this is a feature and there is... (1 Reply)
Discussion started by: hcclnoodles
1 Replies
Login or Register to Ask a Question