Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Depends how it is used. I *think* if you are using Classless Inter-Domain Routing - you can use all the addresses. I have to say I've never actually tried to use .0
I suppose in theory it would work as long as all devices on the network would allow it. Cisco kit the command would be "ip classless"
Just a thought - you are asking about IP v4. Are you actually asking about the subnet ID? This is very much apart of varible length subnet masking. As an address it cannot be used.
A .0 address represents an entire subnet as the network identifier address. It can't be used nor can .255 which represents the subnet mask in anything below /24 (i.e. /24 - /32) addresses. In practice, they aren't really used at all. Also, a network with a /32 will have exactly 1 host on it and wouldn't be of much use (it isn't even a network in my mind, but I guess technically it is).
The IPv4 Cheat Sheet will tell you how many addresses can be on a subnet.
I know the subnet ID isn't a usable address normally with Variable Length Subnet Masking VLSM - so as an example:
/29 address range:
X.X.X.32/29
The subnet ID is X.X.X.32
Usable addresses are X.X.X.33 - X.X.X.38
The broadcast is X.X.X.39
But is it possible to actually use the subnet ID and broadcast address? I'm sure I once had a device on a network that was a X.X.X.255. Would this only be possible with a /23 or lower mask address range?
If you set your subnet mast to 255.255.(non-255number).0, then I believe it is possible to use them, but in practice, nobody really does (possibly to prevent a problem if they need to later split their subnets).
There is a certain amount of confusion here. You need to remember that there is a difference between an ip subnetwork, and a route. A subnetwork represents a set of hosts who have ip addresses that reside in a common IP network range. A route is a pointer to a network.
A network, would be say 192.168.1.0/24. The first possible address of 192.168.1.0 is reserved as the network identifier and would not be assigned as a host address although it may occasionally appear as a source address in a packet under certain circumstances. Likewise the last address in the range .255 is reserved as the broadcast address. Packets sent to this address are considered to be a subnet broadcast which should be received by all members of the ip network. Configuring this address as a host ip clearly leads to all sorts of confusion as packets sent to it would be received by everyone else.
192.168.1.0/24 is perfectly valid as a route however, as it points the way to the network as a whole.
What also causes confusion is that what sets the range of address that a network consists of is the shared subnet mask.
So if we change the above to 192.168.1.0/25 then the defined network address range becomes 192.168.1.0 to 192.168.1.127.
As before the first address is the network .0 and the last is the broadcast now .127
192.168.1.255 is now the broadcast address of a separate network 192.168.1.128/25 which ranges from 192.168.1.128 (network) to 192.168.1.255(broadcast).
Its simple really.
A 255.255.255.255 mask or /32 in CIDR notation, identifies a network that has only one host and tends to be used for loopback addresses. You might uses one on, say, a Cisco router for a tunnel. If your tunnel terminates to a physical port address and that port goes down, your tunnel drops even though you may have alternates routes to the same box. Advertising a loopback interface, which is virtual and so never goes down, means that you never lose sight of the peer address, unless the router becomes isolated.
Using variable subnets is very common, I have customer using for instance 255.255.248.0. What this means is that you have one ip subnet that has 8*256 addresses, for example 10.1.0.0 (network) to 10.1.7.255 (broadcast). Now another confusion arises here as theoretically 10.1.1.0 is a valid host address, by the above rules, as is 10.1.3.255. These addresses are rarely used though as they tend to confuse people, and certainly in the early days of variable length subnet masking different manufacturers would handle this situation in different ways and things would get messy.
So generally you would not use those examples where the last digit is 0 or 255.
You can however use a zero in the network portion of the address. So 10.1.0.1 255.255.248.0 is a perfectly valid host address.
The rules for ip are explained well on wikipedia and it links to the relevant RFC's if you want to look at the actual standards.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.