Saw this Question on Cisco's Web site

AndreLAndreL Member Posts: 55 ■■□□□□□□□□
Why can't I add this address to int vlan 10?

int vlan 10

ip address 10.1.10.0 255.255.255.0

result is "Bad mask /24 for address 10.1.10.0"
I added "ip subnet-zero" and it still won't work.

here are the responses
"It´s a trivial issue because we usually set the network address instead of port address.

10.1.10.0 network address.
10.1.10.1 port address"

and

The valid range for the /24 is 10.1.10.1-254. 10.1.10.0 is your network address and 10.1.10.255 is the broadcast address.

I can see it as that it is a network address but he did issue a ip subnet-zero so why did that not take care of it.

Comments

  • clarsonclarson Member Posts: 903 ■■■■□□□□□□
    What you are doing is setting the SVI (switch virtual interface) for that vlan. Basically it is the ip address that connects you to the switch (it's host address on that vlan). And, as mentioned above, the valid range for host addresses for the /24 is 10.1.10.1-254
  • Will.mWill.m Registered Users Posts: 4 ■□□□□□□□□□
    You can't assign 10.1.10.0 255.255.255.0 to the interface vlan 10 because 10.1.10.0 is the network number for the 10.1.10.0/24 subnet, the same way you can't assign the ip address of 10.1.10.255 to the interface because that IP address is reserved for the broadcast address. Just remember when assigning IP addresses that you can't assign the first or last address of a subnet because those are reserved for the network and broadcast addresses, respectively.
  • AndreLAndreL Member Posts: 55 ■■□□□□□□□□
    "but he did issue a - ip subnet-zero - so why did that not take care of it."

    and whats the deal with SVI

    and if you can't assign a "0" for and address then what good is ip subnet-zero command

    found this a wiki under Subnetwork

    Subnet zero and the all-ones subnet[edit]
    The first subnet obtained from subnetting has all bits in the subnet bit group set to zero (0). It is therefore called subnet zero.[6] The last subnet obtained from subnetting has all bits in the subnet bit group set to one (1). It is therefore called the all-ones subnet.[7]

    The IETF originally discouraged the production use of these two subnets due to possible confusion of having a network and subnet with the same address.[8] The practice of avoiding subnet zero and the all-ones subnet was declared obsolete in 1995 by RFC 1878, an informational, but now historical document.[9]
  • Will.mWill.m Registered Users Posts: 4 ■□□□□□□□□□
    I believe subnet 0 is just the first subnet available after subnetting, not the same as the network number's individual IP address. I think all subnet zero means is that the address range of the first subnet 10.1.0.0/24 is usable, not that the network address is usable. Though I could be wrong, I only recently got my CCNA.
  • Javea1Javea1 Registered Users Posts: 2 ■□□□□□□□□□
    AndreL wrote: »
    Why can't I add this address to int vlan 10?

    int vlan 10

    ip address 10.1.10.0 255.255.255.0

    result is "Bad mask /24 for address 10.1.10.0"
    I added "ip subnet-zero" and it still won't work.

    here are the responses
    "It´s a trivial issue because we usually set the network address instead of port address.

    10.1.10.0 network address.
    10.1.10.1 port address"

    and

    The valid range for the /24 is 10.1.10.1-254. 10.1.10.0 is your network address and 10.1.10.255 is the broadcast address.

    I can see it as that it is a network address but he did issue a ip subnet-zero so why did that not take care of it.

    You can't assign 10.1.10.0 255.255.255.0 to an interface because that's a network address. The first and last IP addresses in a subnet define the network address and broadcast address (10.1.10.0 and 10.1.10.255, respectively, in your example). This means the valid range of addresses you can assign to your interfaces/hosts would be 10.1.10.1-.254. The "ip subnet-zero" command doesn't change this fact.

    For example, say you have network 192.168.1.0/26. This gives you the following subnets:

    192.168.1.0 (subnet zero)
    192.168.1.64
    192.168.1.128
    192.168.1.192

    The "ip subnet-zero" command really just allows you to assign addresses from the first subnet (subnet zero, or 192.168.1.0 in this example). This command is enabled by default on current versions of IOS, so it's not something you really need to worry about.

    You can see if we disable ip subnet-zero, we can't assign an IP address from subnet zero to our interface.
    S1(config)#no ip subnet-zero
    S1(config)#int vlan 10
    S1(config-if)#ip add 192.168.1.1 255.255.255.192
    Bad mask /26 for address 192.168.1.1
    

    If we re-enable ip subnet-zero, the same command we just tried will now work.
    S1(config-if)#exit
    S1(config)#ip subnet-zero
    S1(config)#int vlan 10
    S1(config-if)#ip add 192.168.1.1 255.255.255.192
    S1(config-if)#
    
    Hope this helps.
Sign In or Register to comment.