<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>ntpd &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/ntpd/</link>
	<description>Feed of posts on WordPress.com tagged "ntpd"</description>
	<pubDate>Fri, 04 Dec 2009 16:49:40 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Set / Sync NTP / HWClock on Enterprise Linux (RH/OEL) ]]></title>
<link>http://sysengineers.wordpress.com/2009/11/04/set-sync-ntp-hwclock-on-enterprise-linux-rhoel/</link>
<pubDate>Wed, 04 Nov 2009 09:03:29 +0000</pubDate>
<dc:creator>chrisgralike</dc:creator>
<guid>http://sysengineers.wordpress.com/2009/11/04/set-sync-ntp-hwclock-on-enterprise-linux-rhoel/</guid>
<description><![CDATA[Another one of my public notes, #First Configure your ntp servers for the ntp daemon. vim /etc/ntp.c]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Another one of my public notes,</p>
<pre class="brush: bash;">

#First Configure your ntp servers for the ntp daemon.
vim /etc/ntp.conf

#Chose the options that are going to work best in your case
#We usualy remove the local clock entry and add two new ntp servers
#Add your local / remote ntp server like this.
#server [server address, either hostname or ip]
server 10.0.0.2 #or
server hostname.domain.ext
#save the settings.

#next check if the ntp daemon is started during system startup for all levels
#that enable networking (235)
chkconfig --list ntpd
ntpd            0:off   1:off   &#60;strong&#62;2:on    3:on&#60;/strong&#62;    4:off    &#60;strong&#62;5:on&#60;/strong&#62;    6:off

#If ness. add the ntpd daemon to the required levels using;
chkconfig --level 235 ntpd on

#Next sync the system clock with the ntp daemon. BE CAREFULL BEFORE APPYING!
#If the NTP servers time is in the PAST, this step might cause problems when forced
#Readup on ntp how to solve this situation. (yes there is a way <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   )
ntpdate 10.0.0.2 #You own addres naturally

#Next enable the ntp daemon to take over the sync task.
service ntpd start #or
/etc/init.d/ntpd start

#To wrap it all up, its nice to sync the hardware clock as well using this step.
hwclock --systohc   (read 'System to Hardwareclock')

#in case you need to manually set the timezone correctly
#You might create the correct link from the
#usr/share/zoneinfo/?/? to the /etc/localtime Like this
ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime

#Hope this helps you as much as it helped me in the past
#Check to see if the NTPd is working can be done
#using the following command
ntpq
ntpq&#62;peers
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[FreeBSD → Настройка ntpd и синхронизация времени на ферме серверов]]></title>
<link>http://vprokofyev.wordpress.com/2009/08/15/freebsd-ntpd-configuration/</link>
<pubDate>Sat, 15 Aug 2009 15:03:04 +0000</pubDate>
<dc:creator>vprokofyev</dc:creator>
<guid>http://vprokofyev.wordpress.com/2009/08/15/freebsd-ntpd-configuration/</guid>
<description><![CDATA[Сегодняшний пост будет о времени, но без философских рассуждений на тему куда мы все движемся и заче]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Сегодняшний пост будет о времени, но без философских рассуждений на тему куда мы все движемся и зачем. Задача стоит гораздо более реалистичная — настроить свой сервер синхронизации времени, который будет обслуживать парк серверов и пользовательскую подсеть. В статье я хочу затронуть как практическую, так и теоретическую части рассматриваемого предмета. Думаю, так будет интереснее и мне, и читающим.</p>
<p>Каким образом машина запоминает системное время, если ее выключили и включили позднее?</p>
<p>Уже давно большинство производителей железа устанавливают в свою продукцию чипы time-of-year (TOY), позволяющие сохранять системное время, а также инициализировать его при загрузке. Конечно, постоянно включать и выключать серверы мы не будем — эта идея, прямо скажем, не очень хорошая. Но благодаря наличию TOY-микросхемы возможно осуществление синхронизации — суть работы демона ntpd заключается в том, чтобы с некоторыми интервалами плавно и без скачков корректировать системное время на микросхеме. Естественно, что правильное время демон сверяет не с курантами на Красной площади, а использует для этого сеть и осуществляет коммуникацию с одним или несколькими серверами посредством специально разработанного протокола NTP (Network Time Protocol).</p>
<p>На сегодняшний день <strong>ntpd</strong> полностью поддерживает последнюю 4-ую версию протокола NTP, а также реализована обратная совместимость с предыдущими версиями протокола, которые описаны в  <a href="http://www.faqs.org/rfcs/rfc1059.html" target="_blank">RFC-1059</a>, <a href="http://www.faqs.org/rfcs/rfc1119.html" target="_blank">RFC-1119</a> и <a href="http://www.faqs.org/rfcs/rfc1305.html" target="_blank">RFC-1305</a>.</p>
<p>Приступим к установке<!--more-->. Для этого переходим в каталог /usr/ports/net/ntp и собираем.<br />
Уточнение: при сборке версии 4.2.4p7 из коллекции портов с поддержкой OpenSSL, а также использовании опции crypto pw в ntp.conf, демон будет подвержен уязвимости при вызове sprintf() в функции crypto_recv(), которая позволит атакующему выполнить произвольный код с привилегиями ntp демона, а также вызвать Denial of Service. До обновления пакета ntpd в коллекции портов проблему можно решить редактированием Makefile порта перед компиляцией (USE_OPENSSL=no) и исключением из конфига вышеуказанной строки crypto pw. Но это, костыль, сами понимаете.<br />
Также можно использовать ntpd, поставляемый вместе с системой и пропатчить исходники демона, следуя этой инструкции — <a href="http://security.freebsd.org/advisories/FreeBSD-SA-09:11.ntpd.asc">http://security.freebsd.org/advisories/FreeBSD-SA-09:11.ntpd.asc </a><br />
 Если по каким-либо причинам не пользуетесь портами, можете скачать последнюю стабильную версию с <a href="http://www.ntp.org/downloads.html" target="_blank">официального сайта</a> проекта. В этой статье я опишу более подробную настройку под FreeBSD, хотя конфиг ntp.conf можно использовать и для Linux-систем.</p>
<p>Сперва скажем системе запускать <strong>ntpd</strong> при старте системы и добавим в rc.conf следующее:<br />
<code></p>
<pre><span style="color:#800000;">...</span>
<span style="color:#800000;">ntpd_enable="YES"</span>
<span style="color:#800000;">ntpd_program="/usr/local/bin/ntpd"</span>
<span style="color:#800000;">ntpd_flags="-c /etc/ntp.conf -p /var/run/ntpd.pid -f /var/db/ntpd.drift"</span>
<span style="color:#800000;">...</span></pre>
<p></code><br />
Перегружаем rc.conf:<br />
<code>
<pre><span style="color:#800000;"># /etc/netstart</span></pre>
<p></code><br />
Также необходимо не забыть разрешить 123 порт по протоколу UDP в фаерволе на роутере, в моем случае это packet filter:<br />
<code>
<pre><span style="color:#800000;">dmz_if   = "rl1"
usr_if   = "rl2"</span>
<span style="color:#800000;">table &#60;dmz_net&#62;      { 10.0.1.0/24 }
table &#60;usr_net&#62;      { 10.20.5.0/24 }
...
block in log all
pass out on $ext_if all keep state
pass out on $dmz_if all keep state
pass out on $usr_if all keep state

pass in on { $dmz_if, $usr_if } proto udp from { &#60;dmz_net&#62;, &#60;usr_net&#62; } to any \
                                                             port 123 keep state
...</span></pre>
<p></code><br />
Непосредственно перед написанием конфига необходимо прояснить некоторые моменты. В мире существует большое количество устройств, которые синхронизируют свое время с очень маленькой задержкой, либо вовсе без нее, используя различные технологии от GPS до CDMA и многих других. Начало отсчета &#8220;правильного&#8221; времени начинается именно с этих точных часов, поэтому для них было введено специальное обозначение — stratum-0. Такие устройства непосредственно не участвуют в предоставлении услуги синхронизации времени, вместо этого они напрямую подключены к серверам, имеющим доступ к глобальной сети. Соответственно, эти серверы имеют stratum-1, то есть цифра указывает на удаленность сервера синхронизации от эталонного источника.</p>
<p>С этим разобрались, теперь приступим. Во-первых, необходимо указать как минимум 3 сервера для синхронизации, иначе stratum будет слишком большим и цепляющиеся машины откажутся выставлять время по нашему серверу. Во-вторых, используйте ip-адреса для их объявления в конфиге — я сталкивался с такой проблемой, что ntpd не мог срезолвить доменные имена. Полный список публично доступных stratum-1 серверов можно посмотреть <a href="http://support.ntp.org/bin/view/Servers/StratumOneTimeServers" target="_blank">здесь</a>. Третье, и не менее важное — конфигурация прав доступа к серверу:<br />
<code>
<pre><span style="color:#800000;"># ee /etc/ntp.conf
server 77.236.33.77 prefer iburst
server 212.118.54.2 iburst
server 193.41.86.177 iburst
server 193.125.143.140 iburst</span><span style="color:#800000;"><span style="color:#800000;">

driftfile /etc/ntp/drift
logfile /var/log/ntpd.log

restrict default ignore                                 # запретить доступ всем по дефолту
restrict 127.0.0.1                                      # разрешить все локалхосту
restrict 10.0.1.0 mask 255.255.255.0 nomodify notrap    # разрешить слушать серой подсети DMZ
restrict 10.20.5.0 mask 255.255.255.0 nomodify notrap   # разрешить слушать юзерской подсети

restrict 193.125.143.140 noquery notrap                 # серверы, с которыми происходит
restrict 212.118.54.2 noquery notrap                    # синхронизация должны, иметь возможность
restrict 193.41.86.177 noquery notrap                   # менять время нашего сервера
restrict 77.236.33.77 noquery notrap</span></span><span style="color:#800000;">
</span></pre>
<p></code><br />
Перезапускаем ntpd и на всякий случай проверяем /var/log/ntpd.log на предмет ошибок и сокеты:<br />
<code>
<pre><span style="color:#800000;"># sockstat &#124; grep -v udp6 &#124; grep ntpd
root     ntpd       1037  3  dgram  -&#62; /var/run/logpriv
root     ntpd       1037  20 udp4   *:123                 *:*
root     ntpd       1037  22 udp4   192.168.1.2:123       *:*
root     ntpd       1037  23 udp4   10.0.1.1:123          *:*
root     ntpd       1037  24 udp4   10.20.5.1:123         *:*
root     ntpd       1037  27 udp4   127.0.0.1:123         *:*
root     ntpd       1037  29 udp4   xx.xx.xx.xx:123       *:*</span></pre>
<p></code><br />
Обратите внимание, что <strong>после перезапуска синхронизация не начнется сразу же</strong>. Придется подождать некоторое время, потому что ntpd несколько медлителен и не торопится обновлять время — мне пришлось ждать около двух часов. Для того, чтобы проследить как идут дела с установкой соединения с другими серверами, есть утилита <strong>ntpq</strong>:<br />
<code>
<pre><span style="color:#800000;"># ntpq -c peers
 remote           refid          st t when poll reach   delay   offset  jitter
==============================================================================
*petrel.telecom. 192.36.143.150   2 u  624 1024  377   26.714   -2.038   0.358
 oriental.cordsy .STEP.          16 u    - 1024    0    0.000    0.000   0.000
+nut.rsuitb.ru.8 7.244.169.138    3 u  874 1024  377   26.739   -6.747   2.117
+ttm.chant.ru    .GPS.            1 u  406 1024  377   29.725   -1.000   0.283</span></pre>
<p></code><br />
Это говорит о том, что сейчас для синхронизации мне доступны указанные серверы. Теперь, в качестве проверки, можно синхронизировать время с нашим сервером с помощью <strong>ntpdate</strong>. Если все в порядке, вывод будет примерно такой:<br />
<code>
<pre><span style="color:#800000;"># ntpdate -q 10.0.1.1
server 10.0.1.1, stratum 3, offset -0.000031, delay 0.02573
15 Aug 19:20:37 ntpdate[82746]: adjust time server 127.0.0.1 offset -0.000031 sec</span></pre>
<p></code><br />
В обеих серых подсетях я использую DHCP и для автоматизации обновления времени добавил в dhcpd.conf дополнительную опцию, чтобы машины в сети вместе с адресом получали информацию о времени:<br />
<code>
<pre><span style="color:#800000;">subnet 10.0.1.0 netmask 255.255.255.0 {
...
 option routers 10.0.1.1;
 <span style="text-decoration:underline;">option ntp-servers 10.0.1.1;
</span>...
}
</span>
<span style="color:#800000;">subnet 10.20.5.0 netmask 255.255.255.0 {
...
 option routers 10.20.5.1;
 <span style="text-decoration:underline;">option ntp-servers 10.20.5.1;</span>
...
}</span></pre>
<p></code><br />
За дополнительной информацией можно обратиться к <a href="http://www.freebsd.org/cgi/man.cgi?query=ntpd&#38;apropos=0&#38;sektion=0&#38;manpath=FreeBSD+7.2-RELEASE&#38;format=html" target="_blank">man ntpd</a>, <a href="http://www.freebsd.org/cgi/man.cgi?query=ntp.conf&#38;apropos=0&#38;sektion=0&#38;manpath=FreeBSD+7.2-RELEASE&#38;format=html" target="_blank">man ntp.conf</a>, а также почитать <a href="http://www.fifi.org/doc/ntp-doc/html/ntpd.htm" target="_blank">более подробную документацию</a>.<br />
Замечания по статье, добавления и исправления приветствуются. Спасибо за внимание.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Linux: Instalando, configurando e sincronizando o relógio de servidores e clientes com NTP no Debian, Ubuntu e Windows.]]></title>
<link>http://andreferraro.wordpress.com/2009/05/11/linux-instalando-configurando-sincronizando-relogio-servidores-clientes-ntp-debian-ubuntu-windows/</link>
<pubDate>Mon, 11 May 2009 12:51:39 +0000</pubDate>
<dc:creator>André Ferraro</dc:creator>
<guid>http://andreferraro.wordpress.com/2009/05/11/linux-instalando-configurando-sincronizando-relogio-servidores-clientes-ntp-debian-ubuntu-windows/</guid>
<description><![CDATA[Servidor NTP: Hora oficial e sincronizada. Notei, nesses vários anos que trabalho com redes, que não]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><div id="attachment_326" class="wp-caption alignleft" style="width: 225px"><img class="size-full wp-image-326" title="Servidor NTP: Hora oficial e sincronizada." src="http://andreferraro.wordpress.com/files/2009/05/servidor-ntp.jpg" alt="Servidor NTP: Hora oficial e sincronizada." width="215" height="300" /><p class="wp-caption-text">Servidor NTP: Hora oficial e sincronizada.</p></div>
<p>Notei, nesses vários anos que trabalho com redes, que não é a maioria dos administradores que se preocupam com a configuração perfeita da data e hora dos servidores. Uma rede com o horário dessincronizado pode gerar sérios problemas de administração, como por exemplo: falhas em servidores de controle de versão, problemas com sistemas de <em>backup</em>, erro em transações de banco de dados, não funcionamento do <em>Active Directory</em> ou quando precisamos analisar <em>LOGs</em> de vários servidores por causa de alguma ocorrência na rede. Ah, tem até aquele caso comum de um e-mail cuja resposta tem hora inferior ao do primeiro e-mail enviado.<!--more--></p>
<p>Para resolver essa situação existe o <strong>NTP</strong> (<em>Network Time Protocol</em>) que tem como finalidade sincronizar relógios na rede, seja ela, rede local ou a Internet. Através do <em>NTP</em> podemos sincronizar nossas máquinas com a data e hora provida por órgãos responsáveis pela hora legal no país, como é o caso do <a href="http://ntp.br/" target="_blank">NTP.br</a> e o <a href="http://www.on.br/" target="_blank">Observatório Nacional</a>.</p>
<p>Uma informação pertinente é que os servidores de <strong>NTP</strong>, como do Observatório Nacional, têm como referência <a href="http://pt.wikipedia.org/wiki/Relógio_atômico" target="_blank">relógios atômicos</a> ou <a href="http://pt.wikipedia.org/wiki/Gps" target="_blank">GPS</a>.</p>
<p>O processo de sincronização é feito através de <a href="http://pt.wikipedia.org/wiki/Algoritmo" target="_blank">algorítimos</a> e mensagens trocadas entre o seu servidor <em>NTP</em> local com o servidor <em>NTP</em> de referência, possibilitando a determinação exata da hora que será utilizada em seu servidor e a partir daí o processo é repetido entre seu servidor <em>NTP</em> local com as demais máquinas de sua rede.</p>
<h2>Instalação e configuração do servidor NTP</h2>
<p>O <strong>servidor NTP</strong>, ou <strong>NTPd</strong> (<a href="http://pt.wikipedia.org/wiki/Daemon_%28aplicativo_para_computadores%29" target="_blank">daemon</a>) é instalável em todos as distribuições <em>Linux</em> e sua função é justamente se comunicar com servidores de referência e depois propagar a data e hora pelos computadores clientes da rede.</p>
<p>Antes de começarmos a instalação que é compatível tanto como <strong>Debian Lenny</strong> (<em>Debian 5.0</em>) quanto com o <strong>Ubuntu Jaunty</strong> (<em>Ubuntu 9.04</em>), vamos primeiro atualizar nossa lista de repositórios do <em>APT</em> com o comando:</p>
<p><code># apt-get update</code></p>
<h3>Instalando o servidor NTP</h3>
<p>Após atualizar a lista de repositórios, basta executarmos o comando para instalação:</p>
<p><code># apt-get install ntp ntpdate<br />
</code></p>
<p>O <em>deamon</em> do <strong>NTP</strong> utiliza pouco mais de um megabyte de espaço em disco e não adiciona pacotes extras, exceto no <em>Debian</em> onde pacote <strong>libcap1</strong> é instalado. O <strong>libcap1</strong> tem como função particionar os privilégios do <em>root</em> para utilização de vários serviços como o <strong>NTPd</strong>.</p>
<p>Outra necessidade percebida no Debian é a instalação do <strong>ntpdate</strong>, com este utilitário é possível atualizar o relógio diretamente com um servidor NTP de referência.</p>
<h2>Configurando o NTPd no Debian Lenny (Debian 5.0) e Ubuntu Jaunty (Ubuntu 9.04)</h2>
<p>Após a instalação, precisamos nos certificar que o horário de nosso computador não está mais que 16 minutos atrasado ou adiantado. Vamos utilizar o comando abaixo para atualizar o horário do computador com o servidor NTP padrão de referência:</p>
<p><code># ntpd -q -g</code></p>
<p>Após a atualização do horário através dos servidores padrões do <em>Debian</em> e do <em>Ubuntu</em>, o <strong>NTP</strong> utiliza o arquivo <strong>ntp.drift</strong>. O <strong>ntp.drift</strong> registra a instabilidade na freqüência do relógio do seu computador e o <em>NTP</em> o utiliza este registro para sincronizar corretamente o relógio do seu equipamento com o do servidor de referência. Algumas distribuições <em>Linux</em> não criam o arquivo automaticamente no momento da instalação, porém o <strong>Debian Lenny</strong> (<em>Debian 5.0</em>) e o <strong>Ubuntu Jaunty</strong> (<em>Ubuntu 9.04</em>) o criam corretamente.</p>
<h3>Configurando o servidor NTP via ntp.conf</h3>
<p>O arquivo responsável pela configuração do <em>servidor NTP</em> é o <strong>ntp.conf</strong> que no <em>Debian</em> e <em>Ubuntu</em> está localizado em <strong>/etc/ntp.conf</strong>. Nas duas distribuições o <strong>ntp.conf</strong> é idêntico, salvo é claro o servidor NTP de referência, que no <em>Ubuntu</em> é <em>ntp.ubuntu.com</em> e no <em>Debian</em> são quatro servidores, onde o primeiro é <em>0.debian.pool.ntp.org</em>.</p>
<p>Vamos agora entender a estrutura do arquivo para definirmos uma configuração usual.</p>
<p>A primeira linha faz referência a localização do arquivo <em>ntp.drift</em> que comentei um pouco acima neste <em>post</em>. Verifique se ele está criado no diretório apontado em seu arquivo de configuração. Caso não esteja criado, então utilize o comando abaixo:</p>
<p><code># touch /var/lib/ntp/ntp.drift</code></p>
<p>Caso você deseje monitorar seu servidor <em>NTP</em> através de <em>LOGs</em>, então “descomente” (retire o caracter #) da linha <strong>statsdir</strong>. Não esqueça de &#8220;descomentar&#8221; também as linhas de <strong>filegen</strong>, pois serão utilizadas para definir as informações gravadas em <em>log</em>.</p>
<p>O terceiro item do arquivo de configuração é relativo ao servidor NTP de referência, ele deve ser configurado no padrão:</p>
<p><code>server &#60;endereço-do-servidor&#62; &#60;opções&#62;</code></p>
<p>Existem doze itens de configuração de servidor. Eu recomendo a utilização de três opções, são elas:</p>
<ul>
<li><strong>iburst</strong> – quando o <em>NTPd</em> não localiza o servidor, então ele envia oito pacotes, ao invés de dois pacotes (padrão), assim mesmo que sua conexão apresente alguma instabilidade o NTPd tentará mais contatos com o <em>servidor NTP</em> de referência;</li>
<li><strong>prefer</strong> – define o <em>servidor NTP</em> de referência como preferencial;</li>
<li><strong>dynamic</strong> – permite que um servidor, mesmo que inalcançável, ainda seja contatado futuramente, pois sua rede local ou sua conexão de internet pode ter falhado ou esteja com sinal intermitente.</li>
</ul>
<p>Sugiro estes cinco servidores:</p>
<ul>
<li>a.ntp.br – Servidor da NTP.br ;</li>
<li>ntp.ansp.br – Servidor do NARA (núcleo de apoio a rede acadêmica);</li>
<li>ntp.cais.rnp.br – Servidor da RNP (rede nacional de pesquisa);</li>
<li>b.ntp.br – Servidor da NTP.br;</li>
<li>c.ntp.br – Servidor da NTP.br.</li>
</ul>
<p>É importante, por questões de segurança, que não seja permitido que estes servidores NTP de referência façam qualquer alteração no horário, pois estes são para consulta e a alteração de horário deverá ser feita localmente, então vamos colocar uma regra de restrição de alteração e consulta para estes servidores. Configuramos estes parâmetros dentro da configuração de restrict, como por exemplo:</p>
<p><code>restrict &#60;endereço-do-servidor&#62; mask 255.255.255.255 nomodify noquery</code></p>
<p>Eu não modifico a configuração padrão das primeiras quatro linhas contendo o item o chamada <strong>restrict</strong>, pois desejo que meu <em>servidor NTP</em> troque horário com qualquer computador, porém não permitindo alteração de configuração e também permito que usuários do próprio computador façam consultas ao servidor. A única configuração de restrição que eu faço é a inserção da linha:</p>
<p><code>restrict &#60;rede-local&#62; mask &#60;máscara-de-rede&#62;</code></p>
<p>A linha acima deve ser utilizada para liberar todas as máquinas da rede local para acessarem o <em>servidor de NTP</em>.</p>
<h3>Exemplo de configuração do ntp.conf</h3>
<p>Abaixo segue meu exemplo de configuração do ntp.conf:</p>
<p><code>driftfile /var/lib/ntp/ntp.drift</code></p>
<p><code>statsdir /var/log/ntpstats/</code><br />
<code>statistics loopstats peerstats clockstats</code><br />
<code>filegen loopstats file loopstats type day enable</code><br />
<code>filegen peerstats file peerstats type day enable</code><br />
<code>filegen clockstats file clockstats type day enable</code></p>
<p><code>server a.ntp.br prefer iburst dynamic</code><br />
<code>server ntp.ansp.br iburst dynamic</code><br />
<code>server ntp.cais.rnp.br iburst dynamic</code><br />
<code>server b.ntp.br iburst dynamic</code><br />
<code>server c.ntp.br iburst dynamic</code></p>
<p><code>restrict a.ntp.br mask 255.255.255.255 nomodoify noquery</code><br />
<code>restrict ntp.ansp.br mask 255.255.255.255 nomodoify noquery</code><br />
<code>restrict ntp.cais.rnp.br mask 255.255.255.255 nomodoify noquery</code><br />
<code>restrict b.ntp.br iburst mask 255.255.255.255 nomodoify noquery</code><br />
<code>restrict c.ntp.br iburst mask 255.255.255.255 nomodoify noquery</code></p>
<p><code>restrict -4 default kod notrap nomodify nopeer noquery</code><br />
<code>restrict -6 default kod notrap nomodify nopeer noquery</code><br />
<code>restrict 127.0.0.1</code><br />
<code>restrict ::1</code><br />
<code>restrict 192.168.0.0 mask 255.255.255.0</code></p>
<p>Depois de salvar (gravar) o arquivo, não vamos reiniciar o serviço ainda. Primeiro vamos parar o servidor NTP (caso esteja rodando) e sincronizar o horário, do nosso servidor <em>NTP</em>, com os comandos:</p>
<p><code># /etc/init.d/ntp stop<br />
# ntpdate a.ntp.br</code></p>
<p>Após feita sincronização de horário com um <em>servidor NTP</em> de referência, então vamos reiniciar o serviço de <em>NTP</em> com o comando:</p>
<p><code># /etc/init.d/ntp force-reload</code></p>
<h2>Verificando se o nosso servidor NTP está sincronizando corretamente</h2>
<p>Para verificarmos se os servidores ao qual estamos tentando sincronizar estão fornecendo respostas e nosso <em>servidor NTP</em> está sincronizando o horário corretamente, precisaremos executar o comando de consulta. O resultado é atualizado constantemente nos dois primeiros dias de sincronização, pois as informações de frequência ainda estão sendo atualizadas no arquivo <em>ntp.drift</em>.</p>
<p>Comando de consulta da situação de sincronização:</p>
<p><code># ntpq -p</code></p>
<p>O resultado deve variar, mas pode ser como o abaixo:</p>
<table border="0">
<tbody>
<tr>
<td><code>remote</code></td>
<td><code>refid</code></td>
<td><code>st</code></td>
<td><code>t</code></td>
<td><code>when</code></td>
<td><code>poll</code></td>
<td><code>reach</code></td>
<td><code>delay</code></td>
<td><code>offset</code></td>
<td><code>jitter</code></td>
</tr>
<tr>
<td colspan="10"><code>==============================================================================</code></td>
</tr>
<tr>
<td><code> a.ntp.br</code></td>
<td><code>.INIT.</code></td>
<td><code>16</code></td>
<td><code>u</code></td>
<td><code>-</code></td>
<td><code>64</code></td>
<td><code>0</code></td>
<td><code>0.000</code></td>
<td><code>0.000</code></td>
<td><code>0.000</code></td>
</tr>
<tr>
<td><code> ns2.ansp.br</code></td>
<td><code>.STEP.</code></td>
<td><code>16</code></td>
<td><code>u</code></td>
<td><code>482</code></td>
<td><code>64</code></td>
<td><code>0</code></td>
<td><code>0.000</code></td>
<td><code>0.000</code></td>
<td><code>0.001</code></td>
</tr>
<tr>
<td><code> titan.cais.rnp.</code></td>
<td><code>.STEP.</code></td>
<td><code>16</code></td>
<td><code>u</code></td>
<td><code>34m</code></td>
<td><code>64</code></td>
<td><code>0</code></td>
<td><code>0.000</code></td>
<td><code>0.000</code></td>
<td><code>0.001</code></td>
</tr>
<tr>
<td><code> b.ntp.br</code></td>
<td><code>200.20.186.76</code></td>
<td><code>2</code></td>
<td><code>u</code></td>
<td><code>32</code></td>
<td><code>64</code></td>
<td><code>1</code></td>
<td><code>20.664</code></td>
<td><code>-1.971</code></td>
<td><code>0.001</code></td>
</tr>
<tr>
<td><code> c.ntp.br</code></td>
<td><code>.STEP.</code></td>
<td><code>16</code></td>
<td></td>
<td><code>-</code></td>
<td><code>64</code></td>
<td><code>0</code></td>
<td><code>0.000</code></td>
<td><code>0.000</code></td>
<td><code>0.000</code></td>
</tr>
</tbody>
</table>
<p>Você poderá reparar que os servidores estão marcados como <em>INIT</em> e <em>STEP</em>. Isto acontece, pois nosso servidor é recém configurado e ainda está atualizando as frequências com os servidores NTP de referência. Após alguns minutos a resposta poderá ser como abaixo:</p>
<table border="0">
<tbody>
<tr>
<td><code>remote</code></td>
<td><code>refid</code></td>
<td><code>st</code></td>
<td><code>t</code></td>
<td><code>when</code></td>
<td><code>poll</code></td>
<td><code>reach</code></td>
<td><code>delay</code></td>
<td><code>offset</code></td>
<td><code>jitter</code></td>
</tr>
<tr>
<td colspan="10"><code>==============================================================================</code></td>
</tr>
<tr>
<td><code>a.ntp.br</code></td>
<td><code>.INIT.</code></td>
<td><code>16</code></td>
<td><code>u</code></td>
<td><code>-</code></td>
<td><code>64</code></td>
<td><code>0</code></td>
<td><code>0.000</code></td>
<td><code>0.000</code></td>
<td><code>0.000</code></td>
</tr>
<tr>
<td><code>*ntp.ansp.br</code></td>
<td><code>200.192.232.8</code></td>
<td><code>3</code></td>
<td><code>u</code></td>
<td><code>41</code></td>
<td><code>64</code></td>
<td><code>7</code></td>
<td><code>11.962</code></td>
<td><code>-65.677</code></td>
<td><code>26.804</code></td>
</tr>
<tr>
<td><code>+titan.cais.rnp.</code></td>
<td><code>26.29.7.231</code></td>
<td><code>2</code></td>
<td><code>u</code></td>
<td><code>36</code></td>
<td><code>64</code></td>
<td><code>7</code></td>
<td><code>15.542</code></td>
<td><code>-45.002</code></td>
<td><code>23.074</code></td>
</tr>
<tr>
<td><code>+b.ntp.br</code></td>
<td><code>200.20.186.76</code></td>
<td><code>2</code></td>
<td><code>u</code></td>
<td><code>38</code></td>
<td><code>64</code></td>
<td><code>7</code></td>
<td><code>17.908</code></td>
<td><code>-44.850</code></td>
<td><code>22.019</code></td>
</tr>
<tr>
<td><code>c.ntp.br</code></td>
<td><code>.INIT.</code></td>
<td><code>16</code></td>
<td><code>u</code></td>
<td><code>-</code></td>
<td><code>64</code></td>
<td><code>0</code></td>
<td><code>0.000</code></td>
<td><code>0.000</code></td>
<td><code>0.000</code></td>
</tr>
</tbody>
</table>
<h2>Entendendo a resposta do ntpq</h2>
<p>Após utilizar o comando acima, com certeza queremos saber por que alguns servidores possuem um caracter antes do endereço, chamados de Tally Codes. Os Tally Codes<br />
podem variar entre * (asterisco), + (soma), x. Vamos entender qual o significado desses simbolos e qual a função dos itens st, t, when, poll, reach, delay, offset e jitter:</p>
<p>Entendendo os caracteres ou tally codes:</p>
<ul>
<li>* &#8211; system peer, servidor escolhido como principal referência;</li>
<li>+ &#8211; candidat, servidor utilizado, porém com menor peso;</li>
<li>x &#8211; falsetick, servidor descartado por alguma incoerência verificada na execução do algoritimo de sincronização;</li>
<li>- &#8211; outlier, servidor funcional, porém geograficamente distante. A distância pode afetar na sincronização;</li>
<li>. &#8211; excess, se existir mais de 10 servidores de referência configurados, então os que não estiverem entre os 10 melhores receberão esta marca;</li>
<li># &#8211; selected, porém não está entre os 6 principais servidores NTP de referência;</li>
<li> &#8211; se não houver marcação, então o servidor de referência foi descartado por não estar respondendo.</li>
</ul>
<p>Verificando as demais informações:</p>
<ul>
<li>st &#8211; o ideal é 1 ou 2, pois o estrato 0 é destinado às fontes dos servidores NTP de referência. 16 significa que não está sincronizado;</li>
<li>when &#8211; tempo (em segundos) da última consulta;</li>
<li>poll &#8211; tempo (em segundos) entre uma consulta e outra;</li>
<li>reach &#8211; transformação em decimal do resultado das últimas consultas. 377 mostra que não houveram falhas;</li>
<li>delay &#8211; tempo (em milisegundos) de demora entre consultas;</li>
<li>offset &#8211; medidas de deslocamento (em miliseguntos), é a diferença de tempo entre nosso servidor NTP e o servidor de referência;</li>
<li>jitter &#8211; ou variação, utiliza o offset para informar desvio ou erro do servidor NTP de referência.</li>
</ul>
<p>Outra maneira de consultar a situação do seu servidor NTP é através do Syslog, para isso utilize o comando abaixo:</p>
<p><code># tail -f -n 30 /var/log/syslog &#124; grep ntpd</code></p>
<h2>Configurando o NTP em máquinas clientes</h2>
<p>O processo de configuração do seu servidor NTP nas máquinas existentes em sua rede local é bastante simples. Abaixo vamos ver como executar esta tarefa tanto em clientes <strong>Linux</strong> quanto clientes <strong>Windows</strong>.</p>
<h3>NTP em máquinas Windows</h3>
<p>Apenas três comandos são suficientes para configurar seu servidor NTP em clientes Windows. Para isso siga os passos:</p>
<ol>
<li>Clique em Iniciar</li>
<li>Selecione Todos os Programas</li>
<li>Entre no menu Acessórios</li>
<li>Clique no item Prompt de Comandos</li>
</ol>
<p>Agora no <strong>Prompt de Comandos</strong>, vamos executar os comandos abaixo:</p>
<p><code>C:\&#62; net time /setsntp:"&#60;ip-do-servidor-NTP&#62;"<br />
C:\&#62; net stop w32time<br />
C:\&#62; net start w32time</code></p>
<p>Os comandos acima definem o seu servidor como servidor NTP de referência, pára o serviço de horário do Windows (<em>Windows Time Service</em>) e inicia o <em>Windows Time Service</em>.<br />
Estes passos são válidos para <strong>Windows XP</strong> e <strong>Windows 2003 Server</strong>. Não testei no <em>Windows Vista</em>, porém deve seguir passos semelhantes.</p>
<p>Para verificarmos se o <em>Windows</em> está sincronizando com nosso servidor NTP, então basta executar o comando no <em>Prompt de Comandos</em>:</p>
<p><code>c:\&#62; net time /querysntp</code></p>
<h3>NTP em clientes Linux</h3>
<p>O processo de configuração do <em>NTP</em> em um cliente <em>Linux</em> é muito parecido com o processo de configuração do servidor, ou seja, vamos ter que instalar os pacotes <strong>ntp</strong> e o <strong>ntpdate</strong>:</p>
<p><code># apt-get install ntp ntpdate</code></p>
<p>Vamos criar o arquivo <strong>ntp.drift</strong> (caso não exista):</p>
<p><code># touch /var/lib/ntp/ntp.drift</code></p>
<p>E vamos agora configurar o arquivo <strong>/etc/ntp.conf</strong>. Eu, particularmente, prefiro remover todas as configurações e deixar como o exemplo abaixo:</p>
<p><code>driftfile /var/lib/ntp/ntp.drift<br />
statsdir /var/log/ntpstats/<br />
statistics loopstats peerstats clockstats<br />
filegen loopstats file loopstats type day enable<br />
filegen peerstats file peerstats type day enable<br />
filegen clockstats file clockstats type day enable<br />
server <em>&#60;ip-do-servidor-NTP&#62;</em><br />
restrict 127.0.0.1<br />
restrict <em>&#60;ip-do-servidor-NTP&#62;</em><br />
restrict ::1</code></p>
<p>Salve as configurações e atualize a data e hora do sistema, mas antes vamos parar o serviço de <em>NTP</em> local:</p>
<p><code># /etc/init.d/ntp stop<br />
# ntpdate &#60;ip-do-servidor-NTP&#62;<br />
# /etc/init.d/ntp start</code></p>
<p>Pronto, agora temos nosso servidor e clientes com data e hora atualizadas.</p>
<h2>Fontes e Referências</h2>
<ul>
<li><a title="NTP.br" href="http://www.ntp.br/" target="_blank">NTP.br</a>;</li>
<li><a title="ntpq - standard NTP query program" href="http://www.eecis.udel.edu/~mills/ntp/html/ntpq.html" target="_blank">ntpq &#8211; standard NTP query program</a>;</li>
<li><a title="SysAdmin - Sincronizando o relógio de seu micro com o NTP.br" href="http://www.dicas-l.com.br/sysadmin/sysadmin_20080127.php" target="_blank">SysAdmin &#8211; Sincronizando o relógio de seu micro com o NTP.br</a>;</li>
<li><a title="Mantendo o sincronismo da rede com NTP" href="http://www.g2ctech.com/artigos/uso-de-ntp.html" target="_blank">Mantendo o sincronismo da rede com NTP</a>;</li>
<li><a title="Quick HOWTO : Ch24 : The NTP Server" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch24_:_The_NTP_Server" target="_blank">Quick HOWTO : Ch24 : The NTP Server</a>;</li>
<li><a title="Servidor NTP para Linux" href="http://www.nara.org.br/servicos/ntp/servidor-ntp-para-linux" target="_blank">Servidor NTP para Linux</a>;</li>
<li><a title="NTP Server and Client Configuration in debian" href="http://www.debianadmin.com/ntp-server-and-client-configuration-in-debian.html" target="_blank">NTP Server and Client Configuration in debian</a>;</li>
<li><a title="Configuring NTP on a LINUX Server" href="http://dshowgirl.highend3d.com/2008/01/09/configuring-ntp-on-a-linux-server/" target="_blank">Configuring NTP on a LINUX Server</a>;</li>
<li><a title="Troubleshooting NTP" href="http://support.ntp.org/bin/view/Support/TroubleshootingNTP" target="_blank">Troubleshooting NTP</a>;</li>
<li><a title="ntpq - standard NTP query program" href="http://www.gsp.com/cgi-bin/man.cgi?section=8&#38;topic=ntpq#4" target="_blank">ntpq &#8211; standard NTP query program</a>;</li>
<li>man ntp, man ntpq, man ntp.conf, man ntp.drift.</li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Timekeeping in VMware... o my...]]></title>
<link>http://sysengineers.wordpress.com/2009/03/03/timekeeping-in-vmware-o-my/</link>
<pubDate>Tue, 03 Mar 2009 10:12:48 +0000</pubDate>
<dc:creator>chrisgralike</dc:creator>
<guid>http://sysengineers.wordpress.com/2009/03/03/timekeeping-in-vmware-o-my/</guid>
<description><![CDATA[If there is a subject that has many and i realy mean many posts, and with these posts many many read]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If there is a subject that has many and i realy mean many posts, and with these posts many many readers its timekeeping in vmware. Especially when your Guest OS is of the linux platform. Also there are many suggestions on how to solve this problem. Too give you guys a quick glace of whats happening out there&#8230; Some of the suggestions you might encounter.</p>
<p>1. Cron the ntpd refresh command. (put the ntp renew in a task and execute it every second)<br />
    <em>(Not realy an option with 100Servers+ and loads, loads of network traffic)</em><br />
2. Recompile the kernel using the 100Hz frequency setting instead of the 1000 or 250hz setting.<br />
    <em>(One I want to test before discarding it, he might have a point there)</em><br />
3. Patch the kernel / NTPD using the latest versions.<br />
    <em> (Should be a standard job and best practice, not an suggestion!)<br />
</em>4. Use a VMWare compatible compiled rpm to reinstall the kernel.<br />
   <em>  (Sounds much like option 2 i want to test first, ill go for the manual compile <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )<br />
</em>5. dont even want to mention all these other options <br />
<em>     (too silly but fun reading <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</em></p>
<p>With all respect to the guys searching and finding solutions stated above. There was indeed a time these solutions where the best to apply. But time has gone past, vmware introduced solutions using the VMWare tools (almost the same a the cron solution). And communities responded comitted to solve these problems for their most valued distro. The result is a setting in the kernel that is available for various kernels, and these settings can be found on the VMware site. Even though i commited myself to test these various options before implementing one or the other, the bootloader option looks the savest to suggest too the big audience. So here it is.</p>
<p><a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&#38;cmd=displayKC&#38;externalId=1006427">http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&#38;cmd=displayKC&#38;externalId=1006427</a></p>
<p>Oh always there are people to thank <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
• My uncle for paying way more attention then me <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Marco Gralike<br />
• Prutser for breaking open the kernel discussion, good article there.<br />
<a href="http://prutser.wordpress.com/2009/02/08/why-does-my-linux-virtual-machine-lose-time/">http://prutser.wordpress.com/2009/02/08/why-does-my-linux-virtual-machine-lose-time/</a><br />
•  VMware for maintaining there KB so well <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
• You for taking the time to read this nonsense <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Configuring ntpd]]></title>
<link>http://evugar.wordpress.com/2009/01/28/configuring-ntpd/</link>
<pubDate>Wed, 28 Jan 2009 23:21:09 +0000</pubDate>
<dc:creator>evugar</dc:creator>
<guid>http://evugar.wordpress.com/2009/01/28/configuring-ntpd/</guid>
<description><![CDATA[In rc.conf: DAEMONS=(&#8230; ntpd) In ntp.conf: server ntp1.sp.se tinker panic 0]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>In rc.conf:</p>
<blockquote><p>DAEMONS=(&#8230; ntpd)</p></blockquote>
<p>In ntp.conf:</p>
<blockquote><p>server ntp1.sp.se</p>
<p>tinker panic 0</p></blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Arch Linux - Personalizing my system Part 1]]></title>
<link>http://shagadelic.wordpress.com/2008/12/21/arch-linux-personalizing-my-system-part-1/</link>
<pubDate>Sun, 21 Dec 2008 12:32:34 +0000</pubDate>
<dc:creator>shagadelic</dc:creator>
<guid>http://shagadelic.wordpress.com/2008/12/21/arch-linux-personalizing-my-system-part-1/</guid>
<description><![CDATA[There are a few things I want to do to my system.  I&#8217;ll think of some more I&#8217;m sure but ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>There are a few things I want to do to my system.  I&#8217;ll think of some more I&#8217;m sure but for now, I&#8217;ll install codecs, Flash, get network time protocol working, and get my 5-button mouse to make Firefox go back a page.  Oh, I&#8217;m actually blogging from my Arch system now.  I could have done the last one from it but I felt like sitting on the couch with the laptop at the time.</p>
<p>Installing all the gstreamer codecs I wanted was pretty easy.  If you look at the screen while Gnome is installing, it&#8217;ll tell you the package names or you can just search for gstreamer on the Arch main page and then install them with pacman.</p>
<p>Installing Flash was easy as well &#8211; pacman -S flashplugin , then restart Firefox and you&#8217;re done.</p>
<p>Network Time Protocol was a little tougher.  I like my system clock to be accurate though.  The <a title="OpenNTPD wiki page" href="http://wiki.archlinux.org/index.php/Ntpd" target="_blank">wiki page</a> recommends using OpenNTPD which I&#8217;ve never used so I thought I&#8217;d try it.  It is indeed easier than setting up NTPD.  The only problem I had was that when I followed the directions, it didn&#8217;t work.  The log file seemed to indicate that it couldn&#8217;t find the server so I tried to ping pool.ntp.org and sure enough, nothing.  I dug a little more and found us.pool.ntp.org worked and after changing the config file and restarting, my clock was updated.</p>
<p>There are a couple things I&#8217;m not sure about with OpenNTPD.  It looks to me like it only adjusts your clock on bootup.  That works perfectly on my desktop computer with a wired connection (as long as you start OpenNTPD after the network&#8217;s up).  I&#8217;m not sure how this would work on a laptop with wireless where the network doesn&#8217;t usually come up until you log in and get it working.  I&#8217;m also not sure if this would work well for a system that&#8217;s on most of the time since it may not correct the clock&#8217;s drift.  If anybody knows the answers, please let me know.</p>
<p>Now for my Microsoft Intellimouse.  I followed the directions <a title="5- button mouse directions" href="http://wiki.archlinux.org/index.php/Xorg#Extra_mouse_buttons_not_working" target="_blank">here</a> but the side buttons still didn&#8217;t work as forward/back in Firefox.  After a little googling I found <a title="Firefox 3 mouse buttons" href="http://support.mozilla.com/en-US/kb/Mouse+buttons+do+not+work+as+Back+and+Forward" target="_blank">this.</a> Now my buttons work in Firefox 3.</p>
<p>It looks like there are some other ways to do this but changing the Firefox config was the simplest and worked without installing more software.  If you want your side buttons to work in other programs like Nautilus, you may have to try one of the other ways though.</p>
<p>Ok, I guess that was everything I wanted to get done this morning.  I&#8217;ll think of more stuff to do later.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Uhrzeit mit cron.daily und ntpdate auf dem neusten Stand halten]]></title>
<link>http://rorschachstagebuch.wordpress.com/2008/12/19/uhrzeit-mit-crondaily-und-ntpd-auf-dem-neusten-stand-halten/</link>
<pubDate>Fri, 19 Dec 2008 10:10:57 +0000</pubDate>
<dc:creator>Rorschach</dc:creator>
<guid>http://rorschachstagebuch.wordpress.com/2008/12/19/uhrzeit-mit-crondaily-und-ntpd-auf-dem-neusten-stand-halten/</guid>
<description><![CDATA[[Warnung: Die folgende Lösung zur Synchronisierung seiner Systemzeit birgt einige Risiken, auf welch]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>[<b>Warnung:</b> Die folgende Lösung zur Synchronisierung seiner Systemzeit birgt einige Risiken, auf welche Chrisss in dem Artikel <a href="http://christoph-langner.de/de/2008/12/die-uhrzeit-eines-rechners-uber-das-internet-stellen">Die Uhrzeit über das Internet stellen</a> in seinem Blog hinweist und gleich eine Methode nennt die diese Risiken nicht besitzt.]</p>
<p>Ich hab mir ein kleines Skript geschrieben, was ich mit euch teilen will. Wenn man es nach /etc/cron.daily legt und ausführbar macht wählt es täglich aus einer gegebenen Liste einen zufälligen ntpd-Server aus und synchronisiert mit diesem die System-Zeit:<br />
<code><br />
#!/bin/bash</p>
<p>ntpserver=( ntpdserver1.de ntpdserver2.de ntpdserver3.com )<br />
r=` /bin/echo $RANDOM &#124;/usr/bin/cksum &#124; /usr/bin/cut -f1 -d" "`<br />
d=`/usr/bin/expr \( $r % 5 \) + 1 `</p>
<p>/usr/sbin/ntpdate -u ${ntpserver[$d]} &#62; /dev/null<br />
</code></p>
<p>(Hinweis: Es kann sein, dass die beiden Gänsefüsschen hinter dem -d durch den Code-Tag von html falsch dargestellt werden. Wenn ihr also Copy&#38;Paste macht, entfernt die beiden falschen Gänsefüßchen und ersetzt sie durch richtige. Also bei de-Tastaturlayout: Shift+2)</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Summer time]]></title>
<link>http://oei.yungchin.nl/2008/03/31/summer-time/</link>
<pubDate>Mon, 31 Mar 2008 23:13:57 +0000</pubDate>
<dc:creator>yungchin</dc:creator>
<guid>http://oei.yungchin.nl/2008/03/31/summer-time/</guid>
<description><![CDATA[With the switch to summer time this weekend, I tried to figure out how to properly configure time on]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>With the switch to summer time this weekend, I tried to figure out how to properly configure time on my Debian system. It&#8217;s always hard to find the right search terms, so in case you have the same questions and didn&#8217;t find what you&#8217;re looking for yet: <b><a href="http://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html" title="debian.org documentation pages">this</a></b> is the most reliable and comprehensive documentation I came across. Explains everything from the date command to time zones, and from the network time protocol (NTP) to the hardware clock (<b>edit</b>: and of course it also explains how daylight saving time is handled!). Hope it helps&#8230;</p>
<p>(My system happened to be badly configured &#8211; not sure when/where I went wrong, but ntpd wasn&#8217;t running although I had installed and set it up before. That&#8217;s probably because the clock was an hour off, which made it panic. I got it back on track using ntpdate to set the clock, then doing &#8220;/etc/init.d/ntp restart&#8221;. Also, for some reason the system thought my hardware clock was on local time &#8211; it&#8217;s not &#8211; so I corrected that now with &#8220;hwclock &#8211;utc &#8211;systohc&#8221; which also adjusts the hardware clock to the ntp-provided time. <b>edit: </b>and in addition I should have edited /etc/default/rcS &#8211; as is in fact mentioned on the page I linked to above&#8230;)</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[El servicio ntpd en mandriva 2008]]></title>
<link>http://insanecrew.wordpress.com/2008/01/31/el-servicio-ntpd-en-mandriva-2008/</link>
<pubDate>Thu, 31 Jan 2008 11:45:17 +0000</pubDate>
<dc:creator>bersuitvera</dc:creator>
<guid>http://insanecrew.wordpress.com/2008/01/31/el-servicio-ntpd-en-mandriva-2008/</guid>
<description><![CDATA[1-Introducción Network Time Protocol (NTP) es un protocolo de internet para sincronizar los relojes ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><b>1-Introducción </b></p>
<p><b>Network Time Protocol</b> (<i>NTP</i>) es un <a href="http://es.wikipedia.org/wiki/Protocolo" title="Protocolo">protocolo</a> de <a href="http://es.wikipedia.org/wiki/Internet" title="Internet">internet</a> para sincronizar los relojes de los <a href="http://es.wikipedia.org/wiki/Sistema_inform%C3%A1tico" title="Sistema informático">sistemas informáticos</a> a través de <a href="http://es.wikipedia.org/wiki/Router" title="Router">ruteo</a> de paquetes en redes con <a href="http://es.wikipedia.org/wiki/Latencia" title="Latencia">latencia</a> variable. NTP utiliza el <a href="http://es.wikipedia.org/wiki/Puerto_%28computaci%C3%B3n%29" title="Puerto (computación)">puerto</a> <a href="http://es.wikipedia.org/wiki/UDP" title="UDP">UDP</a> 123 como su <a href="http://es.wikipedia.org/wiki/Nivel_de_transporte" title="Nivel de transporte">capa de transporte</a>. Está diseñado para resistir los efectos de la latencia variable.</p>
<p><!--more--></p>
<p>NTP es uno de los <a href="http://es.wikipedia.org/wiki/Familia_de_protocolos_de_Internet" title="Familia de protocolos de Internet">protocolos de internet</a> más viejos que siguen en uso (desde antes de 1985). NTP fue diseñado originalmente por <a href="http://es.wikipedia.org/w/index.php?title=David_L._Mills&#38;action=edit" class="new" title="David L. Mills">Dave Mills</a> de la <a href="http://es.wikipedia.org/w/index.php?title=Universidad_de_Delaware&#38;action=edit" class="new" title="Universidad de Delaware">Universidad de Delaware</a>, el cual lo sigue manteniendo, en conjunto con un equipo de voluntarios.</p>
<p>El <a href="http://es.wikipedia.org/wiki/Demonio_%28inform%C3%A1tica%29" title="Demonio (informática)">demonio</a> NTP de unix es un proceso de nivel de usuario que se ejecuta continuamente en la máquina que soporta NTP, y la mayor parte del protocolo está implementado en este proceso de usuario. Para obtener el mejor rendimiento de NTP, es importante tener un reloj NTP estándar <a href="http://es.wikipedia.org/wiki/Lazo_de_seguimiento_de_fase" title="Lazo de seguimiento de fase">con lazo de seguimiento de fase</a> implementado en el kernel del <a href="http://es.wikipedia.org/wiki/Sistema_operativo" title="Sistema operativo">Sistema operativo</a>, en vez de sólo usar la intervención de un demonio NTP externo: todas las versiones actuales de <a href="http://es.wikipedia.org/wiki/Linux" title="Linux">Linux</a> y <a href="http://es.wikipedia.org/wiki/Solaris" title="Solaris">Solaris</a> soportan esta característica. para saber <a href="http://es.wikipedia.org/wiki/Network_Time_Protocol">más&#8230;.</a></p>
<p><b>2- Instalando que es gerundio</b></p>
<p>[root@insane ~]# urpmq -i ntpd<br />
no hdlist for medium &#8220;Contrib (Official2008.0-5)&#8221;, only partial result for package openntpd<br />
Name        : openntpd<br />
Version     : 3.9p1<br />
Release     : 1mdv2008.0<br />
Group       : System/Servers<br />
Size        : 89759                        Architecture: i586<br />
Summary     : OpenNTPD &#8211; NTP Time Synchronization Client/Server<br />
[root@insane ~]# urpmi &#8211;wget ntpd<br />
Para satisfacer las dependencias, se instalará el paquete siguiente<br />
Package                        Version      Release       Arch<br />
(medium &#8220;Contrib (Official2008.0-5)&#8221;)<br />
openntpd                       3.9p1        1mdv2008.0    i586<br />
87KB of additional disk space will be used.<br />
¿Efectuar la instalación del paquete? (S/n) S</p>
<p>http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/2008.0/i586/media/contrib/release/openntpd-3.9p1-1mdv2008.0.i586.rpm</p>
<p>instalando openntpd-3.9p1-1mdv2008.0.i586.rpm desde /var/cache/urpmi/rpms<br />
Preparando&#8230;                    ###################################################<br />
1/1: openntpd              #############################################################</p>
<p><b>3- Revisando la configuración</b><br />
Edite el fichero /etc/ntpd.conf ..-<br />
Sólo contiene una linea  <i> servers pool.ntp.org  </i><b>WTF!!</b><i>! </i>el pool de servidores de stratum 2 contra los que nos sincronizamos, pero queremos que nuestro server de la hora a la red local, asi que vamos a ello&#8230;<br />
Navegando un poco encontramos varios manuales muy completos sobre el servicio NTP <a href="http://www.oxixares.com/~gbv/hora.html">http://www.oxixares.com/~gbv/hora.html </a> pero cuando intento configurar /etc/ntpd.conf como explica el tutorial anterior obtengo errores de configuración, vayamos más despacio</p>
<p><i>[bersuit@insane Incoming]$ rpm -qa &#124; grep -i ntpd<br />
openntpd-3.9p1-1mdv2008.0<br />
[bersuit@insane Incoming]$<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</i></p>
<p><i>[root@pato ~]# rpm -qa &#124; grep -i ^ntp<br />
ntp-4.2.0.a.20040617-4<br />
[root@pato ~]#</i></p>
<p>Pato es un servidor <a href="http://www.redhat.es">Red Hat </a>corporativo, que confirma mis sospechas, la implementación del servicio ntpd que hace Mandriva no es la misma que Red Hat , mandriva usa <a href="http://www.openntpd.org/">openntpd </a>frente a <a href="http://www.alcancelibre.org/staticpages/index.php/como-ntp" title="CentOS NTP">ntp</a> que usa Red Hat y Guillermo en su tutorial que funciona con <a href="http://ftp.cl.debian.org/man-es/ntp.html">Debian </a>y SuSe.</p>
<p>Tirando un poco de <a href="http://en.wikipedia.org/wiki/OpenNTPD">wikipedia </a> descubrimos que existe una implementación por parte de <a href="http://www.openntpd.org/">openbsd</a> basada en los siguientes criterios:</p>
<ul>
<li>Los demonios ntp actuales son complejos y difíciles de configurar o tienen una licencia &#8220;no demasiado libre&#8221;</li>
<li>El objetivo de los creadores de openntpd era crear un servicio ntp gratuito, seguro, robusto y fácil de configurar.</li>
</ul>
<p>OpenNTPD ha sido criticado por ser menos precisos que el demonio NTP producido por <a href="http://www.ntp.org">www.ntp.org</a> Si bien el proyecto OpenNTPD admite la  reclamación, señala esto como un compromiso entre la precisión y la simplicidad.</p>
<p><b>4. NO MORE rollos!!! vamos con la configuración del servicio </b></p>
<p>El fichero de configuración del servicio se encuentra en <i>/etc/ntpd.conf</i> . Los parámetros básicos a configurar son los siguientes:</p>
<ul>
<li><i>listen on [address]</i> señala en que interfaces de la máquina escuchará nuestro servicio,  por defecto no escuchamos peticiones, solamente nos mantenemos en hora., como queremos que nuestra servidor ofrezca la hora a nuestra red podríamos poner algo asi como:<br />
l<i>isten on 192.168.x.y</i></li>
<li><i>sensor device [correction microseconds] [weight weight-value]</i>, en el caso que seamos stratum 1 y tengamos un &#8220;bicho&#8221; (GPS,radio frecuencia &#8230;) que nos de la hora de una forma muy precisa, la corrección si fuese necesario y el peso de este servidor.</li>
<li><i>server address [weigth weight-value] </i>podemos especificar tantas directivas server como queramos con los servidores ntp que nos parezca (Ojo no poner stratum 1 para nuestra red un stratum 3 seria suficiente y respetamos la jerarquía) y segun el peso que le adjudiquemos preguntara antes a unos o a otros</li>
<li><i>servers address</i> igual que la anterior pero nos permite colocar un pool de servidores ( que parace no ser más que un balanceo Round-Robin de DNS )</li>
</ul>
<p><i>[root@insane ~]# nslookup pool.ntp.org<br />
Server:         62.42.230.24<br />
Address:        62.42.230.24#53</i></p>
<p><i>Non-authoritative answer:<br />
Name:   pool.ntp.org<br />
Address: 80.59.234.233<br />
Name:   pool.ntp.org<br />
Address: 195.10.6.126<br />
Name:   pool.ntp.org<br />
Address: 212.9.75.245</i></p>
<p><b>5- Finalizando</b></p>
<p>Me parece una estupenda idea por parte de <a href="http://www.mandriva.com/">mandriva</a>  la de optar por openntpd frente a ntpd , la única cosa que hecho en falta es poder reducir quién puede consultarnos la hora, que se puede hacer en ntpd. Aunque tampoco es un problema que no se pueda solucionar con un poco de maña en el iptables local o  filtrando el 123 UDP en el firewall de salida al exterior.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[OpenNTPD]]></title>
<link>http://izamo.wordpress.com/2007/10/09/openntpd/</link>
<pubDate>Tue, 09 Oct 2007 20:59:14 +0000</pubDate>
<dc:creator>ek~</dc:creator>
<guid>http://izamo.wordpress.com/2007/10/09/openntpd/</guid>
<description><![CDATA[NTP (Network Time Protocol) según la Wikipedia es: un protocolo de Internet para sincronizar los rel]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>NTP</strong> (<em>Network Time Protocol</em>) según la <a href="http://es.wikipedia.org/wiki/Network_Time_Protocol" title="NTP">Wikipedia</a> es:</p>
<blockquote><p>un protocolo de Internet para sincronizar los relojes de los sistemas informáticos a través de ruteo de paquetes en redes con latencia variable.</p></blockquote>
<p>Este protocolo, en sistemas <strong>UNIX</strong>, se usa a través de un <strong><em>demonio</em></strong> (programa que se ejecuta de manera continua en segundo plano) . <strong>OpenNTPD</strong> es una implementación libre del protocolo <strong>NTP</strong> creada por la gente del proyecto <strong>OpenBSD</strong>, principalmente por <strong>Henning Brauer</strong>.</p>
<p>La instalación en cualquier distribución <strong>GNU/Linux</strong>, de la versión portable de este demonio, es bastante sencilla ya que este programa es básico, así que usando <strong>pacman</strong>, <strong>apt-get</strong> (<strong>Synaptic</strong>), <strong>urpmi</strong>, <strong>yast</strong>, etc, no debería ser difícil de instalar o encontrar. En lo correspondiente a la configuración del <em>demonio</em> podemos realizarla desde el archivo ubicado en <strong>/etc/ntpd.conf</strong> que tiene este aspecto:</p>
<blockquote><p># $OpenBSD: ntpd.conf,v 1.7 2004/07/20 17:38:35 henning Exp $<br />
# sample ntpd configuration file, see ntpd.conf(5)</p>
<p># Addresses to listen on (ntpd does not listen by default)<br />
#<strong>listen on *</strong><br />
#listen on 127.0.0.1<br />
#listen on ::1</p>
<p># sync to a single server<br />
#<strong>server ntp.example.org</strong></p>
<p># use a random selection of 8 public stratum 2 servers<br />
# see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers<br />
<strong>servers north-america.pool.ntp.org</strong></p></blockquote>
<p>Las lineas <strong>listen on</strong> las usamos para que el <em>demonio</em> escuche (se necesita el puerto 123 abierto) peticiones de la ip o el nombre del host y así poder servir a esa maquina. Las lineas <strong>server</strong> y <strong>servers</strong> son para indicar el servidor que usaremos para sincronizar nuestro reloj. En la pagina <a href="http://support.ntp.org/bin/view/Main/WebHome" title=" The NTP Public Services Project"><strong>The NTP Public Services Project</strong></a> podemos encontrar una lista de servidores o <em>pools</em> de servidores que podemos usar. En mi caso use el (<em>pool</em>) servidor <strong>north-america.pool.ntp.org</strong>.</p>
<p>Después de finalizar estas sencillas configuraciones ya solo queda indicar que el demonio <strong>openntpd</strong> debe ejecutarse al inicio de nuestro sistema y es todo&#8230; no más desincronización de reloj.</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
