修改Cisco交换机ntp服务器,如何配置Brocade和Cisco光纤交换机的NTP服务器
如何配置Brocade和Cisco光纖交換機的NTP服務器
轉載請在文首保留原文出處:EMC中文支持論壇
介紹
在大型的企業網絡,給所有的網絡設備設置一個標準的時間是很有必要的。當需要生成管理報表,或者從多臺設備的日志中尋找關聯的事件時,這會帶來很大的便利。有些企業客戶甚至會為他們的關鍵業務配備一級時間服務器(Stratum-1 NTP)。
互聯網中有許多免費的NTP時間服務器,如poo.ntp.org。通常NTP默認是不開啟的,本文將介紹如何給Brocade或Cisco的光纖交換機配置NTP服務器。
更多信息
Brocade基本命令:
tsclockserver[ipaddr [; ipaddr ...]]
例如:
設置NTP服務器為指定IP:
switch:admin> tsclockserver 123.123.123.123
設置多個NTP服務器:
switch:admin> tsclockserver "12.134.125.24; 12.234.87.01"
注:Principle switch會將NTP設定分發到整個光纖網絡(fabric)。
交互方式設置時區(time zone):
tstimezone--interactive
關閉NTP (設為本地時間):
tsclockserverLOCL
Cisco基本命令:
ntpenable
ntpserver {ip-address | ipv6-address | dns-name}
ntppeer {ip-address | ipv6-address | dns-name}
ntpdistribute
ntpcommit
開啟NTP協議:
switch# configure terminal
switch(config)# ntp enable
switch(config)# copy running-config startup-config
配置NTP服務器或服務器對(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統計數據:
switch# show ntp statistics all-peers
switch# clear ntp statistics all-peers
啟用NTP分發(NTP distribution),將NTP配置分發到整個光纖網絡。此功能需要開啟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
注:如果已經執行了NTP相關操作但忘記提交或撤銷更改的設置,NTP session可能會被鎖住。管理員可以在光纖網絡中任意一臺交換機上執行clearntp session以解除NTP設置鎖。
使用以下命令確認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服務器更新時間?
有時管理員可能會發現自己已經在Fabric中設置了NTP服務器,但交換機始終不更新正確的時間。使用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服務器的時間相差太大(超過1000秒),交換機會假定如此大的間隔可能是由于網絡或NTP服務器存在問題。為了防止潛在的破壞,交換機將不會自動更新時間。要修復該問題,需要先手動設置一下交換機本地時間:
clockset {HH:MM:SS DD Month-in-words YYYY}
例如:clock set 15:58:09 23 September 2012
和時區:
clocktimezone <0 to 50 minutes offset from UTC>
例如:clock timezone PST -8 0
然后再等待一段時間或執行ntp sync-retry手動執行一次同步即可。
參考
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光纖交換機
總結
以上是生活随笔為你收集整理的修改Cisco交换机ntp服务器,如何配置Brocade和Cisco光纤交换机的NTP服务器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 选好食用油,为健康加油!
- 下一篇: 电脑突然上不了网,该怎么解决