문서 편집 권한이 없습니다. 다음 이유를 확인해주세요: 요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다: 사용자. 문서의 원본을 보거나 복사할 수 있습니다. __FORCETOC__ === ntp === The Network Time Protocol (NTP) is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks.<ref>https://en.wikipedia.org/wiki/Network_Time_Protocol</ref> {{note|Note that the system has already an NTP server that is "ntp.ubuntu.com".}} ==== Verifying NTP ==== To verify the NTP servers, enter <code>show ntp server</code> in the user mode. If none of the servers exists, it indicates that there are no NTP servers except for the default. LYSH@MyHostName# show ntp servers To show the status of the Time synchronization, <code>show ntp status</code> in the user mode. It shows the status of, when, and where the time was synchronized. <pre> LYSH@MyHostName# show ntp status ● systemd-timesyncd.service - Network Time Synchronization Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2021-04-27 13:12:30 KST; 10s ago Docs: man:systemd-timesyncd.service(8) Main PID: 18992 (systemd-timesyn) Status: "Connecting to time server [2001:67c:1560:8003::c8]:123 (ntp.ubuntu.com)." Tasks: 2 (limit: 9387) Memory: 1.6M CGroup: /system.slice/systemd-timesyncd.service └─18992 /lib/systemd/systemd-timesyncd </pre> You can also verify the Time synchronization by using the <code>show datetime</code> commmand. <pre> LYSH@MyHostName# show datetime Local time: Tue 2021-04-27 13:32:46 KST Universal time: Tue 2021-04-27 04:32:46 UTC RTC time: Tue 2021-04-27 04:32:46 Time zone: Asia/Seoul (KST, +0900) System clock synchronized: yes NTP service: active RTC in local TZ: no </pre> ==== add / delete ==== You can configure the NTP servers. If you add an NTP server, the system synchronizes the time using added NTP server. If the Time synchronization failed from a server, the system tries to the next server. <pre> LYSH@MyHostName# configure configure# ntp add asia.pool.ntp.org configure# exit LYSH@MyHostName# show ntp servers NTP Servers : asia.pool.ntp.org </pre> You can see the status of the time synchronization to a time server by the <code>show ntp status</code> command. If the "Status" shows "Idle", it indicates the system couldn't synchronize to one of the NTP servers. <pre> LYSH@MyHostName# show ntp status ● systemd-timesyncd.service - Network Time Synchronization Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2021-04-27 13:10:36 KST; 12s ago Docs: man:systemd-timesyncd.service(8) Main PID: 18321 (systemd-timesyn) Status: "Initial synchronization to time server 157.119.108.165:123 (asia.pool.ntp.org)." Tasks: 2 (limit: 9387) Memory: 1.6M CGroup: /system.slice/systemd-timesyncd.service └─18321 /lib/systemd/systemd-timesyncd </pre> To remove one of the NTP servers, enter the <code>ntp delete {ntp-server-name}</code> in the configuration mode. <pre> LYSH@MyHostName# configure configure# ntp delete asia.pool.ntp.org configure# exit </pre> ==== enable / disable ==== You can disable the System clock synchronizing using the NTP server. <pre> LYSH@MyHostName# configure configure# ntp disable Local time: Tue 2021-04-27 10:26:03 KST Universal time: Tue 2021-04-27 01:26:03 UTC RTC time: Tue 2021-04-27 01:26:03 Time zone: Asia/Seoul (KST, +0900) System clock synchronized: no NTP service: inactive RTC in local TZ: no </pre> You can also enable it. The status of the "System clock synchronized" may show "inactive" for a while after enabling the NTP and the status will be changed to "active" in few seconds. <pre> LYSH@MyHostName# configure configure# ntp enable Local time: Tue 2021-04-27 10:26:03 KST Universal time: Tue 2021-04-27 01:26:03 UTC RTC time: Tue 2021-04-27 01:26:03 Time zone: Asia/Seoul (KST, +0900) System clock synchronized: active NTP service: active RTC in local TZ: no </pre> === References === 이 문서에서 사용한 틀: 틀:Note (원본 보기) CLI - NTP 문서로 돌아갑니다.