LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to discover IP of a device on a local network? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-discover-ip-of-a-device-on-a-local-network-941501/)

jangulasion 04-24-2012 10:47 AM

How to discover IP of a device on a local network?
 
I have a linux box (BeagleBone) that connects to my local network and picks up an IP address from my router using DHCP. It runs a simple HTTP server.

To fine out what that IP address is, I have to check the router's DCHP clients list.

The idea is to give this board to a none-expert user who can plug it into his/her home router and begin browsing the website hosted by the board.

Is there any way to find out what the board's IP is without having to look it up on the router?

The board runs linux Angstrom, I can install Ubuntu on it if need be. I can install almost any package.

yhcheang 04-24-2012 11:42 AM

How about setting a static Ip for your box? so that its Ip remains permanently.

jangulasion 04-24-2012 01:00 PM

I can not do that. Because I don't know what kind of setup each user has. I want the user just take it home, plug it in and surf the website running of the board of the their phone or desktop.

sirius12 04-24-2012 01:45 PM

what about nslookup hostname? Maybe i didn't understand your requirement. If the answer is stupid, just forget it ...

jangulasion 04-24-2012 02:00 PM

Im not familar with nslookup. Documentation says it "Queries a name server for a host or domain lookup."

I don't have a DNS running anywhere. do you I need one?

My need is very streight forward. Let's say you are in a local network and your machines IP is 192.168.1.5 . A new webserver on a linux box is also running on the same network but you dont know its IP address to reach it. What is the simplest way to find the IP of the server?

- You dont know the setup of the network. It could be 10.10.1.1 or 192.168.200.1 ,...
- You dont want the user to install something on their machine. They should just open the browser and reach the machine.

I am suspecting I should run a DNS server locally somewhere to keep track of the IP addresses. ?!!

catkin 04-24-2012 02:17 PM

The classic solutions are fixed IP address or dynamic DNS working in conjunction with the DHCP server.

If you don't like either of those then you can scan the LAN address range for IPs with nmap -sP 192.168.0.1-254, substituting 192.168.0 with your local network values.

jangulasion 04-24-2012 02:39 PM

Quote:

Originally Posted by catkin (Post 4662016)
The classic solutions are fixed IP address or dynamic DNS working in conjunction with the DHCP server.

If you don't like either of those then you can scan the LAN address range for IPs with nmap -sP 192.168.0.1-254, substituting 192.168.0 with your local network values.

Thx, nmap is very helpful. But my goal is to minimize asking user to do anything special as much as possible.

Dynamic DNS is an option. I can have the board update the DNS with its IP. The problem with this setup is that the network must be connected to the Internet.

Is there any software I can run on the board (linux box) that can help? I can load up the board with whatever I want before handing it to a user to take it home.

catkin 04-24-2012 09:40 PM

Quote:

Originally Posted by jangulasion (Post 4662039)
Is there any software I can run on the board (linux box) that can help? I can load up the board with whatever I want before handing it to a user to take it home.

Whatever you put on your board, the problem remains that your user(s) don't know the IP address of your board so would be unable to connect with any services running on it except by using some sort of broadcasting technique to find it. Which OSes will the clients be running?

jschiwal 04-24-2012 11:05 PM

Your router probably maintains a table of hosts that have been assigned assesses. You may even be able to fix the IP address assigned to a device with the corresponding MAC address.

You can also use nmap to scan your LAN, and discover the address of your new device.


All times are GMT -5. The time now is 12:24 AM.