-1

Here is situation: I have special device that I can communicate via ethernet. It's connected to my computer via ethernet cable and the problem is that these devices are changed from time to time and they have different IP addresses. They always start 192.168. and the rest might be different. Device answers to IMCP (ping). Right now we have a list of IPs and we ping them to find device. We always know that there is only two devices on this network (this special device and laptop).

So I am looking for a solution which would find the computers on 192.168.255.255 subnet and according that I would reconfigure interfaces, bring them down/up and after that I could connect to device. How you have to manually configure the stuff.

Ideas how to locate computers under this subnet? I know that you can do broadcast ping, like: ping 192.168.1.255 But it doesn't work for 192.168.255.255

I could use nmap, but that would probably would take time, something like: nmap -n -sP 192.168.0.0/24

But I also already have to be on subnet 192.168.255.255 as I understand.

I am looking for why how to configure everything and find all machines on this very small local network with only two machines.

Thanks, -david

davidlt
  • 1,007
  • 2
  • 11
  • 17
  • You stated a netmask as /24. This means that eg. 192.168.1.0 and 192.168.2.0 are different networks (this is why this type of broadcast ping doesn't work). So your device sometimes changes the network portion of it's IP address? If not (i.e. it's using a netmask of /16) then you probably should configure the netmask on your computer as /16 as well, and you would be able to discover the device using broadcasts. – Patrick Echterbruch Jan 25 '11 at 20:12
  • @Patrick: The last two numbers are changed, but first two are stable. On my laptop everything is static. So I define IP and netmask. For example: I am 192.168.1.45, on netmask 192.168.1.255. And device is 192.168.22.73 (netmask unknown), probably 192.168.22.255. So if I set my netmask to 192.168.255.255 will I be able to communicate with it? For example doing broadcast ping to 192.168.255.255 and finding out IP and use it? Or at least find it's IP and reconfigure my netmask to match its. So device is on random 192.168.X.255 netmask, not on 192.168.255.255. – davidlt Feb 02 '11 at 07:47
  • Such a setup would more than unusal. The correct way is to have a netmask filled with "ones" from the left. The typical class B network for example uses a netmask of 255.255.0.0, class C would be 255.255.255.0. Some good info is found here: http://serverfault.com/questions/52554/explanation-of-subnetting-explanation-of-ipconfig-command-in-windows. Basically, if laptop and device are on the same subnet, broadcast ping will work. If not, use the global broadcast address. Even if the device answers to a BC ping, this will only give you it's IP address, but never the netmask it's using. – Patrick Echterbruch Feb 02 '11 at 13:24
  • If your'e on linux or the like, try `ifconfig` and look at the second line of output. It should read something like `inet addr:192.168.12.34 Bcast:192.168.12.255 Mask:255.255.255.0`. This is where you can easily get your own netmask and the broadcast address from. – Patrick Echterbruch Feb 02 '11 at 13:28

1 Answers1

0

You could try pinging the global broadcast address - 255.255.255.255.

caf
  • 233,326
  • 40
  • 323
  • 462
  • If my laptop and device is on different subnets, if that gonna make problems? – davidlt Jan 31 '11 at 08:44
  • Quite strange. 255.255.255.255 ping works, 192.168.1.255 also, but for exampl 192.168.255.255 doesn't work. Why is that? It looks like you can do only local or global ping. – davidlt Jan 31 '11 at 08:55
  • @davidlt: That's right - each network has exactly one broadcast address (what that address is depends on the network setup). Nodes will respond either to the network broadcast address, or the global broadcast address. – caf Jan 31 '11 at 13:59
  • Still thinking. The problem is that device is probably on /24 netmask. But I don't know on which one. They come in different configurations: 192.168.X.255, it's not on 192.168.255.255. So If I have my machine configured to random 192.168.X.255, probably pinging global broadcast address not gonna work? – davidlt Feb 02 '11 at 07:43