Check my DHCP lease?2019 Community Moderator ElectionForce dhcp client to get a new leaseDHCP configuration for iPXEHow to know DHCP options value on debian/ubuntu and other linuxTesting DHCP range; multiple addresses per interfaceHow to skip DHCP if no cable connected to ethernet in Debianreset of a ubiquiti networks power ap - no loveWhen no dhcp server answer, how can I force dhclient to use the static lease from dhclient.conf instead of a previous dhcp lease?dhcp not setting FQDN hostname on centos 7 (no NetworkManager)Ubuntu 16.04 not getting dhcp leaseDHCP server does not include NTP server addresses in the DHCP ACK message

Fear of getting stuck on one programming language / technology that is not used in my country

What are the advantages of simplicial model categories over non-simplicial ones?

Why "had" in "[something] we would have made had we used [something]"?

Electoral considerations aside, what are potential benefits, for the US, of policy changes proposed by the tweet recognizing Golan annexation?

Calculating total slots

What should you do if you miss a job interview (deliberately)?

Is there a RAID 0 Equivalent for RAM?

Can I still be respawned if I die by falling off the map?

Unexpected behavior of the procedure `Area` on the object 'Polygon'

What is the highest possible scrabble score for placing a single tile

Plot of a tornado-shaped surface

How can "mimic phobia" be cured or prevented?

How should I respond when I lied about my education and the company finds out through background check?

Pre-mixing cryogenic fuels and using only one fuel tank

Hero deduces identity of a killer

How could a planet have erratic days?

Using substitution ciphers to generate new alphabets in a novel

Does the UK parliament need to pass secondary legislation to accept the Article 50 extension

Open a doc from terminal, but not by its name

What does "Scientists rise up against statistical significance" mean? (Comment in Nature)

Why does a simple loop result in ASYNC_NETWORK_IO waits?

Multiplicative persistence

Why does AES have exactly 10 rounds for a 128-bit key, 12 for 192 bits and 14 for a 256-bit key size?

Biological Blimps: Propulsion



Check my DHCP lease?



2019 Community Moderator ElectionForce dhcp client to get a new leaseDHCP configuration for iPXEHow to know DHCP options value on debian/ubuntu and other linuxTesting DHCP range; multiple addresses per interfaceHow to skip DHCP if no cable connected to ethernet in Debianreset of a ubiquiti networks power ap - no loveWhen no dhcp server answer, how can I force dhclient to use the static lease from dhclient.conf instead of a previous dhcp lease?dhcp not setting FQDN hostname on centos 7 (no NetworkManager)Ubuntu 16.04 not getting dhcp leaseDHCP server does not include NTP server addresses in the DHCP ACK message










5















Is there a way to show my current (client) DHCP lease?



Or even better - retrieve all options/infos sent with DHCPACK?










share|improve this question



















  • 2





    /var/lib/dhcp/dhclient.leases?

    – heemayl
    May 20 '16 at 22:49











  • @heemayl this file is empty in my case (Ubuntu 15.10), maybe because NetworkManager is acquiring dhcp lease (?)

    – madneon
    May 20 '16 at 23:03











  • ipconfig getpacket <ifname> or ipconfig getv6packet <ifname> on Mac OS X.

    – thrig
    May 20 '16 at 23:21











  • @heemayl, Nope. No such file or directory

    – Cerin
    Nov 21 '17 at 21:46











  • @heemayl was correct for the directory. On Debian Stretch I found infos in "/var/lib/dhcp/dhclient.eth0.leases"

    – Larsen
    Nov 16 '18 at 11:58















5















Is there a way to show my current (client) DHCP lease?



Or even better - retrieve all options/infos sent with DHCPACK?










share|improve this question



















  • 2





    /var/lib/dhcp/dhclient.leases?

    – heemayl
    May 20 '16 at 22:49











  • @heemayl this file is empty in my case (Ubuntu 15.10), maybe because NetworkManager is acquiring dhcp lease (?)

    – madneon
    May 20 '16 at 23:03











  • ipconfig getpacket <ifname> or ipconfig getv6packet <ifname> on Mac OS X.

    – thrig
    May 20 '16 at 23:21











  • @heemayl, Nope. No such file or directory

    – Cerin
    Nov 21 '17 at 21:46











  • @heemayl was correct for the directory. On Debian Stretch I found infos in "/var/lib/dhcp/dhclient.eth0.leases"

    – Larsen
    Nov 16 '18 at 11:58













