IPv4 is hard (thelemmy.club)
submitted 13 hours ago by to c/linuxmemes@lemmy.world
 
Tom chasing Harry and Ron Weasly Memeβ€―: Harry :β€―people using the first address of the range as gateway, Ron : people using the last address of the range as gateway, Tom : people using one random address of the range as gateway
you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 13 hours ago* (18 children)
  • [–] 18 points 13 hours ago* (last edited 12 hours ago) (11 children)

    255 is reserved for broadcast.

    Edit: Yes, 255 is technically not 'reserved' by itself. I was only thinking about the addresses scoped to /24 for a simple answer. A broadcast address is reserved, though.

    When in doubt: https://www.calculator.net/ip-subnet-calculator.html

  • source
  • parent
  • hideshow 11 child comments
  • [–] 5 points 13 hours ago (10 children)

    10.233.213.255 is broadcast, 10.233.212.255 is a usable address ..

  • source
  • parent
  • hideshow 10 child comments
  • [–] 5 points 13 hours ago (9 children)

    How big of an IP scope do you use at home?

    Do you really need something larger than a /24?

  • source
  • parent
  • hideshow 9 child comments
  • [–] [S] 7 points 13 hours ago (2 children)

    I’m quite fond of 10.0.0.0/8. That gives you a lot of wiggle room, just in case.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 13 hours ago (4 children)

    Well technically a 10. network could be a /8 if you really wanted to. But in this case the /23 was specified above. I don't think it's necessary but that's what op was talking about and the 212.255 is a valid address, as is 213.0

  • source
  • parent
  • hideshow 4 child comments
  • [–] 3 points 13 hours ago (3 children)

    Sure, you could. But you'd be going out of your way to setup an internal IP scope you'll never fully utilize.

    I suppose it doesn't really matter, but it just feels wrong.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 12 hours ago* (last edited 11 hours ago)

    Thanks for the correction on the the broadcast address, btw. The details are important.

    At home, I have 172.16/12 scoped out for my cluster subnet and just use the second and third octet to denote service function. It's excessive scoping, but it's an internal scope for a private network and broadcasts are generally contained to the cluster network. It would be trivial to split that into a 172.16/16 if I ever had the desire. (Speaking bluntly, it really doesn't matter much in this case. I'll need to split it out to keep Longhorn traffic segregated later, but it's not an issue now.)

    The rest of the network is reasonably scoped out across 192.168 ranges and chopped up across a few VLANs.

    My addressing scheme is split into "public" and "stay the fuck out", with most 172 addresses being the latter. At home this is great. In a large network, scoping out such a large 172 subnet could be detrimental. ("It depends" on the detrimental bit and requires proper planning and understanding about why subnets were even built into IPv4 from the get-go.)

    Edit: Most addressing is static on my cluster network, with DHCP only handing out addresses based on MAC address. The 172 subnet has very restricted dynamic IP ranges.

    Regardless of what is what, it's a scheme I recognize and that is the more important bit.

  • source
  • parent
  • [–] 3 points 12 hours ago

    I could see something like /20 being useful not so much for the number of addresses but to group things by use case, then /8 because you don't care and it doesn't matter. Also 10.0 is quicker to type and cleaner to look at than 192.168

  • source
  • parent
  • [–] 3 points 13 hours ago (5 children)

    The highest address of a subnet is the broadcast address. You can't assign it to a host.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 7 points 13 hours ago (4 children)

    But 10.233.212.225 is middle of the range for the /23.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 3 points 13 hours ago (3 children)

    I had students like you when teaching Cisco classes...

    Their peers heads would always explode, lol.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 3 points 12 hours ago (2 children)

    If you use a /23 you can use the middle .0 too.

    My favourite dumb networking trick though is that Linux lets you use an IPv6 address as an IPv4 gateway.

    ip -4 route add default via inet6 fe80::1 dev eth0
    

    That works so long as the gateway is running dual stack.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 5 hours ago (1 child)

    Makes sense, the gateway is never a target of the ip packet, so it's really only used to find the MAC address of the gateway.

  • source
  • parent
  • hideshow 1 child comment