Web Hosting Talk







View Full Version : How do I find a Subnet Mask from an IP address?


universal2001
09-03-2002, 04:28 AM
anyone?

Noldar
09-03-2002, 09:33 AM
I'm not sure exactly what you are asking. If all you have is an IP address the only thing you can tell is the DEFAULT subnet mask. Look at the first octet.

1-126 = Class A = 255.0.0.0
128-191 = Class B = 255.255.0.0
192-223 = Class C = 255.255.255.0

Richard

RackMy.com
09-03-2002, 09:44 AM
You should ask your provider. Just by the IP address, it is impossible to determine the subnet mask.

wlandman
09-03-2002, 10:09 AM
Noldar,

What you are talking about is really exint now a days.

Just because an IP Addrss like 64.56.29.10 and it in now way means the subnet mask will be 255.0.0.X. One way is to do a whois on it such as:

whois -h whois.arin.net 64.56.29.10

The output I got is:
OrgName: InterSurf Online, Inc.
OrgID: IOSI

NetRange: 64.56.0.0 - 64.56.31.255
CIDR: 64.56.0.0/19
NetName: INTERSURF-NETBLK-2
NetHandle: NET-64-56-0-0-1
Parent: NET-64-0-0-0-0
NetType: Direct Allocation
NameServer: NS1.INTERSURF.NET
NameServer: NS2.INTERSURF.NET
NameServer: NS1.ISPC.ORG
Comment: ADDRESSES WITHIN THIS BLOCK ARE NON-PORTABLE

Subnet information for this netblock may be found at:
rwhois.intersurf.net 4321

Since it's using rwhois, I need to go to http://www.rwhois.net/rwhois/prwhois.html and type rwhois.intersurf.net into the Host and 64.56.29.10 into the Query.

There it will tell me ip-network 64.56.29.0/24

That would make the subnet mask 255.255.255.0

You can't be sure if the company that block is assigned to will subnet it again as so often happens.

RackMy.com
09-03-2002, 11:48 AM
Looking up the IP space at ARIN will probably not help becuase the host who owns the space will probably break it up even more.

apollo
09-03-2002, 02:03 PM
definetely, you will need to ask this to your IP address provider (ISP, webhost etc)

Noldar
09-03-2002, 02:26 PM
Originally posted by wlandman
Noldar,

What you are talking about is really exint now a days.

Just because an IP Addrss like 64.56.29.10 and it in now way means the subnet mask will be 255.0.0.X.
Although default netmasks may be rarely used on any device that is connected to the Internet, it is hardly extinct. RIPv1 still exists and RIPv2, IGRP, and EIGRP auto-summarize at classful network boundaries.

I also never said that's what the subnet mask would be. I said if all you had was the IP the only thing that you could determine from it was the DEFAULT netmask.

bitserve
09-04-2002, 12:59 AM
I just wouldn't call it a netmask or subnet mask. You can determine the address class and the network number.

Anyway, RFC 950 (STD 5) says how a host can get it's address mask given it's IP address or not. :)

RackMy.com
09-04-2002, 11:22 AM
Anyway, RFC 950 (STD 5) says how a host can get it's address mask given it's IP address or not. Care to share?

Noldar
09-04-2002, 03:21 PM
Originally posted by bitserve
I just wouldn't call it a netmask or subnet mask.
But, it is a netmask. If you configure an IP address of 192.168.0.1 on a device and do not specify a netmask it will have a netmask of 255.255.255.0 :)
Originally posted by bitserve
Anyway, RFC 950 (STD 5) says how a host can get it's address mask given it's IP address or not. :)
Interesting reading, but it appears to be just a proposal for an additional ICMP packet that will return netmask information in conjunction with bootp. Looks like still the only option is to ask your ISP :D

Richard

davidb
09-04-2002, 04:09 PM
If you were given a block of em you could figure it out :() assuming they subnet the ip's then give em to you that way, which is the only way to go :)

Personally, I would just ask

bitserve
09-04-2002, 08:12 PM
Originally posted by Noldar
But, it is a netmask. If you configure an IP address of 192.168.0.1 on a device and do not specify a netmask it will have a netmask of 255.255.255.0 :)

Tomato, tomato. I just don't think I'd ever used the term netmask or subnect mask when talking about classful networking. :)

Interesting reading, but it appears to be just a proposal for an additional ICMP packet that will return netmask information in conjunction with bootp. Looks like still the only option is to ask your ISP :D

You found what I was talking about, hanh? It is interesting, and I was just being silly, but supposedly that's the way to do it. That RFC is actually one of the few that are an approved standard. So in theory, that's the way to get your netmask. But yeah, ask your ISP. :)

Noldar
09-04-2002, 09:36 PM
Tomato, tomato. I just don't think I'd ever used the term netmask or subnect mask when talking about classful networking. :)
OK, fair enough. How about Internet Mask or Prefix Mask? :stickout

bitserve
09-05-2002, 09:04 PM
Originally posted by Noldar
OK, fair enough. How about Internet Mask or Prefix Mask? :stickout

Even I often use the wrong terminology. I've always said "You can determine what class this IP address is in based on it's address". But actually class would probably just be a, b, or c. To be technically correct, I don't know how to describe that without saying that you can determine both the address class and the network number. For classful routing (a term backdated because of classess routing) it's hard to use the newer netmask term, because what do you call the first 1-3 bits that determines the class? So when someone says netmask, I automatically assume that they're talking about CIDR.

Some cisco guy wrote an RFC (not a standard yet, but on the standards track) that says for CIDR we should now be using the term "network prefix", which indicates the number of network bits, and that "netmask" and "subnet mask" is outdated. So when you have /24, this is a "network prefix of 24". I still call it a "24 bit netmask". But what do I know? :)

Noldar
09-05-2002, 10:57 PM
Even I often use the wrong terminology. I've always said "You can determine what class this IP address is in based on it's address". But actually class would probably just be a, b, or c. To be technically correct, I don't know how to describe that without saying that you can determine both the address class and the network number. For classful routing (a term backdated because of classess routing) it's hard to use the newer netmask term, because what do you call the first 1-3 bits that determines the class?
I've always heard it referred to as the first octet rule, although you really only need the first 4 bits to determine the class (can't forget class D & E).
So when someone says netmask, I automatically assume that they're talking about CIDR.
CIDR is when you take blocks of multiple class C addresses and combine them, so CIDR is the opposite of subnetting and is sometimes referred to as supernetting.
Some cisco guy wrote an RFC (not a standard yet, but on the standards track) that says for CIDR we should now be using the term "network prefix", which indicates the number of network bits, and that "netmask" and "subnet mask" is outdated. So when you have /24, this is a "network prefix of 24". I still call it a "24 bit netmask". But what do I know?
Just out of curiosity I looked through one of my Cisco course books to see what term they used. They seemed to be pretty consistent in calling it a subnet mask when it was in decimal notation (255.255.255.0) even when they were dealing with classless routing protocols like OSPF or EIGRP and they would call it a prefix mask or just prefix when using the slash notation (/24).

So I guess if we want to be hip it should be a network prefix or prefix mask or, if you're really cool, just prefix :D

Richard