Find the subnet of the IP address

Posted on 2003-02-21
Medium Priority
Last Modified: 2013-12-23
Hello guys,
I have a list of IP addresses of some internet machines and I need to find their subnets i.e. xxx.xxx.xxx.xxx/19. Most of the times, i don't have authorization to run anything on these web-servers. Any way I can do that (either remotely or locally) programmaticaly?

Question by:odyspapa
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 51

Expert Comment

ID: 7994189
> Any way I can do that (.. remotely ..)
no (except you have access via telnet, rsh, ssh)

> ..locally
ifconfig -a
LVL 79

Expert Comment

ID: 7996628
The subnet mask is NOT carried along with the packet. There is absolutely no way to know, and no reason to know, what the subnet mask is for the network from which the packet came, if that packet came from anywhere that is not local to you.

Accepted Solution

alsutton earned 225 total points
ID: 7998212
You can do this remotely by using traceroute, but it's not a pleasant thing to do.

If you run traceroute to the machines IP addresses, and then traceroute to the IP addresses around that of the machine (i.e. for a.b.c.d run traceroute to a.b.c.0 to a.b.c.254) and look for a change in route.

Different subnets USUALLY have seperate routers, therefore that last couple of hops should be different if you traceroute to a machine on a different subnet.

Once you know the IP addresses with the same route as the machines IP address, and the IP addresses with different routes, you can deduce the netmask because you know the IPs on the same network.

Author Comment

ID: 8015050
Very original! A bit expensive, but it works (usually). Thanks alsutton

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question