Network Time Protocol

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 14:56, 20 December 2008 (edit)
Wlindley (Talk | contribs)
m (Punctuation)
← Previous diff
Current revision (09:15, 17 December 2019) (edit) (undo)
Atatob (Talk | contribs)
m (Add language list)
 
(9 intermediate revisions not shown.)
Line 1: Line 1:
 +{{Languages|Network Time Protocol}}
__TOC__ __TOC__
-NTP Client (Network Time Protocol) is the software client that allows your router to synchronize with an available time server. You can access this setting by going to "Administration" > "Management". Your router's current time is listed in the upper right hand corner of the Web GUI when you log in to your router. Certain features such as "Access Restrictions" will not function if the router hasn't synchronized with a time server. And if it has synchronized but the time has not been adjusted for your time zone, you may have unexpected behavior. You cannot set your time manually, and must do it via NTP. Don't be fooled by the time zone settings located at "Setup" > "Basic Setup" > "Time Settings". These settings are only to adjust the synchronized time from the server to match your local time.+NTP Client (Network Time Protocol) is the software client that allows your router to synchronize with an available time server. Your router's current time is listed in the upper right hand corner of the Web GUI when you log in to your router. Certain features such as "Access Restrictions" and the "Traffic by Month" graph will not function if the router hasn't synchronized with a time server. And if it has synchronized but the time has not been adjusted for your time zone, you may see unexpected behavior. You cannot set your time manually, and must do it via NTP. Don't be fooled by the time zone setting located at "Setup" > "Basic Setup" > "Time Settings". This setting alone is only to adjust the synchronized time from the server to match your local time.
As Brainslayer states '''"If NTP is disabled the time starts at zero which is 1 January 1970"'''. As Brainslayer states '''"If NTP is disabled the time starts at zero which is 1 January 1970"'''.
-You may be wondering if you can just manually set the time on your router and then forget about it. The answer is no, but you can set it to synchronize with a public time server using the NTP client and then forget about it. To configure the NTP client, log into the router and go to "Administration" > "Management". Select "Enable" under the NTP client heading and enter the domain name or IP address of the time server you have selected. (See list below.) Don't forget to save the settings.+As mentioned, you cannot just manually set the time on your router and then forget about it. You can, however, set it to synchronize with a public time server using the NTP client and then forget about it. To configure the NTP client, log into the router and go to "Setup" > "Basic Setup" > "Time Settings". Now:<br />
 +<br />
 +1) Select "Enable" next to NTP Client<br />
 +2) Choose the appropriate Time Zone for your area<br />
 +3) Set Summer Time (DST) as appropriate (See Time Zone settings below)<br />
 +4) Enter the domain name or IP address of the time server you have selected (See Time Servers below)<br />
 +<br />
 +Don't forget to Save and Apply settings.<br />
 +<br />
 +How often does NTP synchronize? According to redhawk0, it is ''"checked at boot up...then after 120 seconds for a second time....that's it."''<br />http://www.dd-wrt.com/phpBB2/viewtopic.php?p=419797#419797<br /><br />
 +Have the clocks just changed in your area but you find that DD-WRT is still an hour behind/ahead? Open a Telnet/SSH command prompt and run these three commands:<br /><br />
 +ntpclient pool.ntp.org<br />
 +stopservice process_monitor<br />
 +startservice process_monitor<br />
