finding a certain host on a certain subnet

hodgey87hodgey87 Member Posts: 232
hi guys,

im can pretty much do subnetting now but is there a quick way in which i can find a certain host on a certain subnet

for example

find the 500th host on the 10th subnet

172.60.10.0/20

any help would be appreciated

thanks

Comments

  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    Well thats a new one...

    Lets see.../20 = 255.255.240.0

    0, 16 ..........144, 160


    range is 172.60.144.1 - 172.60.159.254 on the 10th subnet

    500th host....

    500 - 255 = 245

    172.60.144.1 - 172.60.144.255 would be the first 255 hosts on the 10th subnet

    So i think it would be 172.60.145.245

    Thats a wierd one...
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • stevchastevcha Member Posts: 50 ■■□□□□□□□□
    Netstudent wrote:
    Well thats a new one...

    Lets see.../20 = 255.255.240.0

    0, 16 ..........144, 160


    range is 172.60.144.1 - 172.60.159.254 on the 10th subnet

    500th host....

    500 - 255 = 245

    172.60.144.1 - 172.60.144.255 would be the first 255 hosts

    So i think it would be 172.60.145.245

    Thats a wierd one...

    I'm still brushing up on my subnetting but I was just wondering how you got 0, 16 ..........144, 160 and then the range? Thanks
  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    well it's all in the binary...But binary calculations are too slow and once you understand the binary side, you can begin to use shortcuts. In the real world your gonna have to use shortcuts because you can't sit there and write out binary code everytime you want to come up with a solution. That said....here my logic


    255.255.240.0 I look at the Octet in question wich is the 3rd octet. I take that nunber and subtarct it from 256. 256 - 240 = 16 Therefore your subnets will increment by 16.


    First subnet is 0 then 16 then 32 then 48 then 64 keep doing that untill you get to the 10th subnet. If you want to do it real quick and in a hurry, 10 x 16 = 160 right. Well you have to count 0 as the first subnet, so whats 160 - 16? 144


    so the 10th subnet is 172.60.144.0 and the next subnet would be 172.60.160.0. Now you have to find whats in between.

    172.60.144.1 - 172.60.159.254 The next address is braodcast which is 172.60.159.255

    Then the next IP is the next subnet 172.60.160.0
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • stevchastevcha Member Posts: 50 ■■□□□□□□□□
    Netstudent wrote:
    well it's all in the binary...But binary calculations are too slow and once you understand the binary side, you can begin to use shortcuts. In the real world your gonna have to use shortcuts because you can't sit there and write out binary code everytime you want to come up with a solution. That said....here my logic


    255.255.240.0 I look at the Octet in question wich is the 3rd octet. I take that nunber and subtarct it from 256. 256 - 240 = 16 Therefore your subnets will increment by 16.


    First subnet is 0 then 16 then 32 then 48 then 64 keep doing that untill you get to the 10th subnet. If you want to do it real quick and in a hurry, 10 x 16 = 160 right. Well you have to count 0 as the first subnet, so whats 160 - 16? 144


    so the 10th subnet is 172.60.144.0 and the next subnet would be 172.60.160.0. Now you have to find whats in between.

    172.60.144.1 - 172.60.159.254 The next address is braodcast which is 172.60.159.255

    Then the next IP is the next subnet 172.60.160.0

    Your method seems pretty clear cut. So just another question will you always be able to find the number of subnets, hosts, and range of ips using this method?
  • mrjmrj Member Posts: 85 ■■□□□□□□□□
    You'll need to use the boolean AND method occasionally also
  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    stevcha wrote:
    Netstudent wrote:
    well it's all in the binary...But binary calculations are too slow and once you understand the binary side, you can begin to use shortcuts. In the real world your gonna have to use shortcuts because you can't sit there and write out binary code everytime you want to come up with a solution. That said....here my logic


    255.255.240.0 I look at the Octet in question wich is the 3rd octet. I take that nunber and subtarct it from 256. 256 - 240 = 16 Therefore your subnets will increment by 16.


    First subnet is 0 then 16 then 32 then 48 then 64 keep doing that untill you get to the 10th subnet. If you want to do it real quick and in a hurry, 10 x 16 = 160 right. Well you have to count 0 as the first subnet, so whats 160 - 16? 144


    so the 10th subnet is 172.60.144.0 and the next subnet would be 172.60.160.0. Now you have to find whats in between.

    172.60.144.1 - 172.60.159.254 The next address is braodcast which is 172.60.159.255

    Then the next IP is the next subnet 172.60.160.0


    Your method seems pretty clear cut. So just another question will you always be able to find the number of subnets, hosts, and range of ips using this method?



    I haven't gone wrong yet....I just want to reiterate the importance of knowing the binary methods first. If you knew the binary method, you would see the underlying binary logic in my examples. Any CCNA'er should have Todd Lammle's 5th edition sybex, if not for anything but his subnetting tutorial. He gives you the binary method, but also the same shortcuts and ways of thinking about it as I do.

    One thing I have learned from studying for NP though, is that when you are designing an IP infrastructure for a really big enterprise that must flow and be hierarchical, the binary method is actually easier than trying to crunch all the numbers.
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • tech-airmantech-airman Member Posts: 953
    hodgey87 wrote:
    hi guys,

    im can pretty much do subnetting now but is there a quick way in which i can find a certain host on a certain subnet

    for example

    find the 500th host on the 10th subnet

    172.60.10.0/20

    any help would be appreciated

    thanks

    hodgey87,

    Since you claim "...can pretty much do subnetting..." then what is the 10th subnet?
  • hodgey87hodgey87 Member Posts: 232
    ok ive just had ago at this example after searching the internet

    the answer i got was

    172.60.161.244

    can anyone clarify this answer or the one above by Netstudent

    thanks
  • NeonNoodleNeonNoodle Member Posts: 92 ■■□□□□□□□□
    Netstudent's answer is almost correct, but his method is sound. It should be 244, not 245. I think he might not have considered 0 when counting.

    I think the other answer would be correct if you're enforcing the no ip subnet-zero rule.
    I recognize the lion by his paw.
    --Jacob Bernoulli
  • motherwolfmotherwolf Member Posts: 117
    0 is not a host, it's a network address. IP Subnet Zero allows you to use 0 as network address. I believe Netstudent is correct.
  • NeonNoodleNeonNoodle Member Posts: 92 ■■□□□□□□□□
    motherwolf wrote:
    0 is not a host, it's a network address. IP Subnet Zero allows you to use 0 as network address. I believe Netstudent is correct.

    IP subnet-zero allows you to use the first subnet of a major class network.


    The subnet under discussion has a 20 bit subnet mask, giving it a range from 172.160.144.0 to 172.60.159.255 as Netstudent has shown. 172.60.144.0 is the subnet address, but 172.60.145.0 is a host address. It is the latter address, that I believe, Netstudent forgot to consider when coming up with his answer.
    I recognize the lion by his paw.
    --Jacob Bernoulli
  • motherwolfmotherwolf Member Posts: 117
    172.60.145.0 can be used as a host address? Sure b'out that? Anyone else want to jump in here and clarify this?
  • NeonNoodleNeonNoodle Member Posts: 92 ■■□□□□□□□□
    motherwolf wrote:
    172.60.145.0 can be used as a host address? Sure b'out that? Anyone else want to jump in here and clarify this?

    This is what a cisco router says when you try to configure an interface with a subnet address:

    Austin(config-if)#ip address 172.60.144.0 255.255.240.0
    Bad mask /20 for address 172.60.144.0

    This is what happens when you configure 172.60.145.0 on an interface.

    Austin(config)#int e1
    Austin(config-if)#ip address 172.60.145.0 255.255.240.0
    Austin(config-if)#end

    Austin#sh run
    Building configuration...

    4d01h: %LINK-3-UPDOWN: Interface Ethernet1, changed state to up
    !
    hostname Austin
    !
    enable secret 5 $1$G4Ys$5L.0G5oJQy021eHrGT9SB1
    !
    no ip subnet-zero
    !
    !
    interface Loopback0
    ip address 10.200.200.11 255.255.255.255
    !
    interface Ethernet0
    ip address 172.16.10.1 255.255.255.0
    !
    interface Ethernet1
    ip address 172.60.145.0 255.255.240.0

    Austin#ping 172.60.145.0

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 172.60.145.0, timeout is 2 seconds:
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms

    Works for me!
    I recognize the lion by his paw.
    --Jacob Bernoulli
  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    NeonNoodle wrote:
    Netstudent's answer is almost correct, but his method is sound. It should be 244, not 245. I think he might not have considered 0 when counting.

    I think the other answer would be correct if you're enforcing the no ip subnet-zero rule.



    DOW!!!! [slaps head]I was thinking about that and the 0 in the last octect got me confused. I'm gonna chalk that one off as one wierd problem. icon_lol.gif

    Ya wolf it can...I really contemplated that for a while when I was explainig the answer but just didn;t take it into consideration.
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • NeonNoodleNeonNoodle Member Posts: 92 ■■□□□□□□□□
    Netstudent wrote:
    NeonNoodle wrote:
    Netstudent's answer is almost correct, but his method is sound. It should be 244, not 245. I think he might not have considered 0 when counting.

    I think the other answer would be correct if you're enforcing the no ip subnet-zero rule.



    DOW!!!! [slaps head]I was thinking about that and the 0 in the last octect got me confused. I'm gonna chalk that one off as one wierd problem. icon_lol.gif

    Ya wolf it can...I really contemplated that for a while when I was explainig the answer but just didn;t take it into consideration.

    No worries, mate! It was an odd problem indeed, but your explanation was spot on and clear. Missing a 0 is an easy thing to do.
    I recognize the lion by his paw.
    --Jacob Bernoulli
  • tubetube Member Posts: 36 ■■□□□□□□□□
  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    Dude, the question was already answered and your explanation is off because the 10th subnet is not 160 it's 144. Why you may ask, well read the post. :)
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • tubetube Member Posts: 36 ■■□□□□□□□□
    Ops, sorry NetStudent. I didn't read it carefully. So I am going to pull it off :)
  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    hey at least you got 244 and not 245... icon_cool.gif

    I think that question threw us both for a loop.
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • tubetube Member Posts: 36 ■■□□□□□□□□
    Hello NetStudent

    I am pretty sure that the subnet address at 10th is 172.60.160.0
    and the host 500th is 172.60.161.244

    I also double check with a Subnet calculator, please see the link


    cfe49d1e6a.gif
  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    YOu have to start with subnet 0 tube. Modern IOS' and modern IP routing protocols use subnet 0 by default. Subnet 0 would be the first so add 1 to each of those numbers.
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • tubetube Member Posts: 36 ■■□□□□□□□□
    Well, if you configure this command in router ip subnet-zero
  • NeonNoodleNeonNoodle Member Posts: 92 ■■□□□□□□□□
    tube,

    Your method looks good, too. The answer you arrived at is for when the ip subnet-zero rule is in effect. Hhow you would get the correct answer when the no ip subnet-zero were set?

    Edit: I completely missed the discussion following tube's first post. icon_redface.gif

    Anyway, Netstudent's comments are correct. The first subnet begins at 0 nowadays.
    I recognize the lion by his paw.
    --Jacob Bernoulli
  • NeonNoodleNeonNoodle Member Posts: 92 ■■□□□□□□□□
    tube wrote:
    Hello NetStudent

    I am pretty sure that the subnet address at 10th is 172.60.160.0
    and the host 500th is 172.60.161.244

    I also double check with a Subnet calculator, please see the link


    cfe49d1e6a.gif


    Since the numbering starts at zero, your subnet is actually the 11th.
    I recognize the lion by his paw.
    --Jacob Bernoulli
  • tubetube Member Posts: 36 ■■□□□□□□□□
    The picture I posted shows a 2^4 = 16 subnets, but only 14 usable subnets. So I excluded the first and the last one.

    When the command ip subnet-zero is configured, then all zeros subnet are allowed. It will be a different story.
  • NeonNoodleNeonNoodle Member Posts: 92 ■■□□□□□□□□
    tube wrote:
    The picture I posted shows a 2^4 = 16 subnets, but only 14 usable subnets. So I excluded the first and the last one.

    When the command ip subnet-zero is configured, then all zeros subnet are allowed. It will be a different story.

    That is incorrect. Your program shows all the subnets. In fact it says there are 16 subnets. But it also says that there are 14 usable subnets. For the ip subnet-zero rule the major class network and the broadcast network, i.e. the first and last are unusable. What Netstudent and I are saying is that when the no ip subnet-zero rule is in effect, how would you come up with the correct answer, because with the no ip subnet-zero rule in effect the answer you gave is not the right one. It may seem to be a pedantic matter, but as Netstudent pointed out, most if not all, Cisco IOSes come with a default configuration of no ip subnet-zero.
    I recognize the lion by his paw.
    --Jacob Bernoulli
  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    Most if not all routers come with ip subnet-zero configured by default. If No ip subnet-zero were configured, then you could not use the 0 subnet. By default routers allow you to use the 0 subnet.


    With IP Subnet-Zero configured, the 0 subnet and broadcast subnet ARE usable.

    Tube would be right if no ip subnet-zero were configured for some odd reason because the keyword "NO" means no you can not use the 0 subnet.
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • tubetube Member Posts: 36 ■■□□□□□□□□
    Okay, guys, I apologize for that. Perhaps I misunderstood the conception.

    I knew that the ip subnet-zero is indeed on by default with later IOS version. The main reason is that we are running out of IP addresses, so we need to use the first one as well.

    I excluded the first one, so I started counting from 1-14, the last one is the broadcast address. Therefore this is what I got:

    Subnet #10: 172.60.160.0
    Host address 500th: 172.60.161.244

    Well, if started from 0, then we can work on subnet #9.
    16 * 9 = 144

    Subnet #9: 172.60.144.0
    Host address 500th: 172.60.145.244


    Well, thanks guys for clearing things out.
  • hodgey87hodgey87 Member Posts: 232
    sorry guys seems like ive caused abit of uproar with this forum :D

    thanks for all your replies
  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    icon_lol.gif I agree...But it was a challenging question...I think everyone just got slightly confused at one point. I missed a host 0, Tube missed subnet 0, and neon got mixed up with the command "ip subnet-zero". It's all good....
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
Sign In or Register to comment.