Announcement

Collapse
No announcement yet.

Dhcp lease period

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Dhcp lease period

    My syslog shows a bunch of entries like this:

    Aug 14 10:10:03 jon-desktop dhclient: DHCPREQUEST of 192.168.1.13 on eth0 to 192.168.1.254 port 67
    Aug 14 10:10:03 jon-desktop dhclient: DHCPACK of 192.168.1.13 from 192.168.1.254
    Aug 14 10:10:03 jon-desktop dhclient: bound to 192.168.1.13 -- renewal in 1508 seconds.

    I take this to mean that the dhcp client has got a lease for 1508 seconds. Is that typical? It seems to me this period could be extended, especially seeing as how it always the same address (fortunately).

    This is a home network with 2 computers (one Kubuntu and one Windows 7) on a modem-router speaking (very low-speed, i.e. 512/64 kbps) ADSL on the other side. No shared printer. It is handy for the Windows computer to looks at web pages on the Linux one, so having the same IP address each time is essential.

    A propos, why is it always the same address and can I count on that?

    Thanks in advance.
    'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

    #2
    Re: Dhcp lease period

    DHCP Lease "Life Cycle" Overview (Allocation, Reallocation, Renewal, Rebinding and Release) and Lease Timers
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Re: Dhcp lease period

      Thanks, Snowhog. It looks like a good guide. On a quick run-thru, tho, I did not see where to configure the lease time. In my case, a lease of at least a day is reasonable, since both machiines are turned off every evening. So a lease time of ~1800 seconds is silly. So I want to change that.

      My /etc/dhcp/dhclient.conf file has a commented line

      #send dhcp-lease-time 3600;

      so I'm guessing I want to uncomment this and change 3600 to 24 times that.
      'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

      Comment


        #4
        Re: Dhcp lease period

        You can give that a try. But it may very likely be that your modem-router has it's own internal settings that it's using. You can attempt to access the modem-routers configuration interface - 192.168.1.1 - assuming that address is what it uses, and, that you know the userid and password.
        Windows no longer obstructs my view.
        Using Kubuntu Linux since March 23, 2007.
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          Re: Dhcp lease period

          Since the home network machines are not changing all the time, why not use static addresses? You can still leave DHCP available for the odd time when something different gets plugged in which you might not want to configure.

          Comment


            #6
            Re: Dhcp lease period

            Originally posted by Snowhog
            But it may very likely be that your modem-router has it's own internal settings that it's using.
            This. The DCHP lease period is controlled by the DHCP server.
            we see things not as they are, but as we are.
            -- anais nin

            Comment


              #7
              Re: Dhcp lease period

              Originally posted by wizard10000
              Originally posted by Snowhog
              But it may very likely be that your modem-router has it's own internal settings that it's using.
              This. The DCHP lease period is controlled by the DHCP server.
              Everything I have read talks about the DHCP client. Where is the DHCP server running? On my computer or on the router or on the ISF machine somewhere?
              'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

              Comment


                #8
                Re: Dhcp lease period

                Originally posted by joneall
                Everything I have read talks about the DHCP client. Where is the DHCP server running? On my computer or on the router or on the ISF machine somewhere?
                Usually it would be on your router. I notice you didn't answer Snowhog's question. Can you not log into it?

                You should be able to set an IP range for the DHCP. Just set it to something small like under 50 numbers or something, then use numbers outside of that for your computers so you don't have to worry about it.

                Comment


                  #9
                  Re: Dhcp lease period

                  Originally posted by Ole Juul
                  Usually it would be on your router. I notice you didn't answer Snowhog's question. Can you not log into it?

                  You should be able to set an IP range for the DHCP. Just set it to something small like under 50 numbers or something, then use numbers outside of that for your computers so you don't have to worry about it.
                  Sorry, I forgot. Yes, when it is working, I can log into the router. As for the IP range setting, I guess I have some more reading to do.

                  I am logged into the router's DHCP config page. I see the following parameters:

                  - router IP address (192.168.1.254)
                  - router subnet mask (255.255.255.0)
                  - DHCP start and end addresses (192.168.1.1, 192.168.1.253)
                  - DCHP server enable (enabled)
                  AND
                  - DCHP lease (1 hour!)

                  So why is my lease around 1600 seconds? Is that the default for a dhcp client?

                  To follow your suggestion, I guess I should set the DHCP end address to something like 192.168.1.50 and then assign my computers addresses above that. Do I do that in /etc/hosts (or c:\windows\system32\hosts)? After changing the addresses, is it enough to restart my network

                  sudo /etc/init.d/networking restart

                  or do I have to restart the computer?

                  Thanks again for your assistance. I really appreciate it.
                  'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

                  Comment


                    #10
                    Re: Dhcp lease period

                    Originally posted by joneall
                    Originally posted by Ole Juul
                    Usually it would be on your router. I notice you didn't answer Snowhog's question. Can you not log into it?

                    You should be able to set an IP range for the DHCP. Just set it to something small like under 50 numbers or something, then use numbers outside of that for your computers so you don't have to worry about it.
                    Sorry, I forgot. Yes, when it is working, I can log into the router. As for the IP range setting, I guess I have some more reading to do.

                    I am logged into the router's DHCP config page. I see the following parameters:

                    - router IP address (192.168.1.254)
                    - router subnet mask (255.255.255.0)
                    - DHCP start and end addresses (192.168.1.1, 192.168.1.253)
                    - DCHP server enable (enabled)
                    AND
                    - DCHP lease (1 hour!)

                    So why is my lease around 1600 seconds? Is that the default for a dhcp client?

                    To follow your suggestion, I guess I should set the DHCP end address to something like 192.168.1.50 and then assign my computers addresses above that. Do I do that in /etc/hosts (or c:\windows\system32\hosts)? After changing the addresses, is it enough to restart my network

                    sudo /etc/init.d/networking restart

                    or do I have to restart the computer?

                    Thanks again for your assistance. I really appreciate it.
                    enlarge first the lease time..
                    set the pool...

                    then restart your router and restart your network devices.

                    check if it works!

                    Comment


                      #11
                      Re: Dhcp lease period

                      Originally posted by joneall

                      Sorry, I forgot. Yes, when it is working, I can log into the router. As for the IP range setting, I guess I have some more reading to do.

                      I am logged into the router's DHCP config page. I see the following parameters:

                      - router IP address (192.168.1.254)
                      - router subnet mask (255.255.255.0)
                      - DHCP start and end addresses (192.168.1.1, 192.168.1.253)
                      - DCHP server enable (enabled)
                      AND
                      - DCHP lease (1 hour!)

                      So why is my lease around 1600 seconds? Is that the default for a dhcp client?

                      To follow your suggestion, I guess I should set the DHCP end address to something like 192.168.1.50 and then assign my computers addresses above that.
                      It sounds like you have some grip on it already.

                      If you do want to use static addressing. Yes, change the IP range in the router like you said. You could also leave it and use higher numbers for your static, but I personally prefer using a narrower range. It's a completely personal decision.

                      Do I do that in /etc/hosts (or c:\windows\system32\hosts)? After changing the addresses, is it enough to restart my network

                      sudo /etc/init.d/networking restart

                      or do I have to restart the computer?

                      Thanks again for your assistance. I really appreciate it.
                      The information goes in /etc/network/interfaces and should look something like this:

                      auto eth0
                      iface eth0 inet static
                      address 192.168.1.51
                      netmask 255.255.255.0
                      gateway 192.168.1.254


                      Then you need to put the nameserver addresses in the /etc/resolv.conf file which only needs one line for each nameserver which looks like this

                      nameserver 208.67.222.222

                      Add more (similar) lines if you need it. Then restart networking as you said. You don't need to reboot.

                      Regarding the lease time, I think you need to decide for yourself if that number is OK. It looks fine to me and I wouldn't bother changing it. Also I don't know how to set static addressing on the MS-Windows machine, but I guess you have that figured out yourself.

                      BTW, in case I got something wrong, check Detonate's FAQ on networking

                      Comment


                        #12
                        Re: Dhcp lease period

                        I just checked my router, and the default lease time there is 1 day. Also, my IP hasn't changed since I signed up some years ago, although it isn't static, but that is on the ISP side. I thought you might want to know.

                        Like I said it is probably not important for home situations like this, although on the other side of your router the ISP might have a legitimate concern with their lease time. However you won't be able to change that. The one you will be changing is the one which is operating on your own address range only. Because of the size of your network, you are not going to run out of address space from different machines coming on and off like your ISP might, so you could have a long time like a day or so, but AFAIK there is absolutely no disadvantage to having it renew every hour or less.

                        The TCP/IP Guide has a technical explanation of how lease times work.

                        Comment


                          #13
                          Re: Dhcp lease period

                          If you want to do static addressing there are two ways to do it.

                          One way is to hard-code an IP address on the machine that's on the same subnet but outside the DHCP scope.

                          Another (and this is the one I prefer) is to create a MAC reservation on the DHCP server and assign the IP address that way. That way all your devices get their IP address from the same place and you don't have to remember what's configured where.
                          we see things not as they are, but as we are.
                          -- anais nin

                          Comment

                          Working...
                          X