-Next you should configure your router to adjust the synchronized time from the time server to match your local time, go to "Setup" > "Basic Setup" > "Time Settings" and tick "Use Local Time". Next, select the correct time zone from the drop-down menu. Don't forget to save the settings (the router will reboot).+Courtesy: http://www.dd-wrt.com/phpBB2/viewtopic.php?p=271968#271968<br /><br />
- +
-How often does the NTP synchronize? It will try every 30 seconds until the clock is set, then it will synchronize every 3600 seconds (1 hour). For users of ISDN and similar "Pay-Per-Minute" or "Pay-To-Connect" type Internet connections, you might get a huge bill if your router hasn't been able to synchronize properly and has been trying every 30 seconds.+
- +
-''(It appears that a time server might be hard-coded into the DD-WRT firmware. If you enable the NTP client (that's the default setting) but leave the NTP server field blank, your router will synchronize anyway. One forum poster has reported a time server (ntp2.usno.navy.mil) in his config file. Brainslayer is mum on the issue.)''+
 +'''Note:''' ''A time server is hard-coded into the DD-WRT firmware. If you enable the NTP Client (that's the default setting) but leave the Server IP/Name field blank, your router will synchronize anyway. One forum poster has reported a time server (ntp2.usno.navy.mil) in his config file. Brainslayer is mum on the issue.''
 +<br />
=Time Servers= =Time Servers=
-It's recommended to use the closest one available to reduce Internet traffic.+It's recommended to use the closest one available to reduce Internet traffic. You can find the up-to-date pool address for your area/country at http://www.pool.ntp.org/. Examples are provided here for a number of areas:
'''North America'''<br /> '''North America'''<br />
Line 37: Line 49:
'''Germany'''<br /> '''Germany'''<br />
de.pool.ntp.org<br /> de.pool.ntp.org<br />
 +
 +'''Lithuania'''<br />
 +ntp1.litnet.lt<br />
 +ntp2.litnet.lt<br />
'''Netherlands'''<br /> '''Netherlands'''<br />
Line 43: Line 59:
'''United Kingdom'''<br /> '''United Kingdom'''<br />
uk.pool.ntp.org<br /> uk.pool.ntp.org<br />
 +
 +'''Switzerland'''<br />
 +swisstime.ethz.ch<br />
 +
===Time Zone Settings=== ===Time Zone Settings===
Line 69: Line 89:
Germany<br> Germany<br>
UTC+01:00 /last Sun Mar - Last Oct UTC+01:00 /last Sun Mar - Last Oct
 +
 +Lithuania<br>
 +UTC+02:00 /last Sun Mar - Last Oct
Netherlands<br> Netherlands<br>
Line 78: Line 101:
==Troubleshooting== ==Troubleshooting==
You've followed the instructions to get your router's time/clock synchronized but the time is still blank or incorrect. You probably have one of three problems: You've followed the instructions to get your router's time/clock synchronized but the time is still blank or incorrect. You probably have one of three problems:
-* (A) Your router isn't resolving the domain name for the NTP server. Try entering the correct corresponding IP Address in the NTP server field instead of the domain name. If this fixes your problem, you have a DNS issue that will need to be resolved.+* (A) Your router doesn't have a valid default route to your gateway. This is particularly a common problem for WDS/CB/RB/WAP configurations which disable the WAN so they don't get a gateway automatically set. Make sure to set the gateway IP in the basic settings to be the main router's IP that will be serving internet to your router. You should be able to [[Telnet/SSH]] to your router and then ping internet IP's from your router.
-* (B) You've selected the wrong time zone settings from the drop down menu on "Setup" > "Basic Setup" > "Time Settings" or forgot to check "Use Local Time" (on the same page).+* (B) Your router isn't resolving the domain name for the NTP server. Try entering the correct corresponding IP Address in the NTP server field instead of the domain name. If this fixes your problem, you have a DNS issue that will need to be resolved by setting your Local DNS to a valid DNS server IP. You should be able to [[Telnet/SSH]] to your router and then ping internet domain names from your router.
-* (C) Some part of your router is configured in such a way that the NTP Client can't "see" the Internet. If your router does not use the WAN port for it's Internet connection, you may need to setup a static route in the advanced routing section.+* (C) You've selected the wrong time zone settings from the drop down menu on "Setup" > "Basic Setup" > "Time Settings".
- +
-"Setup" -> "Advanced Routing"<br>+
-* Route Name = NTP (your choice of names)+
-* Destination LAN IP = IP address of NTP Server+
-* Subnet Mask 255.255.255.0+
-* Default Gateway = IP Address of gateway (must be visible to this router)+
- +
-"Administration" -> "Management"<br />+
-* NTP Server = IP address of NTP Server (must match what you just used in your routing rule)+
- +
-It appears that the NTP client always uses the WAN port with one exception: If you've entered a default gateway on "Setup" > "Basic Setup" > "Network Setup" > "Gateway", your router will attempt to use that gateway to access the Internet and synchronize with the NTP server.+
=External Links= =External Links=
http://www.pool.ntp.org/ Official NTP Site http://www.pool.ntp.org/ Official NTP Site
-[[Category: English documentation]]+[[Category:Applications]]

Current revision

Contents

NTP Client (Network Time Protocol) is the software client that allows your router to synchronize with an available time server. Your router's current time is listed in the upper right hand corner of the Web GUI when you log in to your router. Certain features such as "Access Restrictions" and the "Traffic by Month" graph will not function if the router hasn't synchronized with a time server. And if it has synchronized but the time has not been adjusted for your time zone, you may see unexpected behavior. You cannot set your time manually, and must do it via NTP. Don't be fooled by the time zone setting located at "Setup" > "Basic Setup" > "Time Settings". This setting alone is only to adjust the synchronized time from the server to match your local time.

As Brainslayer states "If NTP is disabled the time starts at zero which is 1 January 1970".

As mentioned, you cannot just manually set the time on your router and then forget about it. You can, however, set it to synchronize with a public time server using the NTP client and then forget about it. To configure the NTP client, log into the router and go to "Setup" > "Basic Setup" > "Time Settings". Now:

1) Select "Enable" next to NTP Client
2) Choose the appropriate Time Zone for your area
3) Set Summer Time (DST) as appropriate (See Time Zone settings below)
4) Enter the domain name or IP address of the time server you have selected (See Time Servers below)

