Voltar para Geral

Dúvida sobre NTP (urgente)

Home Fórum Geral Dúvida sobre NTP (urgente)

Visualizando 47 respostas da discussão
  • Autor
    Posts
    • #43653
      rpedrosa1979
      Participante

      Pessoal boa tarde,
      Já não sei oque fazer mais, tenho um cliente que possui varias filiais e cada switch, router utiliza o NTP.
      O NTP está instalado em uma maquina fedora , que faz referencia de sincronização em um outro IP, até ai tudo bem.
      O serviço está ativo e rodando.

      Há duas semanas atrás obsersei que nenhum dos Switches do cliente está sincronizando.
      Funcionou bem durante varios meses e agora parou tudo.

      Comandos que utilizei :
      conf t
      clock timezone GMT-3 -3
      clock summer-time GMT-2 date Oct 14 2008 0:00 Feb 17 2009 0:00
      ntp server “ip do meu servidor NTP”

      ai quando vc digita:

      Switch-2#sh ntp associations

      address ref clock st when poll reach delay offset disp
      ~192.168.0.247 0.0.0.0 16 – 64 0 0.0 0.00 16000.
      * master (synced), # master (unsynced), + selected, – candidate, ~ configured

      Switch-2#sh ntp associations detail
      192.168.0.247 configured, insane, invalid, unsynced, stratum 16
      ref ID 0.0.0.0, time 00000000.00000000 (21:00:00.000 GMT-3 Thu Dec 31 1899)
      our mode client, peer mode unspec, our poll intvl 64, peer poll intvl 64
      root delay 0.00 msec, root disp 0.00, reach 0, sync dist 218613.571
      delay 0.00 msec, offset 0.0000 msec, dispersion 16000.00
      precision 2**5, version 3
      org time 00000000.00000000 (21:00:00.000 GMT-3 Thu Dec 31 1899)
      rcv time 00000000.00000000 (21:00:00.000 GMT-3 Thu Dec 31 1899)
      xmt time CD48128D.965F2010 (14:17:01.587 GMT-3 Thu Feb 19 2009)
      filtdelay = 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
      filtoffset = 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
      filterror = 16000.0 16000.0 16000.0 16000.0 16000.0 16000.0 16000.0 16000.0

      Switch-2#sh ntp status
      Clock is unsynchronized, stratum 16, no reference clock
      nominal freq is 250.0000 Hz, actual freq is 249.9985 Hz, precision is 2**24
      reference time is 00000000.00000000 (21:00:00.000 GMT-3 Thu Dec 31 1899)
      clock offset is 0.0000 msec, root delay is 0.00 msec
      root dispersion is 0.00 msec, peer dispersion is 0.00 msec

      Switch-2#sh clock detail
      .14:18:33.443 GMT-3 Thu Feb 19 2009 (coloquei na mão a hora)
      Time source is NTP
      Summer time starts 00:00:00 GMT-3 Tue Oct 14 2008
      Summer time ends 00:00:00 GMT-2 Tue Feb 17 2009

      Alguem dotado de maior conhecimento do que o meu poderia me ajudar?

      Um abraço Ricardo Pedrosa

    • #64169
      RODRIGOKD
      Participante

      Olá Ricardo,

      Não posso te ajudar muito com relação à config dos switchs, mas tente o seguinte comando no Fedora:
      tcpdump -nn ip proto \udp and port 123 and host “ip-do-switch”

      Com este comando vc poderá saber se o servidor ntp (Fedora) esta recebendo os pacotes NTP dos switchs.
      Talvez isso possa te ajudar a isolar o problema.

      abs

      Rodrigo Dallabona

    • #64170
      rpedrosa1979
      Participante

      O meu servidor ntp está recebendo os pacotes.

      [root@cacti-bmg ~]# tcpdump -nn ip proto \udp and port 123 and host 192.168.0.64
      tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
      listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
      15:32:52.412244 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      15:33:56.413026 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48

      15:35:00.413758 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      15:36:04.414590 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      15:37:08.415233 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      15:38:12.416003 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      15:39:16.417942 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      15:40:20.417455 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      15:41:24.418215 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      ^C
      9 packets captured
      9 packets received by filter
      0 packets dropped by kernel

    • #64171

      E não está respondendo :-).

    • #64172

      Qual é a saída do comando “lsof -i udp:123” no seu servidor de NTP?

    • #64173
      rpedrosa1979
      Participante

      Gustavo ele está respondendo sim.
      Tá sim ou estou enganado?

    • #64174
      RODRIGOKD
      Participante

      Pelo resultado do tcpdump, o Fedora esta recebendo os pacotes, mas não esta retornando… deveria haver uma linha mais ou menos assim:

      … IP 192.168.0.247.123 > 192.168.0.64.123: NTPv3, Server, length 48

      esta parecendo que o problema esta no servidor ntp

      Veja um exemplo do tcpdump no meu servidor ntp:
      15:57:00.830471 IP 10.10.10.13.123 > 10.10.10.10.123: NTPv4, Client, length 48
      15:57:00.830745 IP 10.10.10.10.123 > 10.10.10.13.123: NTPv4, Server, length 48
      15:57:00.831165 IP 10.10.10.13.123 > 10.10.10.10.123: NTPv4, Client, length 48
      15:57:00.831245 IP 10.10.10.10.123 > 10.10.10.13.123: NTPv4, Server, length 48

      o ip 10.10.10.13 (cliente) solicita e o 10.10.10.10 (server) responde…

      abs
      Rodrigo Dallabona

    • #64175
      rpedrosa1979
      Participante

      Gustavo abaixo a saida do comando.

      [root@cacti-bmg ~]# lsof -i udp:123
      COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
      ntpd 23955 ntp 16u IPv4 2613638 UDP *:ntp
      ntpd 23955 ntp 17u IPv6 2613639 UDP *:ntp
      ntpd 23955 ntp 18u IPv6 2613643 UDP localhost6.localdomain6:ntp
      ntpd 23955 ntp 19u IPv6 2613644 UDP [fe80::20c:29ff:fef8:8e56]:ntp
      ntpd 23955 ntp 20u IPv4 2613645 UDP cacti-bmg:ntp
      ntpd 23955 ntp 21u IPv4 2613646 UDP 192.168.0.247:ntp

    • #64176

      Você tem iptables ativado no fedora?

      E, não, pela saída do tcpdump, o fedora não está respondendo.

    • #64177

      Ah! e o daemon do ntp está com a porta 123/udp aberta. Resta saber se ele está sincronizando com uma fonte confiável. Dê uma olhada no /var/log/messages em busca de alguma informações de sincronização ou não. Eu não lembro se o fedora tem alguma coisa como o ntp-status.. ntpdate, etc…. mas vale procurar…

    • #64178
      rpedrosa1979
      Participante

      Minha praia maior é com cisco, Linux eu apanho um pouco, mas vamos lá..

      [root@cacti-bmg ~]# yum -y update iptables
      Configurando o processo de atualização
      Nenhum pacote marcado para atualização
      [root@cacti-bmg ~]# yum -y install iptables
      Configurando o processo de instalação
      Analisando argumentos da instalação de pacotes
      O pacote iptables-1.4.1.1-2.fc8.i386 já está instalado em sua última versão
      Nada a ser feito

    • #64179

      cara, veja se o iptables tem alguma regra. tente iptables -nvL (mas não post aqui as suas regras !!!!). Veja se a chain INPUT está como ACCEPT.. Se estiver então não é isso.

    • #64180
      rpedrosa1979
      Participante

      Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
      pkts bytes target prot opt in out source destination
      533K 66M RH-Firewall-1-INPUT all — * * 0.0.0.0/0 0.0.0.0/0

      Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

      Chain OUTPUT (policy ACCEPT 438K packets, 128M bytes)
      Chain RH-Firewall-1-INPUT (1 references)

    • #64181

      Ótimo, não é isso. Como está configurado o seu ntp server ? 🙂 Na verdade, a pergunta é, foi feita alguma alteração ?

    • #64182
      rpedrosa1979
      Participante

      vc fala dentro do Sw ou dentro do vi /etc/ntpd.conf ?

      dentro do SW:
      conf t
      clock timezone GMT-3 -3
      clock summer-time GMT-2 date Oct 14 2008 0:00 Feb 17 2009 0:00
      ntp server “ip do meu servidor NTP”

    • #64183

      pergunta básica. Você já tentou reiniciar o ntpd no fedora ?

      killall -HUP ntpd

    • #64184

      no ntpd.conf do linux… é o linux que não está respondendo… o sw está ok.

    • #64185
      rpedrosa1979
      Participante

      [root@cacti-bmg ~]# vi /etc/ntp.conf
      # “memoria” para o escorregamento de frequencia do micro
      # pode ser necessario criar esse arquivo manualmente com
      # o comando touch ntp.drift
      driftfile /etc/ntp.drift

      # estatisticas do ntp que permitem verificar o historico
      # de funcionamento e gerar graficos
      statsdir /var/log/ntpstats/
      statistics loopstats peerstats clockstats
      filegen loopstats file loopstats type day enable
      filegen peerstats file peerstats type day enable
      filegen clockstats file clockstats type day enable

      # servidores publicos do projeto ntp.br
      server a.ntp.br iburst
      server b.ntp.br iburst
      server c.ntp.br iburst

      # outros servidores
      # server outro-servidor.dominio.br iburst

      # configuracoes de restricao de acesso
      restrict default kod notrap nomodify nopeer
      “/etc/ntp.conf” 23L, 737C

    • #64186

      Veja se os logs estão ok no diretório /var/log/ntpstats/…

    • #64187

      Lembrei.. tenta o comando “ntpstat” no fedora…

    • #64188
      rpedrosa1979
      Participante

      [root@cacti-bmg ~]# ntpstat
      synchronised to NTP server (200.160.0.8) at stratum 3
      time correct to within 960 ms
      polling server every 64 s

    • #64189

      service ntpd restart 🙂 (isso é no fedora…)

    • #64190
      rpedrosa1979
      Participante

      ehhe.. eu sei Gustavo , nao tem como dar esse comando no switch.. hehe

      [root@cacti-bmg ~]# service ntpd restart
      Desligando o ntpd: [ OK ]
      Iniciando o ntpd: [ OK ]

    • #64191

      Agora faça o seguinte, deixe o tcpdump rolando no fedora… desconfigure o ntp em um dos switches e configure novamente (reset!! :-D) e veja o que aparece no tcpdump… a comunicação tem que ser ida e volta ….

    • #64192
      rpedrosa1979
      Participante

      ok, vou fazer isso..
      Switch-2(config)#no ntp server 192.168.0.247
      Só nao posso resetar o meu swtich

    • #64193
      rpedrosa1979
      Participante

      É não deu… ah nem viu…

      Switch-2#sh ntp status
      Clock is unsynchronized, stratum 16, no reference clock
      nominal freq is 250.0000 Hz, actual freq is 249.9985 Hz, precision is 2**24
      reference time is 00000000.00000000 (21:00:00.000 GMT-3 Thu Dec 31 1899)
      clock offset is 0.0000 msec, root delay is 0.00 msec
      root dispersion is 0.00 msec, peer dispersion is 0.00 msec

      [root@cacti-bmg ~]# tcpdump -nn ip proto \udp and port 123 and host 192.168.0.64
      tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
      listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
      16:43:47.506241 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      16:43:48.506310 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      16:43:49.506346 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      16:43:50.506365 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      16:43:51.506416 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      16:43:52.506450 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      16:43:53.506514 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      16:43:54.506528 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      16:43:55.506586 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      16:43:56.506628 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      16:43:57.506670 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      16:43:58.506716 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      16:43:59.506756 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      16:44:00.506781 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      ^C
      14 packets captured
      14 packets received by filter
      0 packets dropped by kernel

    • #64194

      Não tem nenhuma mensagem no seu messages sobre o ntp ?

      cat /var/log/messages | grep ntpd

    • #64195
      rpedrosa1979
      Participante

      Feb 19 00:05:52 cacti-bmg ntpd[23955]: kernel time sync status change 0001
      Feb 19 00:40:02 cacti-bmg ntpd[23955]: kernel time sync status change 4001
      Feb 19 00:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 00:57:06 cacti-bmg ntpd[23955]: kernel time sync status change 0001
      Feb 19 01:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 02:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 02:56:37 cacti-bmg ntpd[23955]: kernel time sync status change 4001
      Feb 19 03:13:40 cacti-bmg ntpd[23955]: kernel time sync status change 0001
      Feb 19 03:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 03:47:51 cacti-bmg ntpd[23955]: kernel time sync status change 4001
      Feb 19 04:04:54 cacti-bmg ntpd[23955]: kernel time sync status change 0001
      Feb 19 04:39:03 cacti-bmg ntpd[23955]: kernel time sync status change 4001
      Feb 19 04:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 04:56:07 cacti-bmg ntpd[23955]: kernel time sync status change 0001
      Feb 19 05:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 06:04:23 cacti-bmg ntpd[23955]: kernel time sync status change 4001
      Feb 19 06:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 07:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 08:21:00 cacti-bmg ntpd[23955]: kernel time sync status change 0001
      Feb 19 08:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 09:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 10:37:35 cacti-bmg ntpd[23955]: kernel time sync status change 4001
      Feb 19 10:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 11:28:51 cacti-bmg ntpd[23955]: kernel time sync status change 0001
      Feb 19 11:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 12:20:07 cacti-bmg ntpd[23955]: synchronized to 200.189.40.8, stratum 2
      Feb 19 12:41:09 cacti-bmg ntpd[23955]: synchronized to 200.160.0.8, stratum 2
      Feb 19 12:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 13:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 15:27:55 cacti-bmg ntpd[23955]: kernel time sync status change 4001
      Feb 19 15:45:34 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 16:19:10 cacti-bmg ntpd[23955]: kernel time sync status change 0001
      Feb 19 16:21:40 cacti-bmg ntpd[23955]: ntpd exiting on signal 1
      Feb 19 16:21:40 cacti-bmg ntpd[23955]: can’t open /etc/ntp.drift.TEMP: Permissio n denied
      Feb 19 16:25:53 cacti-bmg ntpd[9229]: ntpd [email protected]-o Tue Apr 15 14:22:58 UTC 2008 (1)
      Feb 19 16:25:53 cacti-bmg ntpd[9230]: precision = 3.000 usec
      Feb 19 16:25:53 cacti-bmg ntpd[9230]: Listening on interface #0 wildcard, 0.0.0. 0#123 Disabled
      Feb 19 16:25:53 cacti-bmg ntpd[9230]: Listening on interface #1 wildcard, ::#123 Disabled
      Feb 19 16:25:53 cacti-bmg ntpd[9230]: Listening on interface #2 lo, ::1#123 Enab led
      Feb 19 16:25:53 cacti-bmg ntpd[9230]: Listening on interface #3 eth0, fe80::20c: 29ff:fef8:8e56#123 Enabled
      Feb 19 16:25:53 cacti-bmg ntpd[9230]: Listening on interface #4 lo, 127.0.0.1#12 3 Enabled
      Feb 19 16:25:53 cacti-bmg ntpd[9230]: Listening on interface #5 eth0, 192.168.0. 247#123 Enabled
      Feb 19 16:25:53 cacti-bmg ntpd[9230]: kernel time sync status 0040
      Feb 19 16:25:53 cacti-bmg ntpd[9230]: Frequency format error in /etc/ntp.drift
      Feb 19 16:26:00 cacti-bmg ntpd[9230]: synchronized to 200.189.40.8, stratum 2
      Feb 19 16:26:00 cacti-bmg ntpd[9230]: kernel time sync status change 0001
      Feb 19 16:29:09 cacti-bmg ntpd[9230]: synchronized to 200.160.0.8, stratum 2
      Feb 19 16:36:39 cacti-bmg ntpd[9230]: ntpd exiting on signal 15
      Feb 19 16:36:39 cacti-bmg ntpd[9230]: can’t open /etc/ntp.drift.TEMP: Permission denied
      Feb 19 16:36:40 cacti-bmg ntpd[9373]: ntpd [email protected]-o Tue Apr 15 14:22:58 UTC 2008 (1)
      Feb 19 16:36:40 cacti-bmg ntpd[9374]: precision = 3.000 usec
      Feb 19 16:36:40 cacti-bmg ntpd[9374]: Listening on interface #0 wildcard, 0.0.0. 0#123 Disabled
      Feb 19 16:36:40 cacti-bmg ntpd[9374]: Listening on interface #1 wildcard, ::#123 Disabled
      Feb 19 16:36:40 cacti-bmg ntpd[9374]: Listening on interface #2 lo, ::1#123 Enab led
      Feb 19 16:36:40 cacti-bmg ntpd[9374]: Listening on interface #3 eth0, fe80::20c: 29ff:fef8:8e56#123 Enabled
      Feb 19 16:36:40 cacti-bmg ntpd[9374]: Listening on interface #4 lo, 127.0.0.1#12 3 Enabled
      Feb 19 16:36:40 cacti-bmg ntpd[9374]: Listening on interface #5 eth0, 192.168.0. 247#123 Enabled
      Feb 19 16:36:40 cacti-bmg ntpd[9374]: kernel time sync status 0040
      Feb 19 16:36:40 cacti-bmg ntpd[9374]: Frequency format error in /etc/ntp.drift
      Feb 19 16:36:47 cacti-bmg ntpd[9374]: synchronized to 200.160.0.8, stratum 2
      Feb 19 16:36:47 cacti-bmg ntpd[9374]: kernel time sync status change 0001
      Feb 19 16:47:57 cacti-bmg ntpd[9374]: ntpd exiting on signal 15
      Feb 19 16:47:57 cacti-bmg ntpd[9374]: can’t open /etc/ntp.drift.TEMP: Permission denied
      Feb 19 16:47:57 cacti-bmg ntpd[9507]: ntpd [email protected]-o Tue Apr 15 14:22:58 UTC 2008 (1)
      Feb 19 16:47:57 cacti-bmg ntpd[9508]: precision = 4.000 usec
      Feb 19 16:47:57 cacti-bmg ntpd[9508]: Listening on interface #0 wildcard, 0.0.0. 0#123 Disabled
      Feb 19 16:47:57 cacti-bmg ntpd[9508]: Listening on interface #1 wildcard, ::#123 Disabled
      Feb 19 16:47:57 cacti-bmg ntpd[9508]: Listening on interface #2 lo, ::1#123 Enab led
      Feb 19 16:47:57 cacti-bmg ntpd[9508]: Listening on interface #3 eth0, fe80::20c: 29ff:fef8:8e56#123 Enabled
      Feb 19 16:47:57 cacti-bmg ntpd[9508]: Listening on interface #4 lo, 127.0.0.1#12 3 Enabled
      Feb 19 16:47:57 cacti-bmg ntpd[9508]: Listening on interface #5 eth0, 192.168.0. 247#123 Enabled
      Feb 19 16:47:57 cacti-bmg ntpd[9508]: kernel time sync status 0040
      Feb 19 16:47:57 cacti-bmg ntpd[9508]: Frequency format error in /etc/ntp.drift
      Feb 19 16:48:04 cacti-bmg ntpd[9508]: synchronized to 200.160.0.8, stratum 2
      Feb 19 16:48:04 cacti-bmg ntpd[9508]: kernel time sync status change 0001

    • #64196

      Tente:

      #touch /etc/ntp.drift

      e depois troque a linha abaixo do arquivo ntp.conf:

      De:
      restrict default kod notrap nomodify nopeer
      Para:
      restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
      OU
      restrict default nomodify notrap

      Essa é a minha última sugestão! 🙂

    • #64197

      E re-inicie o ntpd 🙂 rssss

    • #64198
      RODRIGOKD
      Participante

      tente isto no fedora:

      touch /etc/ntp.drift
      chown ntp /etc/ntp.drift
      chmod 644 /etc/ntp.drift

      e reinicie o NTP

      Rodrigo Dallabona

    • #64199
      RODRIGOKD
      Participante

      Desculpe Gustavo, não vi que vc já tinha postado…

    • #64200
      rpedrosa1979
      Participante

      Gustavo agradeço a sua atençao, ainda não funcionou .
      Obrigado mesmo.

    • #64201
      rpedrosa1979
      Participante

      E se alguem mais puder me ajudar serei muito grato

    • #64202

      cat /var/log/messages | grep ntpd | grep “Feb 19 17”

      Eu sou brasileiro… 🙂

    • #64203
      rpedrosa1979
      Participante

      tb sou brasileio e …

      [root@cacti-bmg ~]# cat /var/log/messages | grep ntpd | grep “Feb 19 17”
      Feb 19 17:05:48 cacti-bmg ntpd[9508]: ntpd exiting on signal 15
      Feb 19 17:05:48 cacti-bmg ntpd[9508]: can’t open /etc/ntp.drift.TEMP: Permission denied
      Feb 19 17:05:49 cacti-bmg ntpd[9709]: ntpd [email protected]-o Tue Apr 15 14:22:58 UTC 2008 (1)
      Feb 19 17:05:49 cacti-bmg ntpd[9710]: precision = 3.000 usec
      Feb 19 17:05:49 cacti-bmg ntpd[9710]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
      Feb 19 17:05:49 cacti-bmg ntpd[9710]: Listening on interface #1 wildcard, ::#123 Disabled
      Feb 19 17:05:49 cacti-bmg ntpd[9710]: Listening on interface #2 lo, ::1#123 Enabled
      Feb 19 17:05:49 cacti-bmg ntpd[9710]: Listening on interface #3 eth0, fe80::20c:29ff:fef8:8e56#123 Enabled
      Feb 19 17:05:49 cacti-bmg ntpd[9710]: Listening on interface #4 lo, 127.0.0.1#123 Enabled
      Feb 19 17:05:49 cacti-bmg ntpd[9710]: Listening on interface #5 eth0, 192.168.0.247#123 Enabled
      Feb 19 17:05:49 cacti-bmg ntpd[9710]: kernel time sync status 0040
      Feb 19 17:05:49 cacti-bmg ntpd[9710]: Frequency format error in /etc/ntp.drift
      Feb 19 17:05:56 cacti-bmg ntpd[9710]: synchronized to 200.160.0.8, stratum 2
      Feb 19 17:05:56 cacti-bmg ntpd[9710]: kernel time sync status change 0001
      Feb 19 17:07:33 cacti-bmg ntpd[9710]: ntpd exiting on signal 15
      Feb 19 17:07:33 cacti-bmg ntpd[9710]: can’t open /etc/ntp.drift.TEMP: Permission denied
      Feb 19 17:07:33 cacti-bmg ntpd[9744]: ntpd [email protected]-o Tue Apr 15 14:22:58 UTC 2008 (1)
      Feb 19 17:07:33 cacti-bmg ntpd[9745]: precision = 3.000 usec
      Feb 19 17:07:33 cacti-bmg ntpd[9745]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
      Feb 19 17:07:33 cacti-bmg ntpd[9745]: Listening on interface #1 wildcard, ::#123 Disabled
      Feb 19 17:07:33 cacti-bmg ntpd[9745]: Listening on interface #2 lo, ::1#123 Enabled
      Feb 19 17:07:33 cacti-bmg ntpd[9745]: Listening on interface #3 eth0, fe80::20c:29ff:fef8:8e56#123 Enabled
      Feb 19 17:07:33 cacti-bmg ntpd[9745]: Listening on interface #4 lo, 127.0.0.1#123 Enabled
      Feb 19 17:07:33 cacti-bmg ntpd[9745]: Listening on interface #5 eth0, 192.168.0.247#123 Enabled
      Feb 19 17:07:33 cacti-bmg ntpd[9745]: kernel time sync status 0040
      Feb 19 17:07:33 cacti-bmg ntpd[9745]: Frequency format error in /etc/ntp.drift
      Feb 19 17:07:40 cacti-bmg ntpd[9745]: synchronized to 200.160.0.8, stratum 2
      Feb 19 17:07:40 cacti-bmg ntpd[9745]: kernel time sync status change 0001
      Feb 19 17:13:37 cacti-bmg ntpd[9745]: ntpd exiting on signal 15
      Feb 19 17:13:37 cacti-bmg ntpd[9745]: can’t open /etc/ntp.drift.TEMP: Permission denied
      Feb 19 17:15:36 cacti-bmg ntpd[1916]: ntpd [email protected]-o Tue Apr 15 14:22:58 UTC 2008 (1)
      Feb 19 17:15:36 cacti-bmg ntpd[1917]: precision = 2.000 usec
      Feb 19 17:15:36 cacti-bmg ntpd[1917]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
      Feb 19 17:15:36 cacti-bmg ntpd[1917]: Listening on interface #1 wildcard, ::#123 Disabled
      Feb 19 17:15:36 cacti-bmg ntpd[1917]: Listening on interface #2 lo, ::1#123 Enabled
      Feb 19 17:15:36 cacti-bmg ntpd[1917]: Listening on interface #3 eth0, fe80::20c:29ff:fef8:8e56#123 Enabled
      Feb 19 17:15:36 cacti-bmg ntpd[1917]: Listening on interface #4 lo, 127.0.0.1#123 Enabled
      Feb 19 17:15:36 cacti-bmg ntpd[1917]: Listening on interface #5 eth0, 192.168.0.247#123 Enabled
      Feb 19 17:15:36 cacti-bmg ntpd[1917]: kernel time sync status 0040
      Feb 19 17:15:36 cacti-bmg ntpd[1917]: Frequency format error in /etc/ntp.drift
      Feb 19 17:15:43 cacti-bmg ntpd[1917]: synchronized to 200.160.0.8, stratum 2
      Feb 19 17:15:25 cacti-bmg ntpd[1917]: time reset -17.079489 s
      Feb 19 17:18:42 cacti-bmg ntpd[1917]: synchronized to 200.189.40.8, stratum 2
      Feb 19 17:29:27 cacti-bmg ntpd[1917]: synchronized to 200.160.0.8, stratum 2
      Feb 19 17:30:19 cacti-bmg ntpd[1917]: synchronized to 200.192.232.8, stratum 2
      Feb 19 17:30:41 cacti-bmg ntpd[1917]: kernel time sync status change 0001
      Feb 19 17:41:23 cacti-bmg ntpd[1917]: synchronized to 200.189.40.8, stratum 2
      Feb 19 17:49:47 cacti-bmg ntpd[1917]: synchronized to 200.192.232.8, stratum 2

    • #64204

      chown ntp /etc/ntp.drift
      chmod 644 /etc/ntp.drift

      E tira a linha de restrict do ntp.conf. Restart.

    • #64205
      RODRIGOKD
      Participante

      o problema não é só na permissão de gravação no arquivo ntp.drift, pois o NTP tbem tenta criar um arquivo temporário em /etc/ e não consegue

      minha sugestão:

      Altere o arquivo ntpd.conf:
      De: driftfile /etc/ntp.drift
      Para: driftfile /var/lib/ntp/drift

      Execute:
      mkdir /var/lib/ntp
      touch /var/lib/ntp/drift
      chown ntp -R /var/lib/ntp

      Reinicie o ntp

    • #64206
      rpedrosa1979
      Participante

      vou testar.. vlw

    • #64207
      Edson
      Participante

      Meus caros, li toda a saga e espero que dê tudo certo. Parabéns!

    • #64208
      miovieira
      Participante

      Pelo que vi, o router está mandando NTP version 3, para o Fedora.
      Se no Fedora não estiver configurado para version 3, apresentará problemas.
      Como não sei como verifica a versão do NTP no Fedora, aconselhor vc fazer o seguinte no router:
      enable
      config t
      ntp server 192.168.0.247 version 1 (Aí vc testa, vê se sincronizou) se não sincronizou ntp server 192.168.0.247 version 2.
      O default do Cisco é mandar ntp version 3, pq foram implementadas algumas melhorias.
      Bom, caso não funcione aí vc fala com o Gustavo..rs
      Sorte.

    • #64209

      miovieira, essa é a melhor dica que eu vi até agora… 🙂

    • #64210
      vstrabello
      Participante

      Estranho, quando fui mexer com NTP por curiosidade o único problema fio que estava com uma diferença de 2 horas!

    • #64211

      Esse tipo de diferença é do timezone aplicado no sistema operacional (independente de ser IOS, Windows, Linux ou JunOS).

      O NTP ajusta o relógio de acordo com o horário GMT. Não haverá diferença no ajuste, mas pode haver diferença na forma de mostrar o horário depois de aplicado o timezone pelo sistema operacional.

    • #64212
      rpedrosa1979
      Participante

      Boa tarde pessoal, vou testar essas configurações que ainda não foram feitas por mim.
      Estava no cliente hoje de manha.

    • #64213
      Alexandre Avelar
      Participante

      vstrabello, esta diferença não é problema. Você deve configurar o timezone do Brasil, ou seja, -3;
      #clock timezone BR -3. é algo assim.

    • #64214
      rpedrosa1979
      Participante

      Pessoal, como não tenho nada configurado no meu iptables, eu desabilitei o serviço e agora o NTP está funcionando perfeitamente.

      OBRIGADO A TODOS AMIGOS QUE ME AJUDARAM.

      VLW GUSTAVO.

      [root@cacti-bmg ~]# tcpdump -nn ip proto \udp and port 123 and host 192.168.0.64
      tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
      listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
      14:11:34.374800 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      14:11:34.375097 IP 192.168.0.247.123 > 192.168.0.64.123: NTPv3, Server, length 48
      14:12:38.375622 IP 192.168.0.64.123 > 192.168.0.247.123: NTPv3, Client, length 48
      14:12:38.375950 IP 192.168.0.247.123 > 192.168.0.64.123: NTPv3, Server, length 4

    • #64215
      rpedrosa1979
      Participante

      clock timezone GMT-3 -3
      clock summer-time GMT-2 date Oct 14 2008 0:00 Feb 17 2009 0:00

      Eu recomendo usar esse parametro no switch, pra quem tem ou teve problema com horario de verão

Visualizando 47 respostas da discussão
  • Você deve fazer login para responder a este tópico.