5












5








5


1






Is there a way to show my current (client) DHCP lease?



Or even better - retrieve all options/infos sent with DHCPACK?










share|improve this question
















Is there a way to show my current (client) DHCP lease?



Or even better - retrieve all options/infos sent with DHCPACK?







networking dhcp dhclient






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 20 '16 at 22:41







madneon

















asked May 20 '16 at 22:30









madneonmadneon

6281616




6281616







  • 2





    /var/lib/dhcp/dhclient.leases?

    – heemayl
    May 20 '16 at 22:49











  • @heemayl this file is empty in my case (Ubuntu 15.10), maybe because NetworkManager is acquiring dhcp lease (?)

    – madneon
    May 20 '16 at 23:03











  • ipconfig getpacket <ifname> or ipconfig getv6packet <ifname> on Mac OS X.

    – thrig
    May 20 '16 at 23:21











  • @heemayl, Nope. No such file or directory

    – Cerin
    Nov 21 '17 at 21:46











  • @heemayl was correct for the directory. On Debian Stretch I found infos in "/var/lib/dhcp/dhclient.eth0.leases"

    – Larsen
    Nov 16 '18 at 11:58












  • 2





    /var/lib/dhcp/dhclient.leases?

    – heemayl
    May 20 '16 at 22:49











  • @heemayl this file is empty in my case (Ubuntu 15.10), maybe because NetworkManager is acquiring dhcp lease (?)

    – madneon
    May 20 '16 at 23:03











  • ipconfig getpacket <ifname> or ipconfig getv6packet <ifname> on Mac OS X.

    – thrig
    May 20 '16 at 23:21











  • @heemayl, Nope. No such file or directory

    – Cerin
    Nov 21 '17 at 21:46











  • @heemayl was correct for the directory. On Debian Stretch I found infos in "/var/lib/dhcp/dhclient.eth0.leases"

    – Larsen
    Nov 16 '18 at 11:58







2




2





/var/lib/dhcp/dhclient.leases?

– heemayl
May 20 '16 at 22:49





/var/lib/dhcp/dhclient.leases?

– heemayl
May 20 '16 at 22:49













@heemayl this file is empty in my case (Ubuntu 15.10), maybe because NetworkManager is acquiring dhcp lease (?)

– madneon
May 20 '16 at 23:03





@heemayl this file is empty in my case (Ubuntu 15.10), maybe because NetworkManager is acquiring dhcp lease (?)

– madneon
May 20 '16 at 23:03













ipconfig getpacket <ifname> or ipconfig getv6packet <ifname> on Mac OS X.

– thrig
May 20 '16 at 23:21





ipconfig getpacket <ifname> or ipconfig getv6packet <ifname> on Mac OS X.

– thrig
May 20 '16 at 23:21













@heemayl, Nope. No such file or directory

– Cerin
Nov 21 '17 at 21:46





@heemayl, Nope. No such file or directory

– Cerin
Nov 21 '17 at 21:46













@heemayl was correct for the directory. On Debian Stretch I found infos in "/var/lib/dhcp/dhclient.eth0.leases"

– Larsen
Nov 16 '18 at 11:58





@heemayl was correct for the directory. On Debian Stretch I found infos in "/var/lib/dhcp/dhclient.eth0.leases"

– Larsen
Nov 16 '18 at 11:58










4 Answers
4






active

oldest

votes


















4














I used dhcpdump when I was testing DHCP. It will dump both sides of the DHCP transaction. If you leave it running it will log the options passed.



You may want to restart your DHCP client to see the initial negotiation. The renewal request should contain all the running configuration.






