DHCP Server IP Lease Timecode Problem (SOLVED)



  • By deafault, the ISC DHCP Server keeps lease times in UTC. However, you can easily change this behaviour and make it use local time instead simply by inserting:

    db-time-format local;

    into the dhcpd.conf file and restart the server. The problem is that pfSense 2.1.1 does not allow me to alter the contents of this file directly from the vi editor; yet on the other hand, there is no way for me to do this through the webGUI. Am I wrong? Is THERE a way? Or is this a bug? Plase help me. I have to be able to make DHCP keep lease times in local time, otherwise I will have struggled in vain.

    Thanks in advance.



  • @scilek:

    By deafault, the ISC DHCP Server keeps lease times in UTC. However, you can easily change this behaviour and make it use local time instead simply by inserting:

    db-time-format local;

    into the dhcpd.conf file and restart the server. The problem is that pfSense 2.1.1 does not allow me to alter the contents of this file directly from the vi editor; yet on the other hand, there is no way for me to do this through the webGUI. Am I wrong? Is THERE a way? Or is this a bug? Plase help me. I have to be able to make DHCP keep lease times in local time, otherwise I will have struggled in vain.

    Thanks in advance.

    Services -> DHCP Server

    Change DHCP display lease time from UTC to local time.
    Note: By default DHCP leases are displayed in UTC time. By checking this box DHCP lease time will be displayed in local time and set to time zone selected. This will be used for all DHCP interfaces lease time.



  • That option just converts the output time as required when being displayed on the GUI. The times stored in the real DHCP leases file are not changed. So if you want the "real internal" times that dhcpd is using to be different, there will be more thinking to do.
    Anyway, why do you need that?



  • In Turkey, a new law has been passed decreeing that all establishments that provide public access to the Internet (free or paid) are required to keep internal DHCP IP lease logs in a specific format. The timestamps must be in the local Europe/Istanbul time. The lease logs are then transferred into a text file, which is then signed by some government- written Windows application.

    I know very well that the ISC DHCP Server (4.2.5P-1) that comes with my pfSense 2.1.1 box DOES have an option for this very purpose. If you add:

    db-time-format local;

    to the dhcpd.conf file, it will start keeping lease logs in local time. If no option is provided, as in the default configuration, it will assume:

    db-time-format default;

    and just keep logs in UTC time. Please keep in mind that this is a server-wide option and NOT specific to any LAN.

    I know pfSense 2.1.1 does not allow direct modification of configuration files - which is /var/dhcpd/etc/dhcpd.conf in this case - but it doesn't provide any option to do this through the webGUI either. Please help me out. I am hopelessly stuck here. The whole thing will be useless without correct time stamps.


  • Banned

    So use System Patches package to patch it? (I don't care about stupid laws in the least, let alone have any desire to help them out with spying, so do your own investigation on what to patch how. The requirement that "timestamps must be in the local Europe/Istanbul time" speaks volumes about what kind of idiots those people are.)



  • I am sorry that you feel sour about the law, but the idea here is to prevent/eradicate anonymity on the Internet. I don't intend to get into a debate with anyone, I am only looking for a solution to a problem. At the end of the day, there MUST be a way to make the DHCP server log in local time.

    How do I add a system patch using the System Patches package?



  • @scilek:

    In Turkey, a new law has been passed decreeing that all establishments that provide public access to the Internet (free or paid) are required to keep internal DHCP IP lease logs in a specific format. The timestamps must be in the local Europe/Istanbul time. The lease logs are then transferred into a text file, which is then signed by some government- written Windows application.

    I know very well that the ISC DHCP Server (4.2.5P-1) that comes with my pfSense 2.1.1 box DOES have an option for this very purpose. If you add:

    db-time-format local;

    to the dhcpd.conf file, it will start keeping lease logs in local time. If no option is provided, as in the default configuration, it will assume:

    db-time-format default;

    and just keep logs in UTC time. Please keep in mind that this is a server-wide option and NOT specific to any LAN.

    I know pfSense 2.1.1 does not allow direct modification of configuration files - which is /var/dhcpd/etc/dhcpd.conf in this case - but it doesn't provide any option to do this through the webGUI either. Please help me out. I am hopelessly stuck here. The whole thing will be useless without correct time stamps.

    try to open /etc/inc/services.inc file with a text editor and find theese lines

    $dhcpdconf = << <eod<br>option domain-name "{$syscfg['domain']}";
    option ldap-server code 95 = text;
    option domain-search-list code 119 = text;
    {$custoptions}
    default-lease-time 7200;
    max-lease-time 86400;
    log-facility local7;
    ddns-update-style none;
    one-lease-per-client true;
    deny duplicates;
    ping-check true;

    EOD;</eod<br>

    you can add your custom line here, then when you save your dhcp settings, it will be written in the conf file
    (I did not try it, but I assume it will work)

    EDIT: with pfsense 2.0.3 I tried and it works, thank you for the tip by the way



  • :) It DID insert the entry into the file. Whether it will make the ISC DHCP Server behave the desired way remains to be seen.

    Thank you very much! Appreciated!



  • as soon as you disable and enable your adapter you will see it

    (ağ başdaştırıcını yenilediğin anda dhcp.leases dosyasına yerel zamanla düştüğünü göreceksin, ben denedim oldu)