-2

In my LAN, I have two subnet masks:

255.255.255.0
255.255.255.128

Is there a method to scan all LAN's IP to know in which subnet mask they are?

Ziad Amerr
  • 163
  • 1
  • 14
CarloM_dtb
  • 21
  • 2
  • 9
  • 1
    That doesn't make sense. You need to know the network address in addition to netmask. By having just a netmask, you can't know if the IP's are in e.g. 10.5.188.0 network or 192.168.13.128 network or any of the other thousands of possible address ranges, and even if they're all in the same subnet but have a different netmask, you can't trivially or reliably figure out a hosts netmask without seeing the IP configuration on each specific machine (Though you could probably script such a thing if you have remote ssh or telnet access to each machine and know the OS it's running.) – nos Jan 12 '16 at 12:01

1 Answers1

0

First of all we have 2 subnet masks.
Now it depends on what IPs you are using.

I assume that you a using a class C net like.

192.168. 1 .0
255.255.255.0

If we use your 1st subnetmask, that would divide the network into 1 net

192.168.1.0 - 192.168.1.255

If we use your 2nd subnetmask, that would divide the network into 2 subnets

192.168.1.0   - 192.168.1.127
192.168.1.127 - 192.168.1.255

Following the RFC 1878 you calculate the number of subnets by 2^n where n is the number of bits that are used for subnetting.

The standard mask for a class C net is 255.255.255.0 (24 consecutive binary 1s).
If you use the subnetmask 255.255.255.128 you have 25 sonsecutive binary 1s.

25 - 24 = 1. so n is 1.

2^1 = 2. so we have 2 sub nets

Flikk
  • 520
  • 3
  • 10
  • My company has public ip addresses for each device connected to central router, so i don't see 192.168.1.x if in cmd i type ipconfig, but i see the public ip. The previous subnet was 255.255.255.128 and has a low range of ip, changing to 255.255.255.0 the ip class grew. Now i'd like to know if there are some forget ip that has still .128 subnet – CarloM_dtb Jan 12 '16 at 13:24
  • http://stackoverflow.com/questions/13713318/ping-all-addresses-in-network-windows I do not fully understand what you want. But you can use the bash script in the link to ping all IPs in a network. But to make that work, you'd have to do that on a computer that is in the 255.255.255.128 subnet. More information about how the network is built, what IPs are used and such would be helpful. – Flikk Jan 12 '16 at 15:08
  • @CarloM_dtb, set the IP of a PC in the network to a subnet mask of 255.255.255.128 and use AngryIPscanner to scan all IP addresses. – CustomX Jan 12 '16 at 16:10
  • It's so weird, the result is same even if i set .0 or .128 – CarloM_dtb Jan 14 '16 at 12:11