问题:当前我们自己局域网中,每台设备的时钟存在差异,导致查看日志时不清楚事故发生的时间---》
解决办法:在核心设备配置NTP服务,让其余二层设备都从核心上同步NTP时间。
原理:核心设备向其他设备发送广播,其他设备接收到广播后更新clock时间,与核心进行时间同步。
配置如下:
core:
ntp-service refclock-master 127.127.1.1
ntp-service refclock-master 3
#创建vlan 100
vlan 100
#配置vlan 100 的管理地址
interface Vlanif100
ip address 192.168.1.1 255.255.255.0
ntp-service broadcast-server
#打通vlan 100
interface GigabitEthernet0/0/1
port link-type access
port default vlan 100
#打通vlan 100
interface GigabitEthernet0/0/2
port link-type access
port default vlan 100
#查看stp状态是否同步成功
display ntp-service status
--------------------------------------------------------------------------
LSW2:
vlan 100
interface Vlanif100
ip address 192.168.1.2 255.255.255.0
ntp-service broadcast-client
interface GigabitEthernet0/0/1
port link-type access
port default vlan 100
-----------------------------------------------------------------------------
LSW3:
vlan 100
interface Vlanif100
ip address 192.168.1.3 255.255.255.0
ntp-service broadcast-client
interface GigabitEthernet0/0/1
port link-type access
port default vlan 100
interface GigabitEthernet0/0/2
port link-type access
port default vlan 100
------------------------------------------------------------------------------
LSW4:
vlan 100
interface Vlanif100
ip address 192.168.1.4 255.255.255.0
ntp-service broadcast-client
interface GigabitEthernet0/0/1
port link-type access
port default vlan 100
------------------------------------------------------------------------------
以上配置好之后查看ntp状态,看看是否同步成功
display ntp-service status
未同步:
已经同步:
标签:service,NTP,vlan,access,交换机,ntp,100,port,时钟 From: https://www.cnblogs.com/pengtaotao/p/17714819.html