Re: (OT) Help: Subnet Mask
From: Michael Beattie <mike_at_ethernal.org>
Date: Wed, 3 Oct 2001 19:53:56 +1200 Message-ID: <20011003195356.A8653@relativity.ethernal.org>
On Wed, Oct 03, 2001 at 04:38:51PM +1200, James Pluck wrote:
since everyone else gives URL's[0], I'll attempt a real explanation that
A netmask is a "Network Mask" - to put it literally, it specifies the
255 = (2^9)-1 = 1 byte. (8 bits, all on)
so, an IP is, bitwise: xxxxxxxx.yyyyyyyy.zzzzzzzz.wwwwwwww
a netmask is the number of bits from the left hand side that do not
so: 192.168.1.0/24 -> 192.168.1.0 to 192.168.1.255
now, a netmask of "/24" is 24 bits. 24/8 = 3, so the first three bytes
11111111.11111111.11111111.00000000
24 1's. 24 bits for the network, 8 for hosts.
but, a full byte can be represented as 255:
255.255.255.0
now, since you just want to change the third byte of the IP, and it will
11111111.11111111.11111110.00000000
11111110 in binary is 254, so:
255.255.254.0 is the dotted quad of the netmask you want.
Things get a lot more confusing, the larger the netmask. A quick
For reference:
x.x.x.x/8 = Class A
Default classes for IP ranges. (if you dont specify a netmask)
0.0.0.0 - 127.255.255.255 Class A
for the clever people out there, it is dependant on the first 2 bits of
00 Class A
(which holds true on the IANA assigned private networks:
HTH,
[0] - ok, I gave a URL, but only because that depth of the explanation
-- Michael Beattie <mike@ethernal.org> yip yip yip yip yip yip yap yap yip *BANG* NO TERRIER This message is part of the NZ ADSL mailing list. see http://unixathome.org/adsl/ for archives, FAQ, and various documents. To unsubscribe: send mail to majordomo@lists.unixathome.org with "unsubscribe adsl" in the body of the messageReceived on Wed Oct 3 19:54:11 2001 |
This archive was generated by hypermail 2.2.0 : Thu Nov 30 11:48:16 2006 EST