Subnet zero question

TurK-FXTurK-FX Member Posts: 174
Working on MY ICND1 exam, and fine tunning my subnetting subject.
I am pretty good with subnetting, but after reading a few different materials, i was kind of confused.

If subnet zero not available (where square is borrowed subnet bits)2²=available subnets. If subnet zero is available 2²-2=Available subnets.
But no matter what is subnet zero is, available host is (where square is host bits) 2²-2= available host.

So i am confused with host portion of the calculation. Subnet zero has nothing to the with host portion, right?
I am not actually confused, i just want to make sure.
WGU classes: Transferred -> AGC1, CLC1, TBP1, CJC1, BVC1, C278, CRV1, IWC1, IWT1, C246, C247, C132, C164, INC1, C277. Appealed -> WFV1 and C393.
What is Left to take - > EUP1, EUC1, C220, C221, BNC1, GC1, C299, CTV1, DJV1, DHV1, CUV1, CJV1, TPV1, C394
Currently Studying -> CCNA security (Designing Customized Security & Security)
«1

Comments

  • NetworkVeteranNetworkVeteran Member Posts: 2,338 ■■■■■■■■□□
    TurK-FX wrote: »
    .
    If subnet zero not available (where square is borrowed subnet bits)2²=available subnets. If subnet zero is available 2²-2=Available subnets.
    Not quite. :)

    Let's take 150.1.0.0/16 and apply the subnet mask 255.255.192.0. Its subnets are--
    192.1.0.0 <== This is subnet zero
    192.1.64.0
    192.1.128.0
    192.1.192.0

    In this case, you'd normally have 2^N (where N=2) subnets. 2^2 = 4.
    If subnet zero were not available, you'd have (2^N)-1 subnets, and (2^2)-1 = 3. :)
    So i am confused with host portion of the calculation. Subnet zero has nothing to the with host portion, right?
    Yep, it has nothing to do with how many valid host addresses a subnet contains.
  • TurK-FXTurK-FX Member Posts: 174
    IP subnet-zero is not a new command, but in the past, cisco courseware, and cisco exam objextives, didnt cover it-but it certainly does now! This command allows you to use first and last subnet in your network design. For example, class C mask of 192 provedis subnets 64 and 128(discussed thoroughly later in this chapter), but with ip subnet-zero command, you now get to use those subnets 0, 64, 128, 192. That`s two more subnets for every subnet mask we use.

    I quoted this piece from Todd Lamme`s CCNA book. Are you sure it is 2^n-1?
    WGU classes: Transferred -> AGC1, CLC1, TBP1, CJC1, BVC1, C278, CRV1, IWC1, IWT1, C246, C247, C132, C164, INC1, C277. Appealed -> WFV1 and C393.
    What is Left to take - > EUP1, EUC1, C220, C221, BNC1, GC1, C299, CTV1, DJV1, DHV1, CUV1, CJV1, TPV1, C394
    Currently Studying -> CCNA security (Designing Customized Security & Security)
  • NetworkVeteranNetworkVeteran Member Posts: 2,338 ■■■■■■■■□□
    TurK-FX wrote: »
    I quoted this piece from Todd Lamme`s CCNA book. Are you sure it is 2^n-1?

    Yep! Sorry, Todd, you made a mistake. It was bound to happen one day. :p

    (That, or you're not using a up-to-date copy of his book, and may be in trouble on the exam!)
    To enable the use of subnet 0 for interface addresses and routing updates, use the ip subnet-zero command in global configuration mode.
    R1(config)#no ip subnet-zero
    R1(config)#int s0/0
    R1(config-if)#ip add 1.0.0.1 255.255.255.0
    Bad mask /24 for address 1.0.0.1
    R1(config-if)#ip add 1.0.255.1 255.255.255.0
    R1(config-if)#
    The use of the all-ones subnet was explicitly allowed and the use of subnet zero is explicitly allowed since Cisco IOS Software Release 12.0. Even prior to Cisco IOS Software Release 12.0, subnet zero could be used by entering the ip subnet-zero global configuration command.
  • mapletunemapletune Member Posts: 316
    Studying: vmware, CompTIA Linux+, Storage+ or EMCISA
    Future: CCNP, CCIE
  • TurK-FXTurK-FX Member Posts: 174
    so then there is a CLI command for subnet all the ones? how you control that one?
    WGU classes: Transferred -> AGC1, CLC1, TBP1, CJC1, BVC1, C278, CRV1, IWC1, IWT1, C246, C247, C132, C164, INC1, C277. Appealed -> WFV1 and C393.
    What is Left to take - > EUP1, EUC1, C220, C221, BNC1, GC1, C299, CTV1, DJV1, DHV1, CUV1, CJV1, TPV1, C394
    Currently Studying -> CCNA security (Designing Customized Security & Security)
  • NetworkVeteranNetworkVeteran Member Posts: 2,338 ■■■■■■■■□□
    TurK-FX wrote: »
    so then there is a CLI command for subnet all the ones? how you control that one?
    You can use any subnet in (modern) IOS by default. If you don't want to use the all-zeroes or all-ones subnet, simply don't use them. There is no command to disable using the all-ones subnet.
  • DiggsDiggs Member Posts: 97 ■■□□□□□□□□
    Doesn't Subnet Zero prevent you from using the broadcast subnet as well?

    If so that's where the -2 comes from.

    Edit: I see that apparently it does from NV's post - haven't read that anywhere
  • TehToGTehToG Member Posts: 194
    ^^ This is correct.
  • Michael2Michael2 Member Posts: 305 ■■■□□□□□□□
    I might not be understanding your post correctly, Diggs, but the formula 2(^n)-2 is for finding the hosts in each range. The minus two is because you can't use the first and last ip addresses in each range for the hosts. The first one identifies the network and the last is the broadcast address for the subnet.

    The no ip subnet zero command prevents the DHCP server from assigning addresses within the first range of addresses. Look at NetworkVeteran's first post. The zero subnet is identified and a command of no ip subnet zero would prevent the server from assigning any addresses from that range to any hosts. However, the first and last addresses of each of the ranges can not be issued to hosts.
  • TehToGTehToG Member Posts: 194
    It's not just DHCP. If i have No ip subnet zero being used I cannot use that subnet for any hosts.



    Say we have a range 192.168.1.0/27. I have 8 subnets
    (Edit: I derped these up but i'm not changing them :P)

    A) 192.168.1.0 - 192.168.1.32
    ... etc
    B) 192.168.1.128 - 192.168.1.160
    ... etc
    C) 192.168.1.224 - 192.168.1.255

    With the description of the network as 192.168.1.0/27, If we have IP subnet zero enabled we CAN use all 8 subnets. If we do not (i.e. no ip subnet zero) then we cannot use subnet A) or subnet C) but we can use the six in between.
  • lantechlantech Member Posts: 329
    I thought that the no ip subnet-zero command also restricted the all ones subnet as well.
    2012 Certification Goals

    CCENT: 04/16/2012
    CCNA: TBD
  • NetworkVeteranNetworkVeteran Member Posts: 2,338 ■■■■■■■■□□
    TehToG wrote: »
    C) 192.168.1.224 - 192.168.1.255

    With the description of the network as 192.168.1.0/27, If we have IP subnet zero enabled we CAN use all 8 subnets. If we do not (i.e. no ip subnet zero) then we cannot use subnet A) or subnet C) but we can use the six in between.
    Sorry mate, that's not how it works! My posts above explain the actual behavior. :)
    IOS 12.4T wrote:
    R1(config)#no ip subnet-zero
    R1(config)#int fa0/0
    R1(config-if)#ip add 192.168.1.225 255.255.255.224
    R1(config-if)#end
    R1#sh i
    *Mar 1 16:41:32.099: %SYS-5-CONFIG_I: Configured from console by console
    R1#sh ip int fa0/0 | inc 27
    Internet address is 192.168.1.225/27
  • DiggsDiggs Member Posts: 97 ■■□□□□□□□□
    Michael2

    I was under the impression that with the "No IP Subnet Zero" command the first and last subnets could not be used.

    If that were the case and you were asked to determine the number of valid subnets that formula would still be correct when using the number of subnet bits instead of host bits. Instead it is -1 since the broadcast address can apparently be used.

    eg: when the no ip subnet zero command is applied and you're asked to calculate the number of valid subnets in network 172.16.0.0 /24 - if the broadcast address couldn't be used the 2(^n)-2 would work (where n is the number of subnet bits) - where the broadcast subnet can be used it is instead 2(^n)-1

    Hoping I'm making sense
  • NetworkVeteranNetworkVeteran Member Posts: 2,338 ■■■■■■■■□□
    Diggs wrote: »
    I was under the impression that with the "No IP Subnet Zero" command the first and last subnets could not be used.
    That may be your impression, but the (modern) actual IOS behavior, documentation, and Cisco website disagree. This is why I posted all three waaaay up above. ;)
  • TehToGTehToG Member Posts: 194
    Todd Lammle 7th edition CCNA book only briefly explains ip subnet zero but it says you gain the first and last subnets for your design. Are you saying it's just the first?

    "Sybex wrote:
    This command allows you to use the first and last subnets in your network design. For example, the Class C mask of 255.255.255.192 provides subnets 64 and 128 but with the ip subnet zero command, you now get to use subnets 0,64,128 and 192. Thats two more subnets for every mask we use.
  • Michael2Michael2 Member Posts: 305 ■■■□□□□□□□
    TehToG, if that is the quote, it's horribly wrong. But to be sure I double checked with my lab. The no ip subnet-zero command tells the router not to allow configurations with addresses from the zero range. The ip subnet-zero command reverses this rule and allows you to use the addresses from that zero range. Keep in mind that you can issue addresses from the last range to hosts, just not the first and last addresses.

    The first and last addresses in each range are reserved for the network and the broadcast. They can never be assigned to hosts. That is where the minus two comes from.
  • TehToGTehToG Member Posts: 194
    That's a direct quote word for word with some references like "you'll see this in chapter x" removed.
  • TurK-FXTurK-FX Member Posts: 174
    That`s what i am trying to figure out. I have 3 different cisco book, and all says -2, where can we confirm that it is -1? it doesnt mention that in cisco resources.
    WGU classes: Transferred -> AGC1, CLC1, TBP1, CJC1, BVC1, C278, CRV1, IWC1, IWT1, C246, C247, C132, C164, INC1, C277. Appealed -> WFV1 and C393.
    What is Left to take - > EUP1, EUC1, C220, C221, BNC1, GC1, C299, CTV1, DJV1, DHV1, CUV1, CJV1, TPV1, C394
    Currently Studying -> CCNA security (Designing Customized Security & Security)
  • NetworkVeteranNetworkVeteran Member Posts: 2,338 ■■■■■■■■□□
    TurK-FX wrote: »
    That`s what i am trying to figure out. I have 3 different cisco book, and all says -2, where can we confirm that it is -1? it doesnt mention that in cisco resources.

    If you don't believe your eyes (IOS output) I'm not sure what to tell you, mate. :)
  • mapletunemapletune Member Posts: 316
    i think there's a misunderstanding going on here.

    If you read the link I posted earlier, you'll see that in the past the zero and ones subnet was indeed not allowed. Thus, 2^n - 2 for subnets as well as hosts.

    However, that changed after some IOS update or something
    Although the all-ones subnet can now be used, misconfigurations can cause problems.
    It should be noted that even though it was discouraged, the entire address space including subnet zero and the all-ones subnet have always been usable. The use of the all-ones subnet was explicitly allowed and the use of subnet zero is explicitly allowed since Cisco IOS Software Release 12.0.

    As NV pointed out. you CAN assign the ones subnet. It doesn't matter if ip subnet-zero or no ip subnet-zero is used, you'll still be able to assign all ones subnet.

    that said....

    in my opinion... it's still better to -2 subnets if you are answering exam questions. At least that's how all textbooks I've read do it. =p


    Nutshell:
    Practically and IOS reality: you can assign all ones subnet. so, it's 2^n - 1.
    For exam purposes: -2 the subnet for classful subnets.


    (At least that's my own opinion, i hope it's not terribly wrong)
    Studying: vmware, CompTIA Linux+, Storage+ or EMCISA
    Future: CCNP, CCIE
  • TehToGTehToG Member Posts: 194
    If you don't believe your eyes (IOS output) I'm not sure what to tell you, mate. :)

    The problem is that if the exam says you can't use the all ones subnet and you in actual fact can, The exam still says you're wrong.
  • DiggsDiggs Member Posts: 97 ■■□□□□□□□□
    That may be your impression, but the (modern) actual IOS behavior, documentation, and Cisco website disagree. This is why I posted all three waaaay up above. ;)

    Should have said "originally..." - my first post was done before I read your routers output from configuring an address in the broadcast subnet - Learned something new from your post...Thank you sir!

    Not sure where I had erroneously learned that the No Ip Subnet Zero command applied to the broadcast subnet as well.
  • TehToGTehToG Member Posts: 194
    Only the first subnet. These get lumped together because of how the binary works. The last subnet in your example (the "all ones" subnet) is not affected by whether ip subnet-zero is on or not. The class C network with the /26 mask would have the .192 subnet available, regardless. It was recommended that you didn't use the all-ones subnet since, for example 192.168.1.255/24 and 192.168.1.255/26 both have are the same broadcast address1. Therefore, a misconfigured client with a /24 subnet mask could cause routing loops on the router that held the 192.168.1.192/26 subnet.

    1 in binary, subnet bolded:
    /24: 11000000 10101000 00000001 11111111
    /26: 11000000 10101000 00000001 11111111
    It used to be recommended that you didn't use either all-zeroes or all-ones. That might be why they're saying that.

    I'd wager the test definitely won't pull a gotcha question on that one, but I don't know for sure.

    Someone on another forum explained is very well for me, I thought I'd share it here.
  • mella060mella060 Member Posts: 198 ■■■□□□□□□□
    Basically, all newer routers will have the command ip subnet-zero enabled by default. I think from ios 12.0 this has been the case. I don't see the big issue here. If the command is listed on the router, then you can use the 1st and last subnets. If it says no ip subnet-zero then you cannot use the 1st and last subnets.

    In the old days, the subnet formulas were 2^n-2 for subnets and 2^n-2 for hosts. Now it is 2^n for subnets since ip subnet-zero is now enabled by default.

    In the exam, the question will state whether ip subnet-zero is being used or not.

    Here is a bit of a write up on it...

    Subnet Zero and the All-Ones Subnet  [IP Addressing Services] - Cisco Systems
  • TurK-FXTurK-FX Member Posts: 174
    YEs, but no body mention -1 rule for exam purposes. As TheTog said, for real life -1 might be good idea, but i will be taking my ICND1 in 2 weeks, and i dont wanna lose a point for nothing.
    WGU classes: Transferred -> AGC1, CLC1, TBP1, CJC1, BVC1, C278, CRV1, IWC1, IWT1, C246, C247, C132, C164, INC1, C277. Appealed -> WFV1 and C393.
    What is Left to take - > EUP1, EUC1, C220, C221, BNC1, GC1, C299, CTV1, DJV1, DHV1, CUV1, CJV1, TPV1, C394
    Currently Studying -> CCNA security (Designing Customized Security & Security)
  • TehToGTehToG Member Posts: 194
    There is only one or two use cases where this matters. You'll not fail the exam over it. I wouldn't worry.

    mella060 wrote: »
    Basically, all newer routers will have the command ip subnet-zero enabled by default. I think from ios 12.0 this has been the case. I don't see the big issue here. If the command is listed on the router, then you can use the 1st and last subnets. If it says no ip subnet-zero then you cannot use the 1st and last subnets.

    In the old days, the subnet formulas were 2^n-2 for subnets and 2^n-2 for hosts. Now it is 2^n for subnets since ip subnet-zero is now enabled by default.

    In the exam, the question will state whether ip subnet-zero is being used or not.

    Here is a bit of a write up on it...

    Subnet Zero and the All-Ones Subnet* [IP Addressing Services] - Cisco Systems


    but you CAN use the all ones subnet and it works whether or not No Ip Subnet Zero is in effect. You just shouldn't.
  • NetworkVeteranNetworkVeteran Member Posts: 2,338 ■■■■■■■■□□
    mella060 wrote: »
    I don't see the big issue here.. If it says no ip subnet-zero then you cannot use the 1st and last subnets.
    I suppose the only issue, is you've stated it wrong again. "no ip subnet-zero" affects the first subnet, not the last subnet. Read the messages above, especially the IOS documentation and router output, and you'll realize this. Alternatively, try this on your own router.
    As TheTog said, for real life -1 might be good idea, but i will be taking my ICND1 in 2 weeks, and i dont wanna lose a point for nothing.
    I scored 100% on the IP addressing section the last (of many) times I took the CCNA. If you don't want to lose points, provide correct answers. Simple and always worked for me. :)
    You just shouldn't.
    This "shouldn't" was reversed by RFCs seventeen years ago.
  • TehToGTehToG Member Posts: 194
    While that's true, I believe it can still cause problems if there's misconfiguration?
  • lantechlantech Member Posts: 329
    TehToG wrote: »
    While that's true, I believe it can still cause problems if there's misconfiguration?

    Well, there is a simple solution for that. Don't misconfigure it. icon_lol.gif
    2012 Certification Goals

    CCENT: 04/16/2012
    CCNA: TBD
  • mella060mella060 Member Posts: 198 ■■■□□□□□□□
    I suppose the only issue, is you've stated it wrong again. "no ip subnet-zero" affects the first subnet, not the last subnet. Read the messages above, especially the IOS documentation and router output, and you'll realize this. Alternatively, try this on your own router.

    Sorry i am a bit rusty on these topics. I was under the impression that having no ip subnet-zero in the config meant that you couldn't use the zero and broadcast subnets. But ive never tried it so what would i know lol.
Sign In or Register to comment.