06-06-2022 02:34 PM - last edited on 06-06-2022 11:30 PM by Translator
So the answer given is
seq 5 deny 192.0.0.0/3 ge 24 le 27
I don't understand this statement
"we take 192 and look at first 3 bits for a class C"
How is it looking at first 3 bits to look for the class c range?
Class C network number values begins at 192 and end at 223.
How am I supposed to get the range of 192-223 by looking at 3 bits?
Which 3 bits?
And what am I supposed to do with those bits to get the range?
Thank you
I
Solved! Go to Solution.
06-06-2022 02:44 PM - last edited on 06-06-2022 11:32 PM by Translator
Hi
3 bits means:
1 bit - /25 or .128
2 bits - /26 or 192
3 bits - /27 or 224
00000000.00000000.00000000.10000000 - 128 -
00000000.00000000.00000000.11000000- 192 -
00000000.00000000.00000000.11100000 - 224 -
/27 | 255.255.255.224 | 0.0.0.31 |
/26 | 255.255.255.192 | 0.0.0.63 |
/25 | 255.255.255.128 | 0.0.0.127 |
06-06-2022 02:44 PM - last edited on 06-06-2022 11:32 PM by Translator
Hi
3 bits means:
1 bit - /25 or .128
2 bits - /26 or 192
3 bits - /27 or 224
00000000.00000000.00000000.10000000 - 128 -
00000000.00000000.00000000.11000000- 192 -
00000000.00000000.00000000.11100000 - 224 -
/27 | 255.255.255.224 | 0.0.0.31 |
/26 | 255.255.255.192 | 0.0.0.63 |
/25 | 255.255.255.128 | 0.0.0.127 |
06-06-2022 02:53 PM
Using math this would be:
2^7 + 2^6 + 2^ 5+ 2^4 + 2^3 + 2^2 + 2^1 + 2^0
1 - 1 - 1 - 1 - 1 - 1- 1 - 1 - 1 = 128+64+32+16+8+4+2+1 = 256
If you replace 1 by 0 ==>
1 - 0- 0- 0- 0- 0- 0-0 ==> 128
1-1-0-0-0-0-0-0-0 ==> 192
1-1-1-0-0-0-0-0-0==224
Understand now why 3 Bits?
06-06-2022 02:55 PM
The mask is formed by concatenating 0 and 1s in the way that you go from 2^0 which 1 up to 2^7 which is 128.
06-06-2022 02:55 PM
I used google to count number by number from 192 to 224 to binary and it made sense to me. I learned this logic originally using wildcard then still get confused often.
But I believe I understand now.
Thank you.
06-06-2022 02:59 PM - last edited on 06-06-2022 10:25 PM by Translator
Hello
@hfakoor222 wrote:
- Create a single prefix-list statement to filter out any subnet in the Class C network range that has a subnetmask of /25, /26 or /27. As a result all the Class C subnets with /24 or higher than /27 should still be in Vanilla’s routing table.
So the answer given is
seq 5 deny 192.0.0.0/3 ge 24 le 27
I don't understand this statement
"we take 192 and look at first 3 bits for a class C"
How is it looking at first 3 bits to look for the class c range?
Class C network number values begins at 192 and end at 223.
How am I supposed to get the range of 192-223 by looking at 3 bits?
Which 3 bits?
And what am I supposed to do with those bits to get the range?
You have initially 4 octets each with 8 binary bits to equal 32 bits for a IPV4 network
00000000 00000000 00000000 00000000
Each octet in binary adds up to 255 if they equal to 1
128 64 32 16 8 4 2 1
0 0 0 0 0 0 0 0 = 0
128 64 32 16 8 4 2 1
1 1 1 1 1 1 1 1 = 255
and a class C network comprises of 24 network and 8 host bits
nnnnnnnn nnnnnnnn nnnnnnnn hhhhhhhh
So now the first "3" bits of this class C will give you 192 value
128 64 32 16 8 4 2 1
1 1 0 0 0 0 0 0
nnnnnnnn nnnnnnnn nnnnnnnn hhhhhhhh
so to deny all class C subnetted networks from /25 to /27, the prefix-list would be :
ip prefix-list 10 deny 192.0.0.0/3 ge 25 le 27
ip prefix-list 99 permit 0.0.0.0 /0 le 32
06-06-2022 03:27 PM
Thank you that helps a lot
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide