DHCP Reservations not working for Ubuntu

Solved
SimonReach
Building a reputation

DHCP Reservations not working for Ubuntu

Has anyone ever had issues with ip address reservations in DHCP not working at all?

 

It works fine for Windows servers but the Ubuntu servers will get an ip but not the correct ip they should get.  MAC addresses are all correct in the reservation, they match up with what's on the client screen, but the Ubuntu server will just get whatever ip is available on that vlan.

 

This has been an issue since putting in the Cisco 9300X-24X-HM stack.  We have the same issue whether the dhcp is being done by the stack or by the MX85s, DHCP works fine apart from the reservations for the Ubuntu servers.

 

Meraki/Cisco support is looking at other issues with the 9300X stack, presume this is all related to that.

1 Accepted Solution
TyShawn
A model citizen

I ran into this issue a lot with Ubuntu when I was turning up VMs on my ESXI hosts.

 

 

Solution 1: Configure DHCP to use MAC instead of Client ID (Netplan)

If you’re using Netplan (common in Ubuntu 18.04 and later), you can modify the Netplan configuration file.

  1. Edit Netplan Configuration File:

    bash
    Copy code
    sudo nano /etc/netplan/01-netcfg.yaml
  2. Look for the network interface section (it will look something like this):

    yaml
    Copy code
    network: version: 2 renderer: networkd ethernets: enp3s0: dhcp4: true
  3. Force Netplan to use the MAC address as the Client ID. Add the following option under the interface:

    yaml
    Copy code
    network: version: 2 renderer: networkd ethernets: enp3s0: dhcp4: true dhcp-identifier: mac
  4. Apply the changes:

    bash
    Copy code
    sudo netplan apply

This tells Netplan to use the MAC address as the DHCP identifier instead of the Client ID.


Solution 2: Configure DHCP Client to Use MAC (dhclient.conf)

If you're using dhclient directly (common in older versions of Ubuntu), you can modify its behavior.

  1. Edit the DHCP client configuration file:

    bash
    Copy code
    sudo nano /etc/dhcp/dhclient.conf
  2. Force it to use the MAC address. Add this line at the top or bottom of the file:

    conf
    Copy code
    send dhcp-client-identifier = hardware;
  3. Restart network services:

    bash
    Copy code
    sudo systemctl restart networking

Alternatively, you can stop and restart dhclient manually for a specific interface:

 

bash
Copy code
sudo dhclient -r enp3s0 # Release the DHCP lease
sudo dhclient enp3s0 # Request a new lease using the MAC address
 

 

View solution in original post

5 Replies 5
PhilipDAth
Kind of a big deal
Kind of a big deal

I'll take a punt.

 

DHCP reservations are typically done based on the MAC address, but some clients don't present the MAC address in the DHCP client ID field.

 

I did a Google and one article said to add "dhcp-identifier: mac" to the /etc/netplan/01-netcfg.yaml file.

 

Hopefully that is enough to start your Googling journey.

TyShawn
A model citizen

I ran into this issue a lot with Ubuntu when I was turning up VMs on my ESXI hosts.

 

 

Solution 1: Configure DHCP to use MAC instead of Client ID (Netplan)

If you’re using Netplan (common in Ubuntu 18.04 and later), you can modify the Netplan configuration file.

  1. Edit Netplan Configuration File:

    bash
    Copy code
    sudo nano /etc/netplan/01-netcfg.yaml
  2. Look for the network interface section (it will look something like this):

    yaml
    Copy code
    network: version: 2 renderer: networkd ethernets: enp3s0: dhcp4: true
  3. Force Netplan to use the MAC address as the Client ID. Add the following option under the interface:

    yaml
    Copy code
    network: version: 2 renderer: networkd ethernets: enp3s0: dhcp4: true dhcp-identifier: mac
  4. Apply the changes:

    bash
    Copy code
    sudo netplan apply

This tells Netplan to use the MAC address as the DHCP identifier instead of the Client ID.


Solution 2: Configure DHCP Client to Use MAC (dhclient.conf)

If you're using dhclient directly (common in older versions of Ubuntu), you can modify its behavior.

  1. Edit the DHCP client configuration file:

    bash
    Copy code
    sudo nano /etc/dhcp/dhclient.conf
  2. Force it to use the MAC address. Add this line at the top or bottom of the file:

    conf
    Copy code
    send dhcp-client-identifier = hardware;
  3. Restart network services:

    bash
    Copy code
    sudo systemctl restart networking

Alternatively, you can stop and restart dhclient manually for a specific interface:

 

bash
Copy code
sudo dhclient -r enp3s0 # Release the DHCP lease
sudo dhclient enp3s0 # Request a new lease using the MAC address
 

 

SimonReach
Building a reputation

Thank you to you and @PhilipDAth, this seems to be it.


Changing the DHCP server over to the Windows DHCP server, it'll show you the unique ID for any devices getting IPs from it, is there anyway to see the unique ID in Meraki or is Meraki purely done via MAC?

PhilipDAth
Kind of a big deal
Kind of a big deal

I believe it is purely done by mac address.

TyShawn
A model citizen

Yeah, I did that for most of my VLANs as well. For my infrastructure VLAN that is still on the MX,but this is mostly network hardware.

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.
Labels