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

    Dhclient wants to renew resolv.conf every 60 seconds for WAN

    Scheduled Pinned Locked Moved DHCP and DNS
    21 Posts 3 Posters 3.8k 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 Offline
      johnpoz LAYER 8 Global Moderator
      last edited by

      They have added some advanced stuff to dhcp client options.. And you can request stuff, etc.. But I have not had time to play with it..  I would not suggest over riding what they give you for a lease locally because they would just drop the lease on their end if not renewed..  And then someone else could get your same IP and that would cause problems

      You can try requesting specific setting.. But if they do not comply you prob best to call them..

      This is a FREE isp??  Anyone can use it?  If so that might explain really really short leases – they have limited IP space and want to make sure if your not on you loose your 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

      1 Reply Last reply Reply Quote 0
      • F Offline
        flgk
        last edited by

        Free is the name of my ISP, they have plenty IPs but they gives static IPs only for their subscribers located in areas where the telephone exchange is "dégroupé" means they have their own DSLAMs and I'm located where the telephone exchange is held by the historical ISP, so Free have decided to assign dynamic IP for customers which are not connected to their devices…

        Their modem (at home) distribute the public IP for the first network card which ask it, so anything I connect on their modem will receive the same public IP (and there'll be a conflict) it's not a PPP connection on pfsense.
        Of course I've disabled routing on their modem.

        I have the possibility to ask them a static IP, but I would prefer try to solve this issue using software. The other solution is to use a NAT behind pfsense but it's not very clean.

        Do you have any idea to "hack" the dhcp leases ? Why do I get so much leases on /var/db/dhclient.leases.* ?

        1 Reply Last reply Reply Quote 0
        • D Offline
          doktornotor Banned
          last edited by

          Your ISP are positively a bunch of clueless idiots. There are advanced settings for DHCP client, but I very much doubt they'll be honored. (By default, 7200 secs lease is requested when those advanced settings are untouched. You are getting 10 minutes and even 1 minute renewal time!!! Totally crazy!!! ISP => full retard!!!

          1 Reply Last reply Reply Quote 0
          • F Offline
            flgk
            last edited by

            @doktornotor:

            Your ISP are positively a bunch of clueless idiots. There are advanced settings for DHCP client, but I very much doubt they'll be honored. (By default, 7200 secs lease is requested when those advanced settings are untouched. You are getting 10 minutes and even 1 minute renewal time!!! Totally crazy!!! ISP => full retard!!!

            Indeed ;D

            What about the field "Option modifiers" in advanced settings of WAN ? is there a way to override anyway the renewal ?

            The perfect configuration would a large lease, and when the gateway is down within the lease, let dhclient trying to renew its lease. The IP address changes is on 24 hours after the modem has got the ADSL link, again a crazy rule

            1 Reply Last reply Reply Quote 0
            • D Offline
              doktornotor Banned
              last edited by

              I think these are just useless for you. With this kind of settings, they'll hand out your "24hours" IP to anyone as soon as you fail to renew the lease on those preset idiotic intervals. Request a static IP or switch ISPs, I'd say.

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

                Again you can not just go changing your end of what the dhcp server gave you.. If it gave you a lease of X and you tell your client no use Y that is longer than X your most likely going to run into problems.

                As to why you might see more than one entry in leases.. Could be other dhcp servers..  Could be that you did a reboot or something of pfsense and just got a new lease vs renew of old one..  Lots of reasons..  I don't think there is any code to clean up that leases file ever?  Guess you could do it manually if bothered you?

                So I deleted everything in the file and then released and renewed my wan and now just show one lease

                [2.2.4-RELEASE][root@pfSense.local.lan]/root: cat /var/db/dhclient.leases.em0
                lease {
                  interface "em0";
                  fixed-address 24.13.x.x;
                  option subnet-mask 255.255.248.0;
                  option routers 24.13.x.x;
                  option domain-name-servers 75.75.75.75,75.75.76.76;
                  option host-name "pfSense";
                  option domain-name "hsd1.il.comcast.net.";
                  option broadcast-address 255.255.255.255;
                  option dhcp-lease-time 176803;
                  option dhcp-message-type 5;
                  option dhcp-server-identifier 69.252.202.7;
                  renew 1 2015/8/31 14:34:06;
                  rebind 2 2015/9/1 08:59:06;
                  expire 2 2015/9/1 15:07:28;
                }
                [2.2.4-RELEASE][root@pfSense.local.lan]/root:

                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
                • D Offline
                  doktornotor Banned
                  last edited by

                  The history on those lease files is kept by design.

                  dhclient.conf(5)

                  
                       The DHCP client may decide after some period of time (see PROTOCOL
                       TIMING) that it is	not going to succeed in contacting a server.  At that
                       time, it consults its own database	of old leases and tests each one that
                       has not yet timed out by pinging the listed router	for that lease to see
                       if	that lease could work.
                  
                  
                  1 Reply Last reply Reply Quote 0
                  • F Offline
                    flgk
                    last edited by

                    Done, now I have a static IP (it's been a while that I had to do it) I will disable DHCP on WAN, but the problem of short leases is still ongoing with pfsense.

                    @johnpoz No, every entry are (was) for the WAN.

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      doktornotor Banned
                      last edited by

                      What short leases? Shouldn't have your WAN set up as DHCP at all when your IP is static. You need to get rid of DHCP altogether with this ISP.

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

                        Yeah if you setup wan as static there wouldn't be any dhcp client doing anything for that interface.

                        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.