你还在为不知道思科路由器交换机的ntp常用配置而烦恼么?接下来是我为大家收集的思科路由器交换机的ntp常用配置教程,希望能帮到大家。
思科路由器交换机的ntp常用配置的方法Client:
clock timezone CN 8
ntp server 10.8.68.202
ntp source vlan 1
ntp update-calendar
================================================
Server
clock timezone CN 8
ntp server 10.8.68.202
ntp source vlan 1
ntp update-calendar 将硬件时钟与当前clock同步
clock calendar-valid 设定硬件时钟为权威NTPserver
ntp master 8 把此设备作为NTP服务器使用时,要加上这条。
=================================================
show calendar
show clock
show clock detail
show ntp status
show ntp associations
sh ntp associations detail
如果ntp时间没有正常同步,那么用show clock命令看到结果会是
****_LAN-DistSW02#show clock
.15:11:31.451 GMT Wed Mar 5 2014
注意前面有一个点。
NTP(Network Time Protocol,网络时间协议)是基于RFC1305的协议,是一个跨越广域网或局域网的复杂的同步时间协议。一般情况下建议配置在路由器上,当然配置在其它设备上都是可以的。接下来我们根据下面的拓扑图来看一下在路由器上配置NTP服务器的方法以及交换机、windows服务器、Linux服务器如何设置NTP客户端。拓扑如下:路由器NTPserver上配置如下:
R1>en
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#hostname NTPserver
NTPserver(config)#no ip do lo
NTPserver(config)#line con 0
NTPserver(config-line)#exec-t 0 0
NTPserver(config-line)#logg syn
NTPserver(config-line)#exit
NTPserver(config)#int e0/1
NTPserver(config-if)#int e0/0
NTPserver(config-if)#exi
NTPserver(config)#int e0/0
NTPserver(config-if)#ip ad 192.168.1.1 255.255.255.0
NTPserver(config-if)#no shut
NTPserver(config-if)#
*Mar 1 00:02:39.959: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Mar 1 00:02:40.959: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
NTPserver(config-if)#clock time
NTPserver(config-if)#do wr
Building configuration...
[OK]
NTPserver(config-if)#exit
NTPserver(config)#cloc
NTPserver(config)#clock time
NTPserver(config)#clock timezone peking +8
NTPserver(config)#
*Mar 1 00:03:27.019: %SYS-6-CLOCKUPDATE: System clock has been updated from 00:03:27 UTC Fri Mar 1 2002 to 08:03:27 peking Fri Mar 1 2002, configured from console by console.
NTPserver(config)#exit
NTPserver#
*Mar 1 00:04:02.975: %SYS-5-CONFIG_I: Configured from console by console
NTPserver#cloc
NTPserver#clock set 12:02:20 6 Aug 2012
NTPserver#
*Aug 6 04:02:20.003: %SYS-6-CLOCKUPDATE: System clock has been updated from 08:04:45 peking Fri Mar 1 2002 to 12:02:20 peking Mon Aug 6 2012, configured from console by console.
NTPserver#conf t
Enter configuration commands, one per line. End with CNTL/Z.
NTPserver(config)#ntp master
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)