按 ‘ ntp ’ 标签归档

IOS 设备 NTP 配置示例

在日志和调试时加上时间戳

Router(config)#service timestamps log datetime localtime
Router(config)#service timestamps debug datetime localtime

设置时间

Router#clock set 15:30:00 January 1 2009
outer#calendar set 15:30:00 January 1 2009

Clock 和 Calendar 的区别:
Most Cisco routers have two clocks:a battery-powered hardware clock (referenced in CLI commands as the “calendar”) and a software clock (referenced in CLI commands as the “clock”). These two clocks are managed separately.
The primary source for time data on your system is the software clock. This clock runs from the moment the system starts up and keeps track of the current date and time. The software clock can be set from a number of sources and in turn can be used to distribute the current time through various mechanisms to other systems. When a router with a hardware clock is initialized or rebooted, the software clock is initially set based on the time in the hardware clock.

猛击阅读全文

NTP 概述

NTP(Network Time Protocol,网络时间协议)是由 RFC 1305 定义的时间同步协议,用来在分布式时间服务器和客户端之间进行时间同步。NTP 基于 UDP 报文进行传输,使用的 UDP 端口号为 123。

使用 NTP 的目的是对网络内所有具有时钟的设备进行时钟同步,使网络内所有设备的时钟保持一致,从而使设备能够提供基于统一时间的多种应用。对于运行 NTP 的本地系统,既可以接受来自其他时钟源的同步,又可以作为时钟源同步其他的时钟,并且可以和其他设备互相同步。

NTP 的基本工作原理如图所示:

猛击阅读全文