Junos OS

 View Only
last person joined: yesterday 

Ask questions and share experiences about Junos OS.
  • 1.  configure dynamic NTP servers

    Posted 02-05-2020 05:50



    I came across this project and I would like to use them as my NTP servers.

    Now, this project consists out of 150+ NTP server so it would be list too long to use in my configuration in my opinion.

    How would I apply these 4 dynamic hostnames to serve as my NTP servers?

    Can't seem to find a wiki on how to do this.



  • 2.  RE: configure dynamic NTP servers

    Posted 02-05-2020 06:12



    why not using just pool.ntp.org as an NTP server inside the configuration? This address includes all of the other NTP servers, as far as I understand.

  • 3.  RE: configure dynamic NTP servers

    Posted 02-05-2020 06:25


    simply configure 0...4.<your-country-code>.pool.ntp.org NTP servers and you'll be all set. No need to try and reach all servers 😉



    P.S. Before going country specific you'd want to check "You can also use the continental zones (For example europenorth-americaoceania or asia.pool.ntp.org), and a country zone (like ch.pool.ntp.org in Switzerland) - for all these zones, you can again use the 0, 1 or 2 prefixes, like 0.ch.pool.ntp.org. Note, however, that the country zone might not exist for your country, or might contain only one or two timeservers.".

  • 4.  RE: configure dynamic NTP servers

    Posted 02-05-2020 06:59

    Hi Guys,


    If I configure pool.ntp.org or any of the other NL NTP servers then it directly translates to an IP address.

    This means I can go on for about 150 times setting 0--3.pool.ntp.org before having reached all current active NTP servers.

    Or am I wrong?

    Or would I just configure them 4 once and be set for life?



  • 5.  RE: configure dynamic NTP servers

    Posted 02-05-2020 07:34



    as https://www.ntppool.org/zone/nl says:


    To use this specific pool zone, add the following to your ntp.conf file:

    	   server 0.nl.pool.ntp.org
    	   server 1.nl.pool.ntp.org
    	   server 2.nl.pool.ntp.org
    	   server 3.nl.pool.ntp.org


    You don't want to try and sync with 150 servers in parallel, right?!!



  • 6.  RE: configure dynamic NTP servers
    Best Answer

    Posted 02-05-2020 07:51

    If you want to use just NL NTP servers, just configure these commands on your Junos device:


    set system ntp server 0.nl.pool.ntp.org

    set system ntp server 1.nl.pool.ntp.org

    set system ntp server 2.nl.pool.ntp.org

    set system ntp server 3.nl.pool.ntp.org


    You do not have to configure anything more.

  • 7.  RE: configure dynamic NTP servers

    Posted 04-12-2023 16:08

    For anyone else checking, it seems Junos only allows you to hard-code IP addresses as NTP servers.
    Per Juniper documentation "You must specify an address, not a hostname" 
    When you try ntp.org, it resolves the URL and hard-codes one of the returned IP addresses into the config.

    If I enter:

    set system ntp server 0.us.pool.ntp.org
    set system ntp server 1.us.pool.ntp.org
    set system ntp server 2.us.pool.ntp.org
    set system ntp server 3.us.pool.ntp.org

    This is what gets inserted into the config:

    set system ntp server
    set system ntp server
    set system ntp server
    set system ntp server

    Which worries me a bit because NTP.org member servers change frequently. From ntp.org's own stats, 2% of member servers 2 months ago are no longer active. Hopefully one of the four NTP servers I pulled at random will stay active for the lifetime of these switches. 

    Kyler H