Asking for clarification as what I’ve read suggests yes, but is also sometimes coupled with advice to (still?) set a static IP outside of the DHCP address range as well.

Thanks in advance!

  • deadbeef79000@lemmy.nz
    link
    fedilink
    English
    arrow-up
    31
    ·
    2 months ago

    TL;DR: it depends entirely on the DHCP server software.

    Generally the safe/reliable policy is to assign a smaller DHCP range (or ranges) and allocate static assignments outside of the DHCP range(s).

    Assume your network is 192.168.1.0/24.

    Specify 192.168.1.128/25 for DHCP, which means all DHCP addresses will be above 192.168.1.128.

    This leaves you everything below 192.168.1.127 for static assignments.

    • BrianTheeBiscuiteer@lemmy.world
      link
      fedilink
      English
      arrow-up
      12
      ·
      2 months ago

      I’d agree with this recommendation. I believe there were multiple occasions where my router assigned a dynamic IP the same as some other reserved IP. Hard as hell to diagnose. Key indicator was that roughly half the packets were being lost.

    • ALostInquirer@lemm.eeOP
      link
      fedilink
      English
      arrow-up
      6
      ·
      2 months ago

      Appreciate the example! It’s when handling a DHCP range and the related CIDR notation that I tend to get especially muddled in this area. It certainly doesn’t help that each router’s interface and terminology tends to vary just enough to add uncertainty.

      Regardless, the comments here and more focus on this have helped clear some of this up for me.

      • deadbeef79000@lemmy.nz
        link
        fedilink
        English
        arrow-up
        4
        ·
        2 months ago

        I still double-check my CIDR’s/netmasks and expected ranges with a tool (some online one or other). Easier to avoid silly mistakes or typo’s

  • ad_on_is@lemm.ee
    link
    fedilink
    English
    arrow-up
    12
    ·
    2 months ago

    I would suggest not to rely on that. Give the DHCP a range, use manual IPs outside of that range

  • hperrin@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    arrow-down
    1
    ·
    edit-2
    2 months ago

    If it doesn’t, I would consider that a bug in the router.

    Routers are not particularly known for being free of bugs.

  • Treczoks@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    2 months ago

    You should put fixed IP addresses outside the DHCP allocation range. While a DHCP server might be smart enough to exclude a fixed address automatically, this is not a must. So better safe than sorry.

  • Shimitar@feddit.it
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 months ago

    Nope!

    Just wasted 3 days debugging an IP assigned to two devices… Not fun, don’t do it…

  • Toes♀@ani.social
    link
    fedilink
    English
    arrow-up
    6
    ·
    2 months ago

    So it depends. For example some legacy apple stuff had a bad DHCP implementation where it would try to hold onto an IP address it had before.

    When there’s one DHCP server with a reserved ip it won’t assign that ip to the wrong device. (Unless you’re running some buggy software that takes your configuration as suggestions)

    Where the advice to set it anyways comes from scenarios where that DHCP server goes down for long enough that everyone starts self assigning addresses. It’s a real hassle to find the correct system when that happens.

  • originalucifer@moist.catsweat.com
    link
    fedilink
    arrow-up
    6
    ·
    2 months ago

    dhcp is the only service that would allocate the address. if you use an address outside of a dhcp scope, youre fine in that it wont be automatically used.

    now, this is kinda different per manufacturer… but in some routers generally setting/assigning a static to an mac address is just forcing a little mini 1-to-1 dhcp scope your incoming mac to the ip you set.

  • walden@sub.wetshaving.social
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    1
    ·
    edit-2
    2 months ago

    Good question, and I’m curious what the experts say. Surely it depends on the software that handles DHCP.

    I’ve always set static addresses in the DHCP address range and it has always been reserved and never assigned to other devices. I’ve used ASUS and MikroTik for what it’s worth.

    If you’re the type to set static addresses on the devices themselves, then that would certainly increase the risk of a conflict if it’s inside the address range.

  • gwindli@lemy.lol
    link
    fedilink
    English
    arrow-up
    4
    ·
    2 months ago

    the best practice is to keep your dhcp pool and reservations from overlapping, but on a home network its usually easier to let a device acquire an ip via dhcp and then create the reservation for that address.

  • LinkA
    link
    fedilink
    English
    arrow-up
    4
    ·
    2 months ago

    Yes it does. Only the MAC address you assigned to that IP will get it.

  • Kadaj21@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 months ago

    Someone who might be more familiar with MacOs and iOS please correct me if I’m wrong but i think if certain settings are turned on they will periodically randomize their MAC addresses for security/privacy.

    I’m running pihole in a docker container and set the IP to be static on the router. After either a reboot or the update to Sequoia (or both?) The IP address chsnged due to a new MAC address and broke my pihole settings until i updated it.

    • mark3748@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 months ago

      Apple will randomize your MAC when connecting to networks to maintain privacy. It’s a per-network setting that can be toggled off for your own private network if you want to.

  • Blaster M@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    2 months ago

    DHCP, when set up properly, makes for less work. Reservations will have the DHCP server hand out the same IP to the same hardware (MAC address) when it asks. If you have a device that is from the dinosaur age that doesn’t play nice with DHCP, then make sure you give it an address that is outside the DHCP range on the same subnet. ex: Some home routers use 192.168.1.100 to 192.168.1.200 as the dhcp range. Setting anything from 192.168.1.1 (or 2 if the router is on 1) to 192.168.1.99 is fine, as is 192.168.1.201-192.168.1.254 (or 253 if the router is on 254). However, by setting static ips, you have to remember those ips specifically to interconnect devices on the lan, whereas reserving via dhcp allows you to use local dns resolution to connect to devices via their hostname instead. In additon, you run the risk of ip conflicts from forgetting which device has what ip in an increasingly complex system, and if you change internet providers or routers, you have a lot of extra work to do to fix the network settings to get those static ips to connect.

    Alternately, just use the link-local ipv6 address to interconnect on the lan. That doesn’t change on most devices, as it is based on the MAC address, and is always reachable on the lan.

  • owenfromcanada@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    I usually move static assignments outside the DHCP range, but in general, most routers will avoid re-allocating it even if it’s within the DHCP range.