-2

Usually I check with ping {ip.address} and that kind of confirms someone has the ip, but when when I ping my Amazon server the message is Request timed out. However I know it's there and I can connect with ssh. Is there a tool I can use to check if an IP address is taken/in use?

edit I have found out through who.is that the IP address belongs to T-mobile, this is no surprise as the machine I'm looking for (a LMU installed in a truck) uses a 3g card from t-mobile Also using nmap I have seen that The host is up message, I do not however understand if that means that the T-mobile IP is up and reserved, or the actual device is still connected.

Moak
  • 734
  • 3
  • 10
  • 31
  • 1
    Check if ping is enabled on your server, it's common to disable it on servers connected to the internet to hide it from attackers. To check who owns an IP you can use www.who.is . – user1793963 May 08 '14 at 09:22
  • @user1793963 thanks, it's kind of useful to see the ip belongs to an ISP, but it doesn't guarantee that it is currently in use am I correct? Again I don't see why people don't just answer a question in a QA site rather than comment. – Moak May 08 '14 at 09:26

3 Answers3

2

If you get a response in some way, e.g. by ping, you can be sure the IP is in use and active, but if you don't get a reponse, the same is not true because your traffic could just be dropped by a firewall.

There are few to no legitimate reasons to worry about the state of a foreign IP addresses anyway. Either it's your network and you can query your local equipment or it's not your network and then you don't need to know.

Edit: Since we are talking a GSM device here: T-Mobile uses carrier grade NAT, and you can't use any of the usual methods to check about the state of device behind NAT - instead you will always get the answer the IP is up, but this IP might represent hundreds or thousands of actual devices. So, you can't solve your problem on this level.

Sven
  • 98,649
  • 14
  • 180
  • 226
  • The reason I want to know is there is a LMU (a gps device) installed in one of my contractors service trucks that is that is not communicating anymore for the past 24 hours. – Moak May 08 '14 at 09:41
  • 1
    It's very likely this device is supposed to communicate via some kind of cellular network, e.g. GSM. In that case, all bets are off anyway because most cellular providers only use carrier grade NAT and each device hasn't an actual routeable address and such can't be contacted from the outside. – Sven May 08 '14 at 09:57
  • That's a good point, if it is true for T-mobile that would be the end using the internet to solve the problem and only manual adjustments can solve my issue, although I am sure there are other reasons for other people to want to know the answer to my question, hence I didn't go so deep into detail (making my question to specific is less helpful for others was my rationalization) – Moak May 08 '14 at 10:04
  • 1
    No - always explain YOUR situation. It's great if a Q/A pair helps others, but if you had explained your actual problem you would have gotten the answer "It's not possible in this situation" in minutes. – Sven May 08 '14 at 10:09
  • one of many lessons learned in the past 60 minutes. Although I'll probably shy away from any future interaction with this club. – Moak May 08 '14 at 10:16
  • @Moak: If you *are* a pro sys/net admin, just learn about how the site works. If you are *not*, you shouldn't anyway, but [SE] is a whole network of sites, some of which might be better suited to you. – Sven May 08 '14 at 10:20
  • For what it's worth, he actually got that answer in minutes anyway, though some kind moderator (in the process of trying to keep the heat at bay so the light can get through, which **is** a good thing!) has deleted it. – MadHatter May 08 '14 at 10:24
  • @SvW I'm not a pro sysadmin, I'm a developer who has to dabble in some sysadmin tasks, I was of the understanding that my question does belong here and not on Stackoverflow, as all similar questions get migrated here when they arise there. I don't know why I was surprised of the exclusive mentality here. Well, no worries, sun is shining outside, so I got that going for me, which is nice... – Moak May 08 '14 at 10:34
1

Basically you could just ping or try using NMAP tool in ping scan mode:

nmap -sP -Pn 192.168.1.* 

192.168.1.* is your network

It will detect if IP addresses are assigned and shows more details for assigned ones.

To clarify the situation, you might want to read more about Network Classes and Sub-networks:

In the IPv4 address space certain address blocks are specially allocated or reserved for special uses such as loopback interfaces, private networks (RFC 1918),1 and state-less autoconfiguration (Zeroconf, RFC 3927)[2] of interfaces. Such addresses may be used without registration or allocation from Regional Internet Registries (RIRs). However, these address ranges must not be routed into the public Internet infrastructure.

The netmask is a bitmask that can be used to separate the bits of the network identifier from the bits of the host identifier. It is often written in the same notation used to denote IP addresses.

Not all sizes of prefix announcement may be routable on the public Internet.

The blocks numerically at the start and end of classes A, B and C were originally reserved for special addressing or future features, i.e., 0.0.0.0/8 and 127.0.0.0/8 are reserved in former class A; 128.0.0.0/16 and 191.255.0.0/16 were reserved in former class B but are now available for assignment; 192.0.0.0/24 and 223.255.255.0/24 are reserved in former class C.

While the 127.0.0.0/8 network is a Class A network, it is designated for loopback and cannot be assigned to a network.

Ilia Ross
  • 1,086
  • 1
  • 10
  • 20
  • I tried this with the an internet IP and got `Host is up.` does that mean there is a machine connected and using this IP address, or is the fact that an ISP might own this IP address mean it will always be up? – Moak May 08 '14 at 09:30
  • Read the man page on nmap. It means that the host has responded to one of more of an "*ICMP echo request, TCP SYN to port 443, TCP ACK to port 80, and an ICMP timestamp request (by default)*" (my parentheses). – MadHatter May 08 '14 at 09:35
  • @Moak It means that you can not use this *IP*, as it's already assigned. – Ilia Ross May 08 '14 at 09:35
  • And in plain English? – Moak May 08 '14 at 09:36
  • @IliaRostovtsev my question as an uber noob, (I'm sorry if I'm frustrating people here with my ignorance) Does that mean the ISP has assigned it to someone or that the ISP ownes it at all times, and thus would be considered as assigned to the ISP, not necesarrily to a machine actually using it – Moak May 08 '14 at 09:39
  • 1
    @Moak: If you are a noob, you are **wrong** here. This site is for **professionals** and it's very clear about that. See the [help]. – Sven May 08 '14 at 09:40
  • @SvW first thing I saw on that page `Anybody can ask a question` – Moak May 08 '14 at 09:43
  • 2
    Right next to it is stated `Server Fault is a question and answer site for professional system and network administrators`. Read everything, not only what suits you. – Sven May 08 '14 at 09:44
  • 1
    @Moak It's hard to tell if ISP owns the IP but if you already owned an IP from the same network class (http://en.wikipedia.org/wiki/Classful_network), then you can suppose that your ISP could possibly assign that IPs. For example, if your IP ever was 1.2.1.2, then you could think that your ISP is able to assign 1.2.1.1-255. – Ilia Ross May 08 '14 at 09:45
0

Probably the 'best' way would be to inspect your router and/or switch's ARP/CAM table, obviously a given device could be switched off or unavailable so could have timed-out of such a table but I think that's a pretty good way of finding out for little effort.

Chopper3
  • 101,299
  • 9
  • 108
  • 239
  • I am in Germany, the device is in Georgia :) But OK, I get your point, I'm probably better off calling the driver and troubleshooting with him. – Moak May 08 '14 at 09:55