注意:以下方法配置完成后,交換機(jī)的時(shí)間將立即更新為時(shí)間服務(wù)器的時(shí)間。配置前請(qǐng)將交換機(jī)時(shí)區(qū)設(shè)置為東八區(qū)
下面以Cisco Catalyst 3560舉例:
Switch>enable //進(jìn)入特權(quán)模式 switch#conf t //進(jìn)入全局配置模式 switch(config)#clock timezone BeiJing 8 //設(shè)置時(shí)區(qū) switch(config)#ntp source vlan 1 //配置ntp源在vlan1接口下,這里你也可以配置成具體端口, switch(config)#ntp server 192.168.6.20 //配置與192.168.6.20這臺(tái)NTP服務(wù)器進(jìn)行時(shí)間同步 Switch(config)#exit //退出全局配置模式
檢查狀態(tài):
show ntp status show ntp associations detail show clock detail show clock //查看本機(jī)時(shí)間
配置完成后,默認(rèn)同步間隔為1分鐘。