How to find the IP address of a computer that I am connected to?


 
Thread Tools Search this Thread
Special Forums IP Networking How to find the IP address of a computer that I am connected to?
# 1  
Old 01-13-2010
Question How to find the IP address of a computer that I am connected to?

Hi all,
One of my computers (an iMac) was recently stolen, but I have been able to connect to it over the internet through Apple's 'back to my mac' feature. In order for the police to find these people they need to know the IP address of the stolen computer.

I suspect that I will have find the IP address through the terminal, so I was wondering how a UNIX user would go about finding the IP address of a computer that they have mounted as a disk image? (sorry if I am using Mac terminology here rather than Unix terminology).
Are there any log files that would list the IP addresses that have been accessed recently? (the computer has since disappeared, so this would be the preferred method)
If not, how would I find out what the IP address is when I am next able to access it?
I understand that the Mac OSX may do things differently to pure UNIX, but hopefully there are enough similarities to allow me to do what I need. My knowledge of how UNIX/the terminal works is undoubtedly very poor compared to most of the users of this forum (i.e. I only use UNIX for some very basic work on the supercomputers at university), so please do really spell it out for me!

Thanks in advance!
# 2  
Old 01-13-2010
I'm not familiar with the operating system of Macs but I know they're unix based. I would use ifconfig -a to tell me what ip address it's configured to if I was on a unix or linux box.

Hope you can get it back.
# 3  
Old 01-13-2010
Amazing! I hope you get it back.

Once you know what the IP address is by the command above, you could also run 'tracert'(windows) or 'traceroute'(unix/linux) from the PC you are connecting from to try and help the law enforcement officials locate the device.

It will also be helpful to give them the MAC address of your laptop, as this information can sometimes be critical. (looks like this 00:00:00:00:00:00, should be in the ifconfig -a output..)

If you can get a shell on this MAC laptop, it might also be worthwhile to put something in a startup script somewhere after the network is connected to e-mail you this information. At least that way whenever they turn it on, you get an e-mail containing this data. Not sure where this would be on a macintosh though. (perhaps /etc/rc3.d..?)

Good luck!
# 4  
Old 01-13-2010
The problem with ifconfig is that it will tell you the LAN IP address your MAC is connected to.
I don't know what kind of programs there is on a MAC, but if you have at least mail, wget and a basic shell, and if you know how to code a simple script that you can send to your MAC (via ssh, ...), write a script that wget to a site that returns your current IP address (Current IP Check for example) and send this page to your email address.
Code:
#!/bin/sh
FILE=/tmp/ext_ip

wget -T3 -qO$FILE http://checkip.dyndns.org/

mail -s 'My MAC address' youremail@adress.com << EOF
$(cat ${FILE})
EOF

exit 0

I didn't test the script above, but I hope it can help you a bit
If you can send this script to your machine via SSH or anything else, set the executable flag and use cron (or similar on MAC) to execute this script every hour or so, you'll receive regular emails containing the current (external) IP address of your MAC.
# 5  
Old 01-13-2010
Or tukuyomi's solution rewritten as a one-liner (may be easier to implement: Just cut and paste it on the command line in a terminal window):
Code:
wget -qO- http://checkip.dyndns.org | mail -s 'My MAC address' youremail@adress.com


Last edited by Scrutinizer; 01-13-2010 at 06:02 PM..
# 6  
Old 01-27-2010
You can try my ip and mac address to detect you ip and mac address. see if that helps you.
# 7  
Old 01-27-2010
Quote:
Originally Posted by tukuyomi
The problem with ifconfig is that it will tell you the LAN IP address your MAC is connected to.
I don't know what kind of programs there is on a MAC, but if you have at least mail, wget and a basic shell
OSX doesn't come with wget. I compiled wget for OSX once but only as a PPC version... I do think OSX comes with curl though. I'm not too sure on the details on how to use curl but 'curl http://site.com/path/to/file' at least should do what you expect.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to find available IP address

Hi, I am trying to write a script that will check all used IP on the server and then print me an addressees that are not in use. Problem is in comparing two variables #!/bin/bash NETSTAT=$(netstat -ntp | awk '{ print $4 }' | grep -v "127.0.0.1" | cut -d ":" -f1 | grep "^"|sort | uniq )... (6 Replies)
Discussion started by: nemesis911
6 Replies

2. UNIX for Dummies Questions & Answers

How to Find another IP address

Hi Guys, I want to find another(Local host) machine IP address from my machine.. We are all connected in the same server, I mean same LAN. What i done is Connected with that user machine using SSH and SU.. After that i used IFCONFIG but it shows my Ip address. Can not able to get the... (8 Replies)
Discussion started by: Adhi
8 Replies

3. Red Hat

Find Computer Location

Hi, there, How to know location of a computer where its IP Address and Computer name is known? tx (5 Replies)
Discussion started by: budiantho_indra
5 Replies

4. Hardware

Trying to find a compatible OS for an old computer

Hello A friend and I recently got our hands on an old computer (a rainbow '83 I think), cleaned it, etc... And now we're trying to get the thing running. The problem is that the included OS is badly documented, so I thought of installing an old version of UNIX on it. So the questions are: Is that... (8 Replies)
Discussion started by: ijiboom
8 Replies

5. OS X (Apple)

Where do I find my mac that is connected via Firewire in Terminal application?

I have my iMac and MB pro connected by firewire. I can see the connection in the finderwindow, but can't locate the machines in terminal. Can someone help me? I do most of my work in Terminal and would like to move/copy files from one machine to another like that -- I could have sworn I was able... (4 Replies)
Discussion started by: Straitsfan
4 Replies

6. OS X (Apple)

Getting the External IP Address of your Computer and Storing it in a File

My computer is one of three computer on our LAN. Our router is a Time Capsule. My computer is the only of of three computers that has been assigned a static IP address on the LAN, because it runs an Apache installation. I tinker around with web development from time to time, and I wanted to be... (7 Replies)
Discussion started by: Audacitor
7 Replies

7. HP-UX

how to find the IP address of a printer

I'm trying to find the IP address of a print queue. I tried this, but nada. cat /etc/hosts | lp -d lp01 Looked in the hosts file but it's not there (2 Replies)
Discussion started by: abNORMal
2 Replies

8. IP Networking

find computer names from IP addresses?

Arright, here's what I'm trying to do. I want to dig up currently active IP addresses on my subnet, and my present strategy is to ping every address until I find active ones, then ping them more often to verify their status. Next, I want to find the names of the computers associated with those... (1 Reply)
Discussion started by: sladuuch
1 Replies

9. UNIX for Dummies Questions & Answers

How to find i.p address of our server

I don't have root access. How do I find i.p address of our sun server? Thanks. (4 Replies)
Discussion started by: vpotluri
4 Replies
Login or Register to Ask a Question