Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    DHCP Server provider the same IP for two different VMs

    Scheduled Pinned Locked Moved DHCP and DNS
    35 Posts 5 Posters 2.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • johnpozJ
      johnpoz LAYER 8 Global Moderator @aloisiobilck
      last edited by

      @aloisiobilck said in DHCP Server provider the same IP for two different VMs:

      Both have the origin of a template

      I am not 100% on this - but if the client requests its last IP, then that would be offered to it even if the mac is different. I can try and duplicate that..

      You need to look in the discover to see if client is asking for its old IP..

      For example - here is client asking for the IP it had last time..

      request.jpg

      An intelligent man is sometimes forced to be drunk to spend time with his fools
      If you get confused: Listen to the Music Play
      Please don't Chat/PM me for help, unless mod related
      SG-4860 24.11 | Lab VMs 2.8, 24.11

      S 1 Reply Last reply Reply Quote 0
      • S
        SteveITS Galactic Empire @johnpoz
        last edited by SteveITS

        @johnpoz said in DHCP Server provider the same IP for two different VMs:

        if the client requests its last IP, then that would be offered to it even if the mac is different

        That was going to be my next question, if the template had been made after the DHCP lease had been obtained. Still, I would hope the DHCP server would not double assign it, and tell the second VM that IP is not available.

        In 23.09 they are including Kea DHCP as a preview, since ISC DHCP will be discontinued. Might change the behavior.

        Edit: I have run into this with application software, for instance if someone clones a computer after installing antivirus or RMM software, and there are two programs now using the same internal ID.

        Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
        When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
        Upvote ๐Ÿ‘ helpful posts!

        johnpozJ 1 Reply Last reply Reply Quote 0
        • johnpozJ
          johnpoz LAYER 8 Global Moderator @SteveITS
          last edited by johnpoz

          @SteveITS yeah you would hope no dupe should be assigned. So if the 1st device was on.. the ping check dhcpd should be doing before offer should catch it and not offer what the client requested.

          And then you also have the client that should be sending out a arp probe for that IP before.. client should send a arp probe and if something answers it should send a decline vs ack..

          As a simple test I was going to fire up a vm.. have it get an IP, and then shut it down and change its mac and then boot it and see if it requests the same IP and gets it.. Or could just create another clone of the vm, leaving it online and then fire up the clone with different mac and see if also requests - but this time it shouldn't get it because there is something actually online with the IP.

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.8, 24.11

          P 1 Reply Last reply Reply Quote 0
          • P
            pwood999 @johnpoz
            last edited by

            This post is deleted!
            johnpozJ 1 Reply Last reply Reply Quote 1
            • johnpozJ
              johnpoz LAYER 8 Global Moderator @pwood999
              last edited by johnpoz

              @pwood999 said in DHCP Server provider the same IP for two different VMs:

              ARP before the discover as that's broadcast.

              where did I say there would be an arp before discover? The dhcp server would do a ping to the IP, this could produce an arp if the IP is not in the arp cache already.

              The client upon getting an offer for IP X, would do an arp probe for that IP before it sends its ack, if it gets a response to that arp probe it would send a decline instead so the dhcpd would send another offer with different IP.

              I haven't seen a dupe IP issue in years and years and years - other than static duplication, ie PEBKAC.. Both dhcpd and dhclient have safety measures in place to prevent duplication. Not saying that can not happen.. But they should be rare for sure, and some sort of mitigating circumstances have to be at play.. Like disable of the features that try and prevent duplication.

              edit:
              Example from my previous example of client requesting a specific IP - can see that the client was probing for that IP 192.168.9.100 that it was requesting

              probe.jpg

              A probe is different than a normal arp, asking hey this is IP X who has IP Y..

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.8, 24.11

              1 Reply Last reply Reply Quote 0
              • A
                aloisiobilck @NollipfSense
                last edited by

                @NollipfSense
                Sorry for the delay in answering. I changed the DNS, but the problem continues.

                johnpozJ 1 Reply Last reply Reply Quote 0
                • johnpozJ
                  johnpoz LAYER 8 Global Moderator @aloisiobilck
                  last edited by

                  @aloisiobilck And what does dns have to do with anything? What did you change exactly?

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.8, 24.11

                  A 1 Reply Last reply Reply Quote 0
                  • A
                    aloisiobilck @johnpoz
                    last edited by

                    @johnpoz

                    As @NollipfSense asked, I changed it here. I also don't know what DNS has to do with DHCP.

                    From
                    a81f4b1b-dd49-4feb-b592-13dd803f91ca-image.png

                    to:
                    11541c37-e899-4071-aa65-fbb3ff24df05-image.png

                    johnpozJ 1 Reply Last reply Reply Quote 0
                    • johnpozJ
                      johnpoz LAYER 8 Global Moderator @aloisiobilck
                      last edited by

                      @aloisiobilck yeah that has zero to do with it that is for sure. And I highly doubt you want pfsense to not be able to resolve its own records.. The default is what you would most likely.. I resolve so there is nothing to fall back to.. So I use local only.. But again that has zero to do with anything..

                      I don't see where he told you to change that.. He said that pfsense validates host overrides..

                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                      If you get confused: Listen to the Music Play
                      Please don't Chat/PM me for help, unless mod related
                      SG-4860 24.11 | Lab VMs 2.8, 24.11

                      A 1 Reply Last reply Reply Quote 1
                      • A
                        aloisiobilck @johnpoz
                        last edited by

                        Is there something I did wrong in pfsense for this to happen?
                        Simply the DHCP Server hands over the same IP to a new VM.

                        johnpozJ 1 Reply Last reply Reply Quote 0
                        • johnpozJ
                          johnpoz LAYER 8 Global Moderator @aloisiobilck
                          last edited by

                          @aloisiobilck lets go over this again.. If your new VM asks for an IP, it will get it..

                          Did you sniff to see if the new vm is asking for the same IP?

                          I specifically showed an example where box was asking for the old IP..

                          Please do a packet capture of the dhcp and look to see if the client is asking for the same IP.. You could prob clear up the problem by just doing a release and then renew on the client. So it doesn't ask for an old IP.

                          An intelligent man is sometimes forced to be drunk to spend time with his fools
                          If you get confused: Listen to the Music Play
                          Please don't Chat/PM me for help, unless mod related
                          SG-4860 24.11 | Lab VMs 2.8, 24.11

                          A 2 Replies Last reply Reply Quote 0
                          • A
                            aloisiobilck @johnpoz
                            last edited by

                            @johnpoz

                            What is happening is the following:
                            I clone two VMs.

                            • VM1 starts and gets an IP
                            • VM2 starts and gets the same IP as VM1.
                              If I go through the VM2 terminal and give a dhclient <interface> it gets a new IP.
                            johnpozJ 1 Reply Last reply Reply Quote 0
                            • johnpozJ
                              johnpoz LAYER 8 Global Moderator @aloisiobilck
                              last edited by johnpoz

                              @aloisiobilck I would think that duplicate ip detection would prevent that.. Did you disable that on pfsense dhcp server?

                              dhcpcheck.jpg

                              The client itself should also be doing duplication checks as well.. What specific client OS is this VM?

                              Is VM1 still on when you start up VM2?

                              An intelligent man is sometimes forced to be drunk to spend time with his fools
                              If you get confused: Listen to the Music Play
                              Please don't Chat/PM me for help, unless mod related
                              SG-4860 24.11 | Lab VMs 2.8, 24.11

                              A 2 Replies Last reply Reply Quote 0
                              • A
                                aloisiobilck @johnpoz
                                last edited by

                                @johnpoz I will install tcpdump to see the DHCP packets.

                                S 1 Reply Last reply Reply Quote 0
                                • S
                                  SteveITS Galactic Empire @aloisiobilck
                                  last edited by

                                  @aloisiobilck no need:
                                  https://docs.netgate.com/pfsense/en/latest/diagnostics/packetcapture/index.html

                                  Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                                  When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                                  Upvote ๐Ÿ‘ helpful posts!

                                  A 1 Reply Last reply Reply Quote 0
                                  • A
                                    aloisiobilck @johnpoz
                                    last edited by

                                    @johnpoz
                                    I didn't disable it, it's the way you sent the image.
                                    VM1 is up

                                    1 Reply Last reply Reply Quote 0
                                    • A
                                      aloisiobilck @SteveITS
                                      last edited by

                                      @SteveITS
                                      I was talking about the Linux VM, sorry. In Pfsense I am aware that I must use "Packet Capture"

                                      Thanks

                                      1 Reply Last reply Reply Quote 0
                                      • A
                                        aloisiobilck @johnpoz
                                        last edited by

                                        @johnpoz I'll test it with "Disable ping check"

                                        S johnpozJ 2 Replies Last reply Reply Quote 0
                                        • S
                                          SteveITS Galactic Empire @aloisiobilck
                                          last edited by

                                          @aloisiobilck said in DHCP Server provider the same IP for two different VMs:

                                          @johnpoz I'll test it with "Disable ping check"

                                          You want the ping check enabled. That tells pfSense to not assign an IP if anything responds to a ping. Does the firewall on these VMs allow ping?

                                          Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                                          When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                                          Upvote ๐Ÿ‘ helpful posts!

                                          A 1 Reply Last reply Reply Quote 0
                                          • johnpozJ
                                            johnpoz LAYER 8 Global Moderator @aloisiobilck
                                            last edited by

                                            @aloisiobilck where did I say to do that?

                                            Even if this first vm doesn't answer ping, the arp probe that the 2nd vm sends out or should send out would be answered if its online.

                                            Is the first vm still up when you turn on the 2nd vm??

                                            What OS are you running on these VMs.. These are basic questions, that you didn't answer but jump straight to disabling the very thing that would help prevent duplicate IPs..

                                            There are a billion flavors of linux - they can all have different dhcp clients, etc.. What distro are you running, so can look - and or even try duplicate exactly what your doing with the same OS..

                                            An intelligent man is sometimes forced to be drunk to spend time with his fools
                                            If you get confused: Listen to the Music Play
                                            Please don't Chat/PM me for help, unless mod related
                                            SG-4860 24.11 | Lab VMs 2.8, 24.11

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.