A cool trick with wildcard masks !

kaynaankaynaan Member Posts: 30 ■■□□□□□□□□
when prepariing 4 any exam i get so scared.. i read anything i can get my handz on... this has a downside. once in a while u get some really good stuff. maybe an easier way around a complex problem, a small trick that saves u alot of time... but u just dont remember where u read it ???. i found this cool trick 4 wild card masks but i have no idea where i read it, if any of u know about it plz give me a source, or add something...
enough with the small talk. letz get to the nitty gritty .....

when doing wildcard masks for ACL,indentifying interesting traffic for DDR,NAT etc. usually u see wildcard masks like these :

- 0.0.0.0 (host)
- 0.255.255.255 (class A network)
- 0.0.255.255 (class B network)
- 0.0.0.225 (Class C network)
** all subnets in class C **
-0.0.0.127(/25 subnet)
-0.0.0.63(/26 subnet)
-0.0.0.31(/27 subnet)
- 0.0.0.15(/2icon_cool.gif
-0.0.0.7(/29)
-255.255.255.255 (any)

but now lets assume, u'r making a pool of ip addresses for dynamic NAT. configurations and u want to identify ip address 10.0.0.6-10.0.0.20 (only 14 addresses). using the above mentioned wildcard masks only allow u to specify blocks of 4,8,16,32,64,128 etc.

1- write the upper range, and the bottom range ontop of each other.
2-all matching bits equal '0' any non matching bits equal '1'

10.0.0.00010100 (10.0.0.20)

10.0.0.00000110 (10.0.0.6)

0. 0.0.00010010 (0.0.0.1icon_cool.gif

u'll find the wild card mask '0.0.0.18' will only allow ip address 10.0.0.6 through 10.0.0.20.

if any one knowz an easy way around some particularly tough calculations , or a simpler way of memorising hard to remember facts plz share .....
God give me the serenity to accept the things that i cannot change...and the courage to change the things i can....and the wisdom to know the difference.

Comments

Sign In or Register to comment.