share|improve this answer






























    4














    I'm not aware of a way to query this information on the client. If you are on the server you can see information on the client leases in /var/lib/dhcp/dhclient.leases. From the client the only way i know is:



    sudo grep dhclient /var/log/syslog


    Which should give you something like:



    May 20 18:34:38 [machine_name] dhclient: DHCPREQUEST on eth0 to [DHCP_SERVER_IP] port 67
    May 20 18:34:38 [machine_name] dhclient: DHCPACK from [DHCP_SERVER_IP]
    May 20 18:34:38 [machine_name] dhclient: bound to [client_dhcp_ip] -- renewal in 1517 seconds.





    share|improve this answer






























      2














      depending on your distro, it should be located in /var/lib/dhcp under dhclient.interface.leases or /var/lib/dhclient.leases. you can also specify the path of your dhclient.leases file by passing -lf when starting dhclient.






      share|improve this answer























      • @madeon it should be under /var/lib/dhcp/dhclient.interface.leases e.g /var/lib/dhcp/dhclient.eth0.leases

        – RDCortez
        May 20 '16 at 23:08



















      0














      With NetworkManager use nmcli to query the DHCP status for your active connection (assuming one) with



      nmcli -f ipv4.method con show "`nmcli -t -f NAME connection `"


      Fot full DHCP information use -f DHCP4. Adjust for ipv6 as necessary.






      share|improve this answer








      New contributor




      jnas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.



















        Your Answer








        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "106"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f284550%2fcheck-my-dhcp-lease%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        4














        I used dhcpdump when I was testing DHCP. It will dump both sides of the DHCP transaction. If you leave it running it will log the options passed.



        You may want to restart your DHCP client to see the initial negotiation. The renewal request should contain all the running configuration.






        share|improve this answer



























          4














          I used dhcpdump when I was testing DHCP. It will dump both sides of the DHCP transaction. If you leave it running it will log the options passed.



          You may want to restart your DHCP client to see the initial negotiation. The renewal request should contain all the running configuration.






          share|improve this answer

























            4












            4








            4







            I used dhcpdump when I was testing DHCP. It will dump both sides of the DHCP transaction. If you leave it running it will log the options passed.



            You may want to restart your DHCP client to see the initial negotiation. The renewal request should contain all the running configuration.






            share|improve this answer













            I used dhcpdump when I was testing DHCP. It will dump both sides of the DHCP transaction. If you leave it running it will log the options passed.



            You may want to restart your DHCP client to see the initial negotiation. The renewal request should contain all the running configuration.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 21 '16 at 1:47









            BillThorBillThor

            7,7231426




            7,7231426























                4














                I'm not aware of a way to query this information on the client. If you are on the server you can see information on the client leases in /var/lib/dhcp/dhclient.leases. From the client the only way i know is:



                sudo grep dhclient /var/log/syslog


                Which should give you something like:



                May 20 18:34:38 [machine_name] dhclient: DHCPREQUEST on eth0 to [DHCP_SERVER_IP] port 67
                May 20 18:34:38 [machine_name] dhclient: DHCPACK from [DHCP_SERVER_IP]
                May 20 18:34:38 [machine_name] dhclient: bound to [client_dhcp_ip] -- renewal in 1517 seconds.





                share|improve this answer



























                  4














                  I'm not aware of a way to query this information on the client. If you are on the server you can see information on the client leases in /var/lib/dhcp/dhclient.leases. From the client the only way i know is:



                  sudo grep dhclient /var/log/syslog


                  Which should give you something like:



                  May 20 18:34:38 [machine_name] dhclient: DHCPREQUEST on eth0 to [DHCP_SERVER_IP] port 67
                  May 20 18:34:38 [machine_name] dhclient: DHCPACK from [DHCP_SERVER_IP]
                  May 20 18:34:38 [machine_name] dhclient: bound to [client_dhcp_ip] -- renewal in 1517 seconds.





                  share|improve this answer

























                    4












                    4








                    4







                    I'm not aware of a way to query this information on the client. If you are on the server you can see information on the client leases in /var/lib/dhcp/dhclient.leases. From the client the only way i know is:



                    sudo grep dhclient /var/log/syslog


                    Which should give you something like:



                    May 20 18:34:38 [machine_name] dhclient: DHCPREQUEST on eth0 to [DHCP_SERVER_IP] port 67
                    May 20 18:34:38 [machine_name] dhclient: DHCPACK from [DHCP_SERVER_IP]
                    May 20 18:34:38 [machine_name] dhclient: bound to [client_dhcp_ip] -- renewal in 1517 seconds.





                    share|improve this answer













                    I'm not aware of a way to query this information on the client. If you are on the server you can see information on the client leases in /var/lib/dhcp/dhclient.leases. From the client the only way i know is:



                    sudo grep dhclient /var/log/syslog


                    Which should give you something like:



                    May 20 18:34:38 [machine_name] dhclient: DHCPREQUEST on eth0 to [DHCP_SERVER_IP] port 67
                    May 20 18:34:38 [machine_name] dhclient: DHCPACK from [DHCP_SERVER_IP]
                    May 20 18:34:38 [machine_name] dhclient: bound to [client_dhcp_ip] -- renewal in 1517 seconds.






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered May 20 '16 at 22:55









                    user1794469user1794469

                    1,6421923




                    1,6421923





















                        2














                        depending on your distro, it should be located in /var/lib/dhcp under dhclient.interface.leases or /var/lib/dhclient.leases. you can also specify the path of your dhclient.leases file by passing -lf when starting dhclient.






                        share|improve this answer























                        • @madeon it should be under /var/lib/dhcp/dhclient.interface.leases e.g /var/lib/dhcp/dhclient.eth0.leases

                          – RDCortez
                          May 20 '16 at 23:08
















                        2














                        depending on your distro, it should be located in /var/lib/dhcp under dhclient.interface.leases or /var/lib/dhclient.leases. you can also specify the path of your dhclient.leases file by passing -lf when starting dhclient.






                        share|improve this answer























                        • @madeon it should be under /var/lib/dhcp/dhclient.interface.leases e.g /var/lib/dhcp/dhclient.eth0.leases

                          – RDCortez
                          May 20 '16 at 23:08














                        2












                        2








                        2







                        depending on your distro, it should be located in /var/lib/dhcp under dhclient.interface.leases or /var/lib/dhclient.leases. you can also specify the path of your dhclient.leases file by passing -lf when starting dhclient.






                        share|improve this answer













                        depending on your distro, it should be located in /var/lib/dhcp under dhclient.interface.leases or /var/lib/dhclient.leases. you can also specify the path of your dhclient.leases file by passing -lf when starting dhclient.







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered May 20 '16 at 23:03









                        RDCortezRDCortez

                        213




                        213












                        • @madeon it should be under /var/lib/dhcp/dhclient.interface.leases e.g /var/lib/dhcp/dhclient.eth0.leases

                          – RDCortez
                          May 20 '16 at 23:08


















                        • @madeon it should be under /var/lib/dhcp/dhclient.interface.leases e.g /var/lib/dhcp/dhclient.eth0.leases

                          – RDCortez
                          May 20 '16 at 23:08

















                        @madeon it should be under /var/lib/dhcp/dhclient.interface.leases e.g /var/lib/dhcp/dhclient.eth0.leases

                        – RDCortez
                        May 20 '16 at 23:08






                        @madeon it should be under /var/lib/dhcp/dhclient.interface.leases e.g /var/lib/dhcp/dhclient.eth0.leases

                        – RDCortez
                        May 20 '16 at 23:08












                        0














                        With NetworkManager use nmcli to query the DHCP status for your active connection (assuming one) with



                        nmcli -f ipv4.method con show "`nmcli -t -f NAME connection `"


                        Fot full DHCP information use -f DHCP4. Adjust for ipv6 as necessary.






                        share|improve this answer








                        New contributor




                        jnas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.
























                          0














                          With NetworkManager use nmcli to query the DHCP status for your active connection (assuming one) with



                          nmcli -f ipv4.method con show "`nmcli -t -f NAME connection `"


                          Fot full DHCP information use -f DHCP4. Adjust for ipv6 as necessary.






                          share|improve this answer








                          New contributor




                          jnas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






















                            0












                            0








                            0







                            With NetworkManager use nmcli to query the DHCP status for your active connection (assuming one) with



                            nmcli -f ipv4.method con show "`nmcli -t -f NAME connection `"


                            Fot full DHCP information use -f DHCP4. Adjust for ipv6 as necessary.






                            share|improve this answer








                            New contributor




                            jnas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.










                            With NetworkManager use nmcli to query the DHCP status for your active connection (assuming one) with



                            nmcli -f ipv4.method con show "`nmcli -t -f NAME connection `"


                            Fot full DHCP information use -f DHCP4. Adjust for ipv6 as necessary.







                            share|improve this answer








                            New contributor




                            jnas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.









                            share|improve this answer



                            share|improve this answer






                            New contributor




                            jnas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.









                            answered yesterday









                            jnasjnas

                            1011




                            1011




                            New contributor




                            jnas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.





                            New contributor





                            jnas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.






                            jnas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.



























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f284550%2fcheck-my-dhcp-lease%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

                                Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

                                Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.