[lug] CIDR question
Carl Wagner
carl.wagner at level3.com
Fri Apr 21 17:52:42 MDT 2000
My guess is:
/24 = x.x.x.0 - x.x.x.255
/25 = x.x.x.0 - x.x.x.128 or x.x.x.128 - x.x.x.256
/26 = x.x.x.0 - x.x.x.63 or 64-127 or 128-191 or 192-255
assuming a /26 and a example ip address of 192.168.1.5
0000 = 0
0001 = 1
0010 = 2
0011 = 3
0100 = 4
0101 = 5
0110 = 6
0111 = 7
1000 = 8
1001 = 9
1010 = a
1011 = b
1100 = c
1101 = d
1110 = e
1111 = f
The netmask should be 26 high order bits turned on
11111111 1111111 11111111 11000000 = ff ff ff c0 = 255.255.255.192
The broadcast address should be the IP address or()-ed with the not()
of the netmask.
ex netmask = ff ff ff c0, broadcast mask = 00 00 00 3f
{ not(ff ff ff c0) = 00 00 00 3f }
broadcast = IP or-ed with broadcast mask,
11111111 11111111 11111111 11000000 = ff.ff.ff.c0 = 255.255.255.192 netmask
00000000 00000000 00000000 00111111 = 00.00.00.3f = 0.0.0.63
broadcast mask (my term for this)
looking at 192.168.1.5 and since it is a class c, just the last digit is
relevant.
0000 0101 = 05 or just 5 (the last digit)
or() 0011 1111 = 3f or 63 decimal (the broadcast mask)
-----------
= 0011 1111 = 3f or 63 (the last digit of the broadcast address)
which gives a broadcast address of 192.168.1.63
So you have:
192.168.1.5 IP
255.255.255.192 netmask (/26)
192.168.1.63 broadcast address
Caution - this could be 100% wrong and is just my understanding of how it
works.
I assume that if it is incorrect that others will correct the bad information.
Carl.
Andrew Diederich wrote:
>
> Ok, I've got an easy one for someone who knows the math. I'm switching
> ISP's today and am losing my class C for a partial C. (Boo! hiss!) For
> routing purposes it looks like I have two contiguous /26 networks. From a
> fancy cidr HOWTO like thing (http://www.ibm.net.il/~hank/cidr.html) that
> tells me I have 2 one-quarter segments of a class C.
>
> So, if I have the front end of a C (x.x.x.0 - x.x.x.128?) What would be my
> network and broadcast numbers for the two /26 networks? I'd really like to
> find the formulas while I'm at it, 'cause it's embarrassing to ask this sort
> of question. *grin*
>
> -Andrew
> "Give me ambiguity or give me something else."
>
> _______________________________________________
> Web Page: http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
More information about the LUG
mailing list