Don't forget to Save and Apply settings.

How often does NTP synchronize? According to redhawk0, it is "checked at boot up...then after 120 seconds for a second time....that's it."
http://www.dd-wrt.com/phpBB2/viewtopic.php?p=419797#419797

Have the clocks just changed in your area but you find that DD-WRT is still an hour behind/ahead? Open a Telnet/SSH command prompt and run these three commands:

ntpclient pool.ntp.org
stopservice process_monitor
startservice process_monitor

Courtesy: http://www.dd-wrt.com/phpBB2/viewtopic.php?p=271968#271968

Note: A time server is hard-coded into the DD-WRT firmware. If you enable the NTP Client (that's the default setting) but leave the Server IP/Name field blank, your router will synchronize anyway. One forum poster has reported a time server (ntp2.usno.navy.mil) in his config file. Brainslayer is mum on the issue.

[edit] Time Servers

It's recommended to use the closest one available to reduce Internet traffic. You can find the up-to-date pool address for your area/country at http://www.pool.ntp.org/. Examples are provided here for a number of areas:

North America
0.north-america.pool.ntp.org
1.north-america.pool.ntp.org
2.north-america.pool.ntp.org

United States
0.us.pool.ntp.org
1.us.pool.ntp.org
2.us.pool.ntp.org

Canada
0.ca.pool.ntp.org
1.ca.pool.ntp.org
2.ca.pool.ntp.org

Europe
0.europe.pool.ntp.org
1.europe.pool.ntp.org
2.europe.pool.ntp.org

Germany
de.pool.ntp.org

Lithuania
ntp1.litnet.lt
ntp2.litnet.lt

Netherlands
nl.pool.ntp.org

United Kingdom
uk.pool.ntp.org

Switzerland
swisstime.ethz.ch


[edit] Time Zone Settings

Since 2007 in the US and parts of Canada, Daylight Savings Time (DST) begins on the second Sunday of March and end the first Sunday of November. The EU uses the "last Sun Mar - last Sun Oct". (Note: UTC stands for Coordinated Universal Time).

United States
Eastern Time Zone
UTC-05:00 /2nd Sun Mar - first Sun Nov

Central Time Zone
UTC-06:00 /2nd Sun Mar - first Sun Nov

Mountain Time Zone
UTC-07:00 /2nd Sun Mar - first Sun Nov

Pacifiic Time Zone
UTC-08:00 /2nd Sun Mar - first Sun Nov

Hawaii Time Zone
UTC-10:00 /none

Europe
France
UTC+01:00 /last Sun Mar - Last Oct

Germany
UTC+01:00 /last Sun Mar - Last Oct

Lithuania
UTC+02:00 /last Sun Mar - Last Oct

Netherlands
UTC+01:00 /last Sun Mar - Last Oct

United Kingdom
UTC /last Sun Mar - last Sun Oct

[edit] Troubleshooting

You've followed the instructions to get your router's time/clock synchronized but the time is still blank or incorrect. You probably have one of three problems:

  • (A) Your router doesn't have a valid default route to your gateway. This is particularly a common problem for WDS/CB/RB/WAP configurations which disable the WAN so they don't get a gateway automatically set. Make sure to set the gateway IP in the basic settings to be the main router's IP that will be serving internet to your router. You should be able to Telnet/SSH to your router and then ping internet IP's from your router.
  • (B) Your router isn't resolving the domain name for the NTP server. Try entering the correct corresponding IP Address in the NTP server field instead of the domain name. If this fixes your problem, you have a DNS issue that will need to be resolved by setting your Local DNS to a valid DNS server IP. You should be able to Telnet/SSH to your router and then ping internet domain names from your router.
  • (C) You've selected the wrong time zone settings from the drop down menu on "Setup" > "Basic Setup" > "Time Settings".

[edit] External Links

http://www.pool.ntp.org/ Official NTP Site