OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 18.7 Legacy Series »
  • NTP on DHCP
« previous next »
  • Print
Pages: [1]

Author Topic: NTP on DHCP  (Read 3629 times)

dwasifar

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 3
    • View Profile
NTP on DHCP
« on: October 22, 2018, 06:23:46 pm »
If I have NTP server and DHCP server both active, will OPNsense automatically tell DHCP clients to use its NTP service?  Or do I have to specify that manually by putting the OPNsense interface address in the NTP server section of DHCP configuration?
Logged

guest19228

  • Guest
Re: NTP on DHCP
« Reply #1 on: October 24, 2018, 02:37:20 am »
you have to specify the ntp servers. If you do not, your /var/dhcpd/etc/dhcpd.conf will look like this
Code: [Select]
option domain-name "domain.tld";
option ldap-server code 95 = text;
option arch code 93 = unsigned integer 16; # RFC4578
option pac-webui code 252 = text;

default-lease-time 7200;
max-lease-time 86400;
log-facility local7;
one-lease-per-client true;
deny duplicates;
ping-check true;
update-conflict-detection false;
authoritative;

subnet 192.168.5.0 netmask 255.255.255.0 {
  pool {
    range 192.168.5.100 192.168.5.250;
  }

  option routers 192.168.5.1;
  option domain-name-servers 192.168.5.1;
}
You see the option for the ntp servers is not in the file so the dhcp server will not provide it. And now lets specify ntp servers lease time domain searhc list and so on.
The resulting  /var/dhcpd/etc/dhcpd.conf now looks like that:
Code: [Select]
option domain-name "domain.tld";
option ldap-server code 95 = text;
option arch code 93 = unsigned integer 16; # RFC4578
option pac-webui code 252 = text;

default-lease-time 7200;
max-lease-time 86400;
log-facility local7;
one-lease-per-client true;
deny duplicates;
ping-check true;
update-conflict-detection false;
authoritative;

subnet 192.168.5.0 netmask 255.255.255.0 {
  pool {
    range 192.168.5.100 192.168.5.250;
  }

  option routers 192.168.5.1;
  option domain-search "somedomain.tld";
  option domain-name-servers 192.168.5.1;
  default-lease-time 300;
  max-lease-time 600;
  option ntp-servers 192.168.5.1,192.168.178.1;
}
You see the ntp server option is now included in the config file and so the dhcp server will provide them to the clients. If the clients will use that option depends on the client configuration.
Logged

dwasifar

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 3
    • View Profile
Re: NTP on DHCP
« Reply #2 on: October 24, 2018, 06:07:18 pm »
Thanks.  :)  Up and operating.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 18.7 Legacy Series »
  • NTP on DHCP
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2