On 2023-07-25, Zack Newman <z...@philomathiclife.com> wrote:
> On 7/25/23 06:03, Stuart Henderson wrote:
>> 217.169.18.56 is a network address (mask it out against the netmask,
>> the remaining "host bits" are all zeroes), you cannot use this (or the
>> broadcast address) as a host address
>
> I am sure you were not trying to be "technical"; but for people that
> don't already possess the knowledge, I just wanted to say that there
> are two exceptions to the rule that you shouldn't assign the network or
> broadcast address to a host: /31 (https://www.rfc-editor.org/rfc/rfc3021)
> and /32 networks. I also have a /29 network of globally routable IPv4
> addresses, and I use all 8 of those precious IPs by carving out 8 /32s
> and assigning each one to a host.

true, though Nx/32 won't let you route it to other hosts without a lot
of hassle, and /31 may work or may not work depending on the other host's
IP stack and other software in use (some things don't expect /31), and
it doesn't actually give you any more available addresses unless you only
have a routed /30.

you can also put the all-0/all-1 addresses as /32 aliases and use
them for NAT (i.e. nat-to, rdr-to, or binat-to, to a machine on an
RFC1918-numbered network) while using the rest as normal on another
nic.

or there's a bodge if you don't need to talk to people on the
surrounding addresses, where you set the netmask wider than you
really have, say you have 192.0.2.80/28 from the ISP

$ ipcalc 192.0.2.80/28 
address   : 192.0.2.80      
netmask   : 255.255.255.240 (0xfffffff0)
network   : 192.0.2.80      /28
broadcast : 192.0.2.95      
host min  : 192.0.2.81      
host max  : 192.0.2.94      
hosts/net : 14

you could configure as /26

$ ipcalc 192.0.2.80/26 
address   : 192.0.2.80      
netmask   : 255.255.255.192 (0xffffffc0)
network   : 192.0.2.64      /26
broadcast : 192.0.2.127     
host min  : 192.0.2.65      
host max  : 192.0.2.126     
hosts/net : 62

and actually use the 16 addresses .80-.95

(depending on how the routed subnet is aligned you may need to go to a
wider prefix length, maybe as much as /23 if it starts on .0 or ends on
.255).

but none of these are things I think the OP should be concerned with
at this time hence not suggesting them. :)


Reply via email to