cisco交換機(jī)時(shí)間設(shè)置時(shí)間
Cisco并不難,主要有些人沒有接觸的機(jī)會(huì),如果你經(jīng)常管理cisco設(shè)備,你會(huì)發(fā)現(xiàn)其實(shí)就那幾步,不過(guò)也有不少網(wǎng)友不知道cisco交換機(jī)時(shí)間設(shè)置時(shí)間怎么設(shè)置。其實(shí)步驟并不難,下面學(xué)習(xí)啦小編給大家介紹一下具體操作辦法,供大家參考!
cisco交換機(jī)時(shí)間設(shè)置時(shí)間具體操作
將CISCO6509配置為標(biāo)準(zhǔn)時(shí)間服務(wù)器
ntp server 192.168.0.101
查詢當(dāng)前的時(shí)間
Cisco6509#show clock
00:09:13.643 PDT Tue Jun 30 2009
配置一個(gè)北京時(shí)區(qū),隨意取名
clock timezone Beijing 8
再查詢一下,已經(jīng)同步過(guò)來(lái)了
CISCO6509#show clock
15:10:00.239 Beijing Tue Jun 30 2009
設(shè)定硬件時(shí)鐘為權(quán)威NTPserver
(config)#clock calendar-valid
調(diào)整時(shí)間
#clock set 15:00:00 30 jun 2009
當(dāng)前時(shí)鐘為
#show clock
15:15:10.705 Beijing Tue Jun 30 2009
當(dāng)前硬件時(shí)鐘為
#show calendar
14:37:59 Beijing Tue Jun 30 2009
NTP源為vlan2
(config)#ntp source vlan 2
將同步其他時(shí)間去除
no ntp server 10.20.0.103
將硬件時(shí)鐘與當(dāng)前clock同步
#clock update-calendar
查看當(dāng)前clock時(shí)間
#show clock
.15:47:57.558 Beijing Tue Jun 30 2009
查看當(dāng)前硬件時(shí)鐘
#show calendar
15:48:00 Beijing Tue Jun 30 2009
配置系統(tǒng)debug記錄的時(shí)間格式
(config)#service timestamps debug datetime localtime
配置系統(tǒng)日志記錄時(shí)間格式
(config)#service timestamps log datetime localtime
設(shè)置與其他時(shí)間服務(wù)器同步
(config)#ntp server 192.168.0.102
設(shè)置為第一級(jí)ntp服務(wù)器
(config)#ntp master 1
允許更新硬件時(shí)鐘(不必須)
(config)#ntp update-calendar
查看的ntp設(shè)置的命令
sh clock detail
sh ntp sta
sh ntp ass
sh ntp ass detail
----配置命令
ntp authentication-key 1 md5 xx
ntp source Loopback0
ntp server 10.10.10.1 key 1
配置方法:
// router 7206
conf t
ntp source FastEthernet0/1 //指定更新源地址,覆蓋ntp server中的配置
ntp update-calendar //設(shè)備如帶有硬件時(shí)鐘,同時(shí)更新硬件時(shí)鐘
ntp server 202.155.248.218 source FastEthernet0/1 //指定更新目的地址,香港,并指定更新源接口為f0/1.
int f0/1
ntp enable
這時(shí)你應(yīng)該已經(jīng)獲得了時(shí)間,但是注意,時(shí)區(qū)是否正確,默認(rèn)為格林威治時(shí)間,如想改為北京時(shí)間,下面這步是必不可少的。
Core-Switch-1#show clock
Core-Switch-1#show ntp status
Core-Switch-1#conf t
Core-Switch-1(config)# clock timezone GMT +8
Core-Switch-1(config)#service timestamps debug datetime msec localtime show-timezone
Core-Switch-1(config)#service timestamps log datetime msec localtime show-timezone
Core-Switch-1(config)#exit
Core-Switch-1# clock set 13:51:00 Sep 7 2011
或通過(guò)NTP服務(wù)器時(shí)間同步:
Core-Switch-1#ntp server 192.168.0.254 key 8888 注:8888是指ntp服務(wù)器的Key值
Core-Switch-1#wr
Core-Switch-1#sh log
默認(rèn)情況下日志消息不包括日期和時(shí)間戳。
service timestamps {debug | log } uptime
service timestamps {debug | log } datetime [mesc] [localtime] [show-timezone] [year]
debug 參數(shù) 在調(diào)試輸出時(shí)包括時(shí)間戳
log 參數(shù) 在每種日志消息中添加一個(gè)時(shí)間戳
uptime 在消息中包括路由器開機(jī)以來(lái)的時(shí)間
0w2d: #SYS-5-CONFIG_I : Configured from console by console
0w2d 開機(jī)后0周2天
datetime 顯示準(zhǔn)確的日期和時(shí)間 UTC 格式 標(biāo)準(zhǔn)格式 MM DD HH:MM:SS
datetime后面可以跟一些參數(shù)
mesc 消息中包括毫秒信息
localtime 顯示基于本地配置的時(shí)區(qū)時(shí)間
show-timezone 輸出包括時(shí)區(qū)名稱
year 輸出包括年份信息
未設(shè)置時(shí)間前:
#sh log
4w0d: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to up
4w0d: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down
4w0d: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to up
4w1d: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down
4w1d: %LINK-3-UPDOWN: Interface FastEthernet0/5, changed state to down
4w1d: %LINK-3-UPDOWN: Interface FastEthernet0/5, changed state to up
4w1d: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up
4w1d: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down
4w1d: %LINK-3-UPDOWN: Interface FastEthernet0/3, changed state to down
4w1d: %LINK-3-UPDOWN: Interface FastEthernet0/3, changed state to up
4w1d: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up
設(shè)置后
#sh log
.Sep 7 05:59:22: %SYS-6-CLOCKUPDATE: System clock has been updated from 13:59:22 BJ Wed Sep 7 2011 to 05:59:22 UTC Wed Sep 7 2011, configured from console by wht on vty2 (172.16.100.10).
.Sep 7 13:59:23: %SYS-6-CLOCKUPDATE: System clock has been updated from 05:59:23 UTC Wed Sep 7 2011 to 13:59:23 GMT Wed Sep 7 2011, configured from console by wht on vty2 (172.16.100.10).
.Sep 7 13:59:24: %SYS-5-CONFIG_I: Configured from console by wht on vty2 (172.16.100.10)
.Sep 7 13:58:00: %SYS-6-CLOCKUPDATE: System clock has been updated from 14:00:05 GMT Wed Sep 7 2011 to 13:58:00 GMT Wed Sep 7 2011, configured from console by wht on vty2 (172.16.100.10).
學(xué)習(xí)啦小編分享了cisco交換機(jī)時(shí)間設(shè)置時(shí)間的解決方法。希望大家喜歡。