修改Cisco交换机ntp服务器,如何配置Brocade和Cisco光纤交换机的NTP服务器
如何配置Brocade和Cisco光纖交換機的NTP服務(wù)器
轉(zhuǎn)載請在文首保留原文出處:EMC中文支持論壇
介紹
在大型的企業(yè)網(wǎng)絡(luò),給所有的網(wǎng)絡(luò)設(shè)備設(shè)置一個標準的時間是很有必要的。當需要生成管理報表,或者從多臺設(shè)備的日志中尋找關(guān)聯(lián)的事件時,這會帶來很大的便利。有些企業(yè)客戶甚至會為他們的關(guān)鍵業(yè)務(wù)配備一級時間服務(wù)器(Stratum-1 NTP)。
互聯(lián)網(wǎng)中有許多免費的NTP時間服務(wù)器,如poo.ntp.org。通常NTP默認是不開啟的,本文將介紹如何給Brocade或Cisco的光纖交換機配置NTP服務(wù)器。
更多信息
Brocade基本命令:
tsclockserver[ipaddr [; ipaddr ...]]
例如:
設(shè)置NTP服務(wù)器為指定IP:
switch:admin> tsclockserver 123.123.123.123
設(shè)置多個NTP服務(wù)器:
switch:admin> tsclockserver "12.134.125.24; 12.234.87.01"
注:Principle switch會將NTP設(shè)定分發(fā)到整個光纖網(wǎng)絡(luò)(fabric)。
交互方式設(shè)置時區(qū)(time zone):
tstimezone--interactive
關(guān)閉NTP (設(shè)為本地時間):
tsclockserverLOCL
Cisco基本命令:
ntpenable
ntpserver {ip-address | ipv6-address | dns-name}
ntppeer {ip-address | ipv6-address | dns-name}
ntpdistribute
ntpcommit
開啟NTP協(xié)議:
switch# configure terminal
switch(config)# ntp enable
switch(config)# copy running-config startup-config
配置NTP服務(wù)器或服務(wù)器對(peer):
switch# configure terminal
switch(config)# ntp server 192.0.2.10
或switch(config)# ntp peer 2001:0db8::4101
showntp peers
copyrunning-config startup-config
顯示或清除NTP統(tǒng)計數(shù)據(jù):
switch# show ntp statistics all-peers
switch# clear ntp statistics all-peers
啟用NTP分發(fā)(NTP distribution),將NTP配置分發(fā)到整個光纖網(wǎng)絡(luò)。此功能需要開啟Cisco Fabric Services (CFS):
switch# configure terminal
swtich(config)# ntp distribute
swtich(config)# show ntp status
swtich(config)# copy running-config startup-config
提交NTP配置的更改:
switch# configure terminal
swtich(config)# ntp commit
swtich(config)# show ntp session status
swtich(config)# copy running-config startup-configfabric
撤銷NTP配置的更改:
switch# configure terminal
swtich(config)# ntp abort
swtich(config)# show ntp session status
注:如果已經(jīng)執(zhí)行了NTP相關(guān)操作但忘記提交或撤銷更改的設(shè)置,NTP session可能會被鎖住。管理員可以在光纖網(wǎng)絡(luò)中任意一臺交換機上執(zhí)行clearntp session以解除NTP設(shè)置鎖。
使用以下命令確認NTP配置:
showntp peer-status
showntp peers
showntp pending peers
showntp pending-diff
showntp session status
showntp statistics { io | local | memory | peer {ipv4-address | ipv6-address | dns-name}
showntp status
showntp timestamp status
CicsoMDS交換機為何無法從NTP服務(wù)器更新時間?
有時管理員可能會發(fā)現(xiàn)自己已經(jīng)在Fabric中設(shè)置了NTP服務(wù)器,但交換機始終不更新正確的時間。使用ntpsync-retry命令無效,show ntp peer-status的local那一欄也沒有mgmt0的IP地址:
switch#sh ntp peer-status
Total peers : 1
* - selected for sync, + -peer mode(active),
- - peer mode(passive), = - polled in client mode
remotelocalstpollreachdelay
-----------------------------------------------------------
=10.168.45.500.0.0.0166400.00000
這是因為交換機本地時間與NTP服務(wù)器的時間相差太大(超過1000秒),交換機會假定如此大的間隔可能是由于網(wǎng)絡(luò)或NTP服務(wù)器存在問題。為了防止?jié)撛诘钠茐?#xff0c;交換機將不會自動更新時間。要修復該問題,需要先手動設(shè)置一下交換機本地時間:
clockset {HH:MM:SS DD Month-in-words YYYY}
例如:clock set 15:58:09 23 September 2012
和時區(qū):
clocktimezone <0 to 50 minutes offset from UTC>
例如:clock timezone PST -8 0
然后再等待一段時間或執(zhí)行ntp sync-retry手動執(zhí)行一次同步即可。
參考
EMC知識庫文檔:emc238283 "Cisco: NTP fails to sync due to clock time set too far ahead or behind NTP server clock"
Brocade硬件參考手冊
Cisco MDS 9000 Family配置手冊
應用于
Brocade光纖交換機、Cisco MDS光纖交換機
總結(jié)
以上是生活随笔為你收集整理的修改Cisco交换机ntp服务器,如何配置Brocade和Cisco光纤交换机的NTP服务器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 选好食用油,为健康加油!
- 下一篇: 电脑突然上不了网,该怎么解决