kamehck Posted January 27, 2017 Добрый день! На компе стоит altlinux 2.6.32 и стоит задача организовать синхронизацию времени с ip камер. Выхода в инет с компа и сети нет и не будет. В инете встречал темы, что если нет инета то и с локалки ничего не будет синхронизироваться. Так ли это? Рабочий конфиг ntpd.conf только когда прописаны строки server, на все остальные параметры ругаются. Фото конфига во вложении. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
st_re Posted January 27, 2017 server 127.127.1.0 fudge 127.127.1.0 stratum 10 ? Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
kamehck Posted January 27, 2017 Находил много примеров конфигов в инете и все пробывал. Выдает ошибку. Запускается ntpd только когда прописаны только server 1.ru.pool..... и так далее (остальные). Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
st_re Posted January 27, 2017 # cat /etc/ntp.conf server 127.127.1.0 fudge 127.127.1.0 stratum 10 restrict -4 127.0.0.1 restrict -6 ::1 driftfile /var/lib/ntp/drift # ntpq -p && ntpdc -c sysinfo remote refid st t when poll reach delay offset jitter ============================================================================== *LOCAL(0) .LOCL. 10 l 19 64 1 0.000 0.000 0.000 system peer: LOCAL(0) system peer mode: client leap indicator: 00 stratum: 11 precision: -23 root distance: 0.00000 s root dispersion: 7.94778 s reference ID: [127.127.1.0] reference time: dc359a7b.e1fdc8f2 Fri, Jan 27 2017 13:07:55.882 system flags: auth monitor ntp kernel stats jitter: 0.000000 s stability: 0.000 ppm broadcastdelay: 0.000000 s authdelay: 0.000000 s Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
kamehck Posted January 27, 2017 Тоесть это рабочий конфиг? У меня на строчку restrict 127.0.0.1 ругался ntpd Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
st_re Posted January 27, 2017 Да. работать будет и при первых 2-х строках. ntpd --version что кажет ? Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
kamehck Posted January 27, 2017 Только вечером посмотрю. Тот комп сейчас далеко. Спасибо за помощь. О результате отпишусь Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
kamehck Posted January 28, 2017 ntpd --version Версию не показывает, в МАНе тоже нет информации как посмотреть версию. server 127.127.1.0fudge 127.127.1.0 stratum 10 restrict -4 127.0.0.1 restrict -6 ::1 driftfile /var/lib/ntp/drift На данный конфиг NTPD тоже ругается на вторую строку. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
MMM Posted January 28, 2017 Выхода в инет с компа и сети нет и не будет. В инете встречал темы, что если нет инета то и с локалки ничего не будет синхронизироваться. точное время можно брать с GPS приёмника Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
kamehck Posted January 29, 2017 GPS приемника нет, и никто его не будет закупать. Достаточно будет времени одинакового с компом Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
Ivan_83 Posted January 29, 2017 Если конфиг не поможет - гугли дальше на тему стратума. ========================================================================================= ### Rozhuk Ivan 2008 - 2016 ### ntp.conf ### # $FreeBSD: stable/11/etc/ntp.conf 294773 2016-01-26 07:06:44Z cy $ # http://www.gsp.com/cgi-bin/man.cgi?section=5&topic=ntp.conf # http://support.ntp.org/bin/view/Support/UndisciplinedLocalClock # GENERAL SETTINGS enable calibrate kernel ntp disable auth bclient monitor pps stats broadcastdelay 0.004 calldelay 120 driftfile /var/db/ntpd.drift # logfile /var/log/ntp.log - log to syslog! leapfile "/var/db/ntpd.leap-seconds.list" # set self clock params server 127.127.1.0 fudge 127.127.1.0 stratum 10 # servers to query server -4 pool.ntp.org burst iburst maxpoll 9 prefer server -4 2.pool.ntp.org burst iburst maxpoll 9 prefer server -4 europe.pool.ntp.org burst iburst maxpoll 9 server -4 ru.pool.ntp.org burst iburst maxpoll 9 server -4 ntp.ubuntu.com burst iburst maxpoll 9 server -4 ntp.sixxs.net burst iburst maxpoll 9 server -4 ntp.eu.sixxs.net burst iburst maxpoll 9 server -4 ntp.us.sixxs.net burst iburst maxpoll 9 server -4 ntp.ap.sixxs.net burst iburst maxpoll 9 server -6 pool.ntp.org burst iburst maxpoll 9 prefer server -6 2.pool.ntp.org burst iburst maxpoll 9 prefer server -6 europe.pool.ntp.org burst iburst maxpoll 9 server -6 ru.pool.ntp.org burst iburst maxpoll 9 server -6 ntp.ubuntu.com burst iburst maxpoll 9 server -6 ntp.sixxs.net burst iburst maxpoll 9 server -6 ntp.eu.sixxs.net burst iburst maxpoll 9 server -6 ntp.us.sixxs.net burst iburst maxpoll 9 server -6 ntp.ap.sixxs.net burst iburst maxpoll 9 # PERMISSIONS # default deny all restrict -4 default ignore restrict -6 default ignore discard average 2 minimum 5 monitor 1 # permission for time servers restrict -4 pool.ntp.org nomodify nopeer noquery notrap restrict -4 2.pool.ntp.org nomodify nopeer noquery notrap restrict -4 europe.pool.ntp.org nomodify nopeer noquery notrap restrict -4 ru.pool.ntp.org nomodify nopeer noquery notrap restrict -4 ntp.ubuntu.com nomodify nopeer noquery notrap restrict -4 ntp.sixxs.net nomodify nopeer noquery notrap restrict -4 ntp.eu.sixxs.net nomodify nopeer noquery notrap restrict -4 ntp.us.sixxs.net nomodify nopeer noquery notrap restrict -4 ntp.ap.sixxs.net nomodify nopeer noquery notrap restrict -6 pool.ntp.org nomodify nopeer noquery notrap restrict -6 2.pool.ntp.org nomodify nopeer noquery notrap restrict -6 europe.pool.ntp.org nomodify nopeer noquery notrap restrict -6 ru.pool.ntp.org nomodify nopeer noquery notrap restrict -6 ntp.ubuntu.com nomodify nopeer noquery notrap restrict -6 ntp.sixxs.net nomodify nopeer noquery notrap restrict -6 ntp.eu.sixxs.net nomodify nopeer noquery notrap restrict -6 ntp.us.sixxs.net nomodify nopeer noquery notrap restrict -6 ntp.ap.sixxs.net nomodify nopeer noquery notrap # permissins for clients restrict -4 127.0.0.1 nomodify restrict -4 127.127.1.0 restrict -4 192.168.0.0 mask 255.255.0.0 limited nomodify noquery nopeer notrap restrict -4 172.16.0.0 mask 255.255.240.0 limited nomodify noquery nopeer notrap restrict -4 169.254.0.0 mask 255.255.0.0 limited nomodify noquery nopeer notrap restrict -4 10.0.0.0 mask 255.0.0.0 limited nomodify noquery nopeer notrap restrict -6 ::1 nomodify restrict -6 fe80:: mask ffc0:: limited nomodify noquery nopeer notrap restrict -6 fc00:: mask fe00:: limited nomodify noquery nopeer notrap Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
st_re Posted January 30, 2017 А пакет, в котором ставится ntpd в вашем дистрибутиве как звать ? попробуйте с конфигом в котром вообще нет server ? listen on * и все. По всей видимости у Вас openntpd. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
Ivan_83 Posted January 30, 2017 А пакет, в котором ставится ntpd в вашем дистрибутиве как звать ? У меня оно зачем то в базовой системе :) В портах: net/ntp net/ntp-devel net/openntpd Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
st_re Posted January 30, 2017 У меня оно зачем то в базовой системе :) Это было топикстартеру.. в Вашей способности поставить любой подходящий и настроить я, как бы, не сомневаюсь :) Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
kamehck Posted January 30, 2017 Систему ставил не я. Ставили очень давно. Комп достался по наследству, что и как там особо не рассматривал. При загрузке системе пишет "NTPD server started" В первоначальном конфиге строка listen on * была закоментирована. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
st_re Posted January 31, 2017 Так попробуйте без server и servers вообще. у вас openntpd и все эти примеры, что вы пробовали из инетов и что тут писали, не для него. Не уверен что на совсем пустой конфиг не ругнется, собирать и пробовать мне не очень хочется, дайте ему хотябы listen on *. В мануале сказано что он умеет перераздавать локальные часы, но не сказано что ему для этого нужно. Возможно просто не указывать внешних источников хватит. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
kamehck Posted January 31, 2017 Попробую. Спасибо. На выходных проверю. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
kamehck Posted February 4, 2017 запустился ntpd только с конфигом #listen on * listen on 192.168.0.1 если первую строку раскоментировать, ntpd не запускается. хоть ntpd запустился, с ним ничего не синхронизируется. выдает ошибку, что превышено время. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
st_re Posted February 4, 2017 фаервол ? Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
vlad11 Posted February 5, 2017 Прикладывайте dump запроса и ответа. Мы так будем еще месяц гадать. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
taf_321 Posted February 6, 2017 openntpd без внешней синхронизации не получает нужный стратум и не отдает время другим, так как не доверяем сам себе. удалите его, поставьте ntpd из репозитария и настройте по тем рекомендациям, что приведены в этой ветке. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
kamehck Posted February 8, 2017 как не странно, но ntpd с конфигом #listen on * listen on 192.168.0.1 вроде заработал. Комп с виндой не хотел синхронизироваться, а вот на камерах время везде одинаковое стало. На другом участке на компе выполняющим те же функции заработал конфиг listen on * поеду в конце неделе еще раз проверю, что все работает. в iptables все ACCEPT 2 vlad11 я понимаю вам надо tcpdump c локального интерфейса? 2 taf_321 если узнают что к компу подключал инет, оторвут голову :) Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
vlad11 Posted February 8, 2017 2 vlad11 я понимаю вам надо tcpdump c локального интерфейса? Раз заработало, то уже не надо. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
sol Posted February 11, 2017 >> если узнают что к компу подключал инет, оторвут голову :) А Флешку к компу можно подключать? Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...