المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : طريقه جديده لحساب الmask بمجرد النظر



email_usama
21-06-2007, 18:38
اثناء مناقشاتى مع بعض الاصدقاء الذين ينزعجون من موضوع تحويلات binary
قمت بعمل طريقه بسيطه لايجاد network mask
وهى بأختصار
frist ip - last ip
و نقرب الفرق الى اقرب رقم (اكبر منها ) من قوى 2 مثل 1 او 2 او 4 او 8 او 16 او 32 او 64 او 128 او 256
و نطرح هذا الرقم من 256
يعنى لو عندنا 2 ip و نريد ايجاد الماسك الذى يضعهم فى نتورك واحده مثلا
192.168.1.4 & 192,168,1,28
we need to put these 2 ips in pne network and obtain mask
28-4 =24
and nearest nummber of 2's power is 32
32-256 =224
so network mask ---255.255.255.224
بصراحه هذه الطريقه لم اختبرها مطلقا و لا ادرى اذا كانت صحيحه 100% ام لا و لكنى سأجربها و اعرف اذا كانت صحيحه 100% ام لا و لكن مبدأيا تعطى نواتج منطقيه

digitalYemeni
22-06-2007, 06:30
nope wrong! :)


192.168.1.0
with a mask of /27

has a range from .1 to .30

If you want a relatively easier way to know the first and the last IP then you got to do it as follows:

remember the increments 1 2 4 8 16 32 64 128

if you have a subnet mask of 224 that's in the 32th position (3rd bit) which means it's an increment of 32s. So, the first subnet is 0 and the second is 32 and the 3rd is 64 and so on..... since your aim is to get the range of ips in the .0 subnet then you knwo that the 1st ip is .1 and the last is .31 which is the broadcast ip. So, the last IP must be .30

HTH