{"id":267886,"date":"2023-03-24T06:12:44","date_gmt":"2023-03-23T22:12:44","guid":{"rendered":"https:\/\/lrxjmw.cn\/nxsfwqfwqtgz.html"},"modified":"2023-03-24T06:12:44","modified_gmt":"2023-03-23T22:12:44","slug":"nxsfwqfwqtgz","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/nxsfwqfwqtgz.html","title":{"rendered":"NTP\u6821\u65f6\u670d\u52a1\u5668\u670d\u52a1\u5668\u63d0\u4f9b\u51c6\u786e\u65f6\u95f4\uff0c\u9632\u6b62\u6076\u6bd2\u7684\u534f\u8bae\u653b\u51fb"},"content":{"rendered":"
NTP(NetworkTimeProtocol)\u7f51\u8def\u65f6\u95f4\u5408\u540c\uff0c\u5de5\u4f5c\u5728UDP\u7684123\u7aef\u53e3\u4e0a\u3002\u662f\u62ff\u6765\u4f7f\u8ba1\u7b97\u673a\u65f6\u95f4\u540c\u6b65\u5316\u7684\u4e00\u79cd\u5408\u540c\uff0c\u5b83\u53ef\u4ee5\u4f7f\u8ba1\u7b97\u673a\u5bf9\u5176\u670d\u52a1\u5668\u6216\u65f6\u949f\u6e90\uff08\u5982\u77f3\u82f1\u949f\uff0cGPS\u7b49\u7b49)\u505a\u540c\u6b65\u5316\uff0c\u5b83\u53ef\u4ee5\u63d0\u4f9b\u9ad8\u7cbe\u51c6\u5ea6\u7684\u65f6\u95f4\u6821\u51c6\uff08\u5c40\u57df\u7f51\u4e0a\u4e0e\u6807\u51c6\u95f4\u5dee\u5927\u4e8e1\u5fae\u79d2\uff0c\u4e92\u8054\u7f51\u4e0a\u51e0\u5341\u7eb3\u79d2\uff09\uff0c\u4e14\u53ef\u4ecb\u7531\u52a0\u5bc6\u786e\u8ba4\u7684\u65b9\u6cd5\u6765\u907f\u514d\u72e0\u6bd2\u7684\u5408\u540c\u529f\u51fb\u3002<\/p>\n
<\/p>\n
NTP\u670d\u52a1\u5668<\/p>\n
NTP\u670d\u52a1\u5668\u63d0\u4f9b\u786e\u5207\u65f6\u95f4\uff0c\u9996\u5148\u8981\u6709\u786e\u5207\u7684\u65f6\u95f4\u6765\u6e90\uff0c\u8fd9\u4e00\u65f6\u95f4\u5e94\u5f53\u662f\u56fd\u9645\u6807\u51c6\u65f6\u95f4UTC\u3002NTP\u83b7\u5f97UTC\u7684\u65f6\u95f4\u6765\u6e90\u53ef\u4ee5\u662f\u539f\u5b50\u949f\u3001\u5929\u6587\u53f0\u3001\u536b\u661f\uff0c\u4e5f\u53ef\u4ee5\u4eceInternet\u4e0a\u83b7\u53d6\u3002\u8fd9\u6837\u5c31\u6709\u4e86\u786e\u5207\u800c\u53ef\u9760\u7684\u65f6\u95f4\u6e90\u3002\u65f6\u95f4\u6309NTP\u670d\u52a1\u5668\u7684\u7b49\u7ea7\u4f20\u64ad\u3002\u6839\u636e\u79bb\u5916\u90e8UTC\u6e90\u7684\u8fdc\u8fd1\u5c06\u6240\u6709\u670d\u52a1\u5668\u5212\u5165\u4e0d\u540c\u7684Stratum\uff08\u5c42\uff09\u4e2d\u3002Stratum-1\u5728\u9876\u697c\uff0c\u6709\u5916\u90e8UTC\u63a5\u5165\uff0c\u800cStratum-2\u5219\u4eceStratum-1\u83b7\u53d6\u65f6\u95f4\uff0cStratum-3\u4eceStratum-2\u83b7\u53d6\u65f6\u95f4\uff0c\u4ee5\u8fd9\u79cd\u63a8linux makefile\uff0c\u4f46Stratum\u5c42\u7684\u603b\u91cf\u9650\u5236\u572815\u4ee5\u5185\u3002\u6240\u6709\u8fd9\u79cd\u670d\u52a1\u5668\u5728\u903b\u8f91\u4e0a\u4ea7\u751f\u9636\u68af\u5f0f\u7684\u6784\u67b6\u4e92\u76f8\u8054\u63a5\uff0c\u800cStratum-1\u7684\u65f6\u95f4\u670d\u52a1\u5668\u662f\u6574\u4e2a\u7cfb\u7edf<\/a>\u7684\u57fa\u7840\u3002<\/p>\n \u8ba1\u7b97\u673a\u4e3b\u673a\u901a\u5e38\u540c\u591a\u4e2a\u65f6\u95f4\u670d\u52a1\u5668\u8054\u63a5\uff0c\u501f\u52a9\u7edf\u8ba1\u5b66\u7684\u7b97\u6cd5\u8fc7\u6ee4\u6765\u81ea\u4e0d\u540c\u670d\u52a1\u5668\u7684\u65f6\u95f4\uff0c\u4ee5\u9009\u62e9\u6700\u4f73\u7684\u8def\u5f84\u548c\u6765\u6e90\u6765\u6821\u51c6\u4e3b\u673a\u65f6\u95f4\u3002\u867d\u7136\u4e3b\u673a\u5728\u957f\u65f6\u95f4\u672a\u80fd\u4e0e\u67d0\u4e00\u65f6\u95f4\u670d\u52a1\u5668\u76f8\u8054\u7cfb\u7684\u60c5\u51b5\u4e0b\uff0cNTP\u670d\u52a1\u4ecd\u7136\u6709\u6548\u8fd0\u8f6c\u3002\u4e3a\u907f\u514d\u5bf9\u65f6\u95f4\u670d\u52a1\u5668\u7684\u6076\u610f\u7834\u574f\uff0cNTP\u4f7f\u7528\u4e86\u8fa8\u8bc6(Authentication)\u673a\u5236\uff0c\u68c0\u6d4b\u6765\u5bf9\u65f6\u7684\u4fe1\u606f\u662f\u5426\u662f\u771f\u6b63\u6765\u81ea\u6240\u58f0\u79f0\u7684\u670d\u52a1\u5668\u5e76\u68c0\u6d4b\u8d44\u6599\u7684\u8fd4\u56de\u8def\u5f84\uff0c\u4ee5\u63d0\u4f9b\u5bf9\u6297\u5e72\u6270\u7684\u4fdd\u62a4\u673a\u5236\u3002<\/p>\n NTP\u6821\u65f6\u5f62\u5f0f<\/p>\n \u65f6\u95f4\u670d\u52a1\u5668\u53ef\u4ee5\u501f\u52a9\u4ee5\u4e0b\u4e09\u79cd\u5f62\u5f0f\u4e0e\u5176\u4ed6\u670d\u52a1\u5668\u5bf9\u65f6\uff1abroadcast\/multicast\uff0cclient\/server\u548cSymmetric\u3002<\/p>\n broadcast\/multicast:\u65b9\u6cd5\u4e3b\u8981\u9002\u7528\u4e8e\u5c40\u57df\u7f51\u7684\u73af\u5883\uff0c\u65f6\u95f4\u670d\u52a1\u5668\u5468\u671f\u6027\u7684\u4ee5\u5e7f\u64ad\u7684\u5f62\u5f0f\uff0c\u5c06\u65f6\u95f4\u4fe1\u606f\u4f20\u9001\u7ed9\u5176\u4ed6\u7f51\u7edc\u4e2d\u7684\u65f6\u95f4\u670d\u52a1\u5668\uff0c\u5176\u65f6\u95f4\u4ec5\u4f1a\u6709\u5c11\u8bb8\u7684\u5ef6\u540e\uff0c\u5e76\u4e14\u914d\u7f6e\u5341\u5206\u7684\u7b80\u5355\u3002\u5e76\u4e14\u6b64\u65b9\u6cd5\u7684\u7cbe\u786e\u5ea6\u5e76\u4e0d\u9ad8\uff0c\u5bf9\u65f6\u95f4\u7cbe\u786e\u5ea6\u8981\u6c42\u4e0d\u662f\u5f88\u9ad8\u7684\u60c5\u51b5\u4e0b\u53ef\u4ee5\u91c7\u7528\u3002<\/p>\n <\/p>\n Symmetric:\u7684\u5f62\u5f0f\u5f97\u4e00\u53f0\u670d\u52a1\u5668\u53ef\u4ee5\u4ece\u8fdc\u7aef\u65f6\u95f4\u670d\u52a1\u5668\u83b7\u53d6\u65f6\u949f\u540c\u6b65\u65f6\u95f4\u670d\u52a1\u5668 linux<\/strong>\uff0c\u5047\u5982\u987b\u8981\u4e5f\u53ef\u63d0\u4f9b\u65f6\u95f4\u4fe1\u606f\u7ed9\u8fdc\u7aef\u7684\u65f6\u95f4\u670d\u52a1\u5668\u3002\u6b64\u4e00\u65b9\u6cd5\u9002\u7528\u4e8e\u914d\u7f6e\u5197\u4f59\u7684\u65f6\u95f4\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u63d0\u4f9b\u66f4\u9ad8\u7684\u7cbe\u786e\u5ea6\u7ed9\u4e3b\u673a\u3002<\/p>\n client\/server:\u5f62\u5f0f\u4e0esymmetric\u65b9\u6cd5\u6bd4\u8f83\u76f8\u50cf\uff0c\u53ea\u662f\u4e0d\u63d0\u4f9b\u7ed9\u5176\u4ed6\u65f6\u95f4\u670d\u52a1\u5668\u65f6\u95f4\u4fe1\u606f\uff0c\u6b64\u65b9\u6cd5\u9002\u7528\u4e8e\u4e00\u53f0\u65f6\u95f4\u670d\u52a1\u5668\u63a5\u6536\u4e0b\u5c42\u65f6\u95f4\u670d\u52a1\u5668\u7684\u65f6\u95f4\u4fe1\u606f\uff0c\u5e76\u63d0\u4f9b\u65f6\u95f4\u4fe1\u606f\u7ed9\u4e0a\u5c42\u7684\u7528\u6237\u3002<\/p>\n \u4e0a\u8ff0\u4e09\u79cd\u5f62\u5f0f\uff0c\u65f6\u95f4\u4fe1\u606f\u7684\u4f20\u8f93\u90fd\u4f7f\u7528UDP\u5408\u540c\u3002\u65f6\u95f4\u670d\u52a1\u5668\u501f\u52a9\u4e00\u4e2a\u8fc7\u6ee4\u6f14\u7b97\u6cd5\uff0c\u53ca\u539f\u672c\u516b\u4e2a\u6821\u65f6\u8d44\u6599\u4f30\u7b97\u51fa\u65f6\u95f4\u53c2\u8003\u503c\uff0c\u5224\u5b9a\u540e\u7eed\u6821\u65f6\u5305\u7684\u7cbe\u786e\u6027\uff0c\u4e00\u4e2a\u76f8\u5bf9\u8f83\u9ad8\u7684\u79bb\u6563\u7a0b\u5ea6\u540c\u6b65\u65f6\u95f4\u670d\u52a1\u5668 linux<\/strong>\uff0c\u8868\u793a\u4e00\u4e2a\u5bf9\u65f6\u8d44\u6599\u7684\u53ef\u6548\u5ea6\u6bd4\u8f83\u4f4e\u3002\u4ec5\u4ece\u4e00\u4e2a\u65f6\u95f4\u670d\u52a1\u5668\u83b7\u5f97\u6821\u65f6\u4fe1\u606f\uff0c\u4e0d\u80fd\u6821\u51c6\u901a\u4fe1\u8fc7\u7a0b\u6240\u5bfc\u81f4\u7684\u65f6\u95f4\u8bef\u5dee\uff0c\u800c\u540c\u65f6\u4e0e\u8bb8\u591a\u65f6\u95f4\u670d\u52a1\u5668\u901a\u8baf\u6821\u65f6\uff0c\u5c31\u53ef\u501f\u52a9\u8fc7\u6ee4\u7b97\u6cd5\u627e\u51fa\u76f8\u5bf9\u8f83\u53ef\u9760\u7684\u65f6\u95f4\u6765\u6e90\uff0c\u4e4b\u540e\u91c7\u7528\u5b83\u7684\u65f6\u95f4\u6765\u6821\u65f6<\/p>\n NTP\u670d\u52a1\u5668\u914d\u7f6e<\/p>\n <\/p>\n NTP\u5728Linux<\/a>\u4e3b\u673a\u4e0a\u9ed8\u8ba4\u901a\u5e38\u90fd\u662f\u5b89\u88c5\u8fc7\u7684linux\u547d\u4ee4vi\uff0c\u53ea\u662f\u670d\u52a1\u6ca1\u6709\u542f\u7528\u3002\u5047\u5982\u6ca1\u6709\u5b89\u88c5\u53ef\u76f4\u63a5\u4f7f\u7528yuminstallntp\u547d\u4ee4<\/a>\u5373\u53ef\u3002<\/p>\n NTP\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\uff0c\u4ee5\u4e0b\u662fNTP\u670d\u52a1\u5668\u53ef\u9009\u7684\u6307\u4ee4\uff1a<\/p>\n \n \u542f\u52a8NTP\u670d\u52a1\u5668<\/p>\n <\/p>\n \n \u67e5\u770bNTP\u4fe1\u606f<\/p>\n \n NTP\u670d\u52a1\u5668\u914d\u7f6e\u5b8c\u6210\u542f\u52a8\u4ee5\u540e\uff1bNTP\u81ea\u8eab\u6216\u5219\u4e0e\u5176server\u7684\u540c\u6b65\u987b\u8981\u4e00\u4e2a\u65f6\u95f4\u6bb5\u8fd9\u4e2a\u8fc7\u7a0b\u53ef\u80fd\u662f5-10\u5206\u949f\uff1b\u5728\u8fd9\u4e2a\u65f6\u95f4\u6bb5\u5185\u987e\u5ba2\u7aef\u8fd0\u884cntpdate\u547d\u4ee4\u65f6\u4f1a\u5f62\u6210noserversuitableforsynchronizationfound\u7684\u9519\u8bef\uff0c\u4e0a\u56fe\u8868\u793a210.72.145.44\u7684reach\u4e3a0\u4e0d\u53ef\u7528\uff0cLOCAL\u7684reach\u4e3a17\u53ef\u7528\u3002<\/p>\n <\/p>\n \u5c06\u65f6\u95f4\u540c\u6b65\u5230\u786c\u4ef6\u65f6\u949f<\/p>\n \n \u987e\u5ba2\u7aef\u914d\u7f6e<\/p>\n \n NTP\u670d\u52a1\u5668\u65f6\u95f4\u6309NTP\u670d\u52a1\u5668\u7684\u7b49\u7ea7\u4f20\u64ad\u3002\u5373\u4f7f\u4e3b\u673a\u5728\u957f\u65f6\u95f4\u65e0\u6cd5\u4e0e\u67d0\u4e00\u65f6\u95f4\u670d\u52a1\u5668\u76f8\u8054\u7cfb\u7684\u60c5\u51b5\u4e0b\uff0cNTP\u670d\u52a1\u4f9d\u7136\u6709\u6548\u8fd0\u8f6c\u3002broadcast\/multicast:\u65b9\u5f0f\u4e3b\u8981\u9002\u7528\u4e8e\u5c40\u57df\u7f51\u7684\u73af\u5883\uff0c\u65f6\u95f4\u670d\u52a1\u5668\u5468\u671f\u6027\u7684\u4ee5\u5e7f\u64ad\u7684\u65b9\u5f0f\uff0c\u5c06\u65f6\u95f4\u4fe1\u606f\u4f20\u9001\u7ed9\u5176\u4ed6\u7f51\u8def\u4e2d\u7684\u65f6\u95f4\u670d\u52a1\u5668\uff0c\u5176\u65f6\u95f4\u4ec5\u4f1a\u6709\u5c11\u8bb8\u7684\u5ef6\u8fdf\uff0c\u800c\u4e14\u914d\u7f6e\u975e\u5e38\u7684\u7b80\u5355\u3002\u542f\u52a8NTP\u670d\u52a1\u5668<\/p>\n","protected":false},"author":1,"featured_media":267887,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-267886","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/267886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=267886"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/267886\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/267887"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=267886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=267886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=267886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}# \u5141\u8bb8172.16.*.*\u7684IP\u4f7f\u7528\u8be5\u65f6\u95f4\u670d\u52a1\u5668;\nrestrict 172.16.0.0 mask 255.255.0.0 nomodify\n \n#\u5141\u8bb8\u4efb\u4f55\u4eba\u6765\u540c\u6b65;\nrestrict default nomodify notrap\n \n# \u5c4f\u853d\u5176\u4ed6IP\u8fc7\u6765\u66f4\u65b0\u65f6\u95f4;\nrestrict 0.0.0.0 mask 0.0.0.0 nomodify notrap noquery notrust \n#ignore:\u5173\u95ed\u6240\u6709\u7684NTP\u8054\u673a\u670d\u52a1;\n#nomodify:\u8868\u793aClient\u7aef\u4e0d\u80fd\u66f4\u6539Server\u7aef\u7684\u65f6\u95f4\u53c2\u6570\uff1b\u4e0d\u8fc7Client\u7aef\u4ecd\u7136\u53ef\u4ee5\u900f\u8fc7Server\u7aef\u6765\u8fdb\u884c\u7f51\u7edc\u6821\u65f6;\n#notrust:\u8be5Client\u9664\u975e\u901a\u8fc7\u8ba4\u8bc1\u5426\u5219\u8be5Client\u6765\u6e90\u5c06\u88ab\u89c6\u4e3a\u4e0d\u4fe1\u4efb\u7f51\u57df;\n#noquery:\u4e0d\u63d0\u4f9bClient\u7aef\u7684\u65f6\u95f4\u67e5\u8be2;\n#notrap:\u5141\u8bb8\u4efb\u4f55\u4eba\u6765\u67e5\u8be2;\n \n# \u540c\u6b65\u7684\u4e0a\u5c42\u670d\u52a1\u5668\uff08210.72.145.44\u56fd\u5bb6\u65f6\u95f4\u670d\u52a1\u5668\uff09,NTP\u670d\u52a1\u5668\u9ed8\u8ba4\u4e5f\u6709\u540c\u6b65\u7684\u65f6\u95f4\u670d\u52a1\u5668;\nserver 210.72.145.44\n \n# \u540c\u6b65\u672c\u5730\u65f6\u95f4;\nserver 127.127.1.0 prefer\n \n# \u672c\u5730\u670d\u52a1\u5668\u7684stratum\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc716;\nfudge 127.127.1.0 stratum 8\n<\/pre>\n<\/p>\n
[root@localhost ~]# chkconfig ntpd on \n[root@localhost ~]# service ntpd start\n<\/pre>\n<\/p>\n
[root@localhost ~]# ntpq -p\n<\/pre>\n<\/p>\n
[root@localhost ~]# vi \/etc\/sysconfig\/ntpd \nSYNC_HWCLOCK=yes\n<\/pre>\n<\/p>\n
[root@localhost ~]# ntpdate 172.16.16.1\n[root@localhost ~]# crontab -e \n*\/1 * * * * ntpdate 172.16.16.1\n<\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"