Issue with dhcp and netplan

Discussion in 'Proxmox VE: Installation and configuration' started by cfnz, Feb 12, 2019.

Tags:
  1. cfnz

    cfnz New Member

    Joined:
    Feb 12, 2019
    Messages:
    6
    Likes Received:
    0
    Hi,

    I am just evaluating Proxmox, and have come across a strange issue.

    I have made a template Ubuntu 18.04 server (with netplan by default - setup with DHCP during install, disabled ipv6 after install), and cloned it a few times.

    Whenever I clone it, it gets a new mac - good, but it gets the same ip address assigned via dhcp - bad.

    I have access to a Xen box, so tried the same thing (fresh install, followed same steps - it is on a different subnet, so that is different, but uses the same DHCP server)... it works. All new vms get a new mac address AND a new ip address - all good.

    Went back to the Proxmox VMs, and removed netplan, and everything worked - new clones get new mac addresses and ip addresses, so at least something works.

    Cloned some of the original VMs again, and still get new mac addresses but same ip address assigned.

    I am not too familiar with netplan or Proxmox, but something strange is happening and I am not sure how to debug it. As mentioned, it does not seem to replicate behaviour on a Xen box.

    Any pointers on debugging would be appreciated.

    Regards
    Colin
     
  2. cfnz

    cfnz New Member

    Joined:
    Feb 12, 2019
    Messages:
    6
    Likes Received:
    0
    I have just done a new vm without removing IPv6, so basically use ubuntu 18.04.1 install (not the live install) with pretty much default options. Turn into a template, clone twice, and both clones have different mac addresses but get the same ip address via dhcp.
     
  3. Chris

    Chris Proxmox Staff Member
    Staff Member

    Joined:
    Jan 2, 2019
    Messages:
    154
    Likes Received:
    12
    Hi,
    maybe have a look at the dhcp server logs and/or capture the dhcp requests/responses via tcpdump and/or wireshark to check what is going on.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. cfnz

    cfnz New Member

    Joined:
    Feb 12, 2019
    Messages:
    6
    Likes Received:
    0
    Thanks for that suggestion... I have managed to get a capture from the server... I am not too sure what it is supposed to say, but think I found something strange... It goes like this:

    Guest A and B both go through the DHCP Discover, Offer, Request and Ack process all successfully.

    In the DHCP Discover of guest A and B the Client Mac Addresses are correct (i.e. different). In the Offer that comes back, the DHCP server is offering the same IP address... so why is the DHCP server offering the same IP address for different mac addresses?

    Digging a little deeper, in the DCHP request, there is an Option 61 Client Identifier... as far as I can tell, these are supposed to be different and somewhat based on the Mac address. However, the Client Identifier for both of the guests is identical.

    So it seems that DHCP servers are supposed to use this Option 61 Client Identifier rather than the Mac address... and would I be correct to assume that this identifier is supposed to be different. If so, seems a reasonably fundamental problem.

    Where would I look next? Is it a problem with netplan (as mentioned, it does not do it if I use ifup/down). Or is it somehow netplan with proxmox? As mentioned, if I do (almost) the same thing on Xen, it works... almost because it is a different subnet and may be slighly different infrastructure.

    Any more help appreciated... I still have the capture file if needed.

    Regards
    Colin
     
  5. Chris

    Chris Proxmox Staff Member
    Staff Member

    Joined:
    Jan 2, 2019
    Messages:
    154
    Likes Received:
    12
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. sb-jw

    sb-jw Member

    Joined:
    Jan 23, 2018
    Messages:
    266
    Likes Received:
    23
    Did you changed the machine-id of the cloned VMs? If not, try it first and check if you then get an different IP.
     
  7. cfnz

    cfnz New Member

    Joined:
    Feb 12, 2019
    Messages:
    6
    Likes Received:
    0
    Thank you both very much, firstly, yes it is a Windows DHCP server and yes, the reference example you gave fixed the problem, i.e. updating the net plan to include the dhcp-identifer option:
    ...
    enp3s0:
    dhcp4: yes
    dhcp-identifier: mac

    And, no, I did not change the machine-id of the cloned VMs, and doing this also solved the problem, which might be the better fix... I know about removing ssh keys, but this will also have to be in my to-do list after cloning a linux box... one that uses net plan anyway... i.e. (for people who have found this in a search - in ubuntu 18.04)
    sudo rm /etc/machine-id
    sudo systemd-machine-id-setup


    Thanks again :)
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice