H3C 5560交换机 时间同步设置
配置NTP客户端/服务器模式
1. 组网需求
为了通过NTP实现Device B与Device A的时间同步,要求:
· 在Device A上设置本地时钟作为参考时钟,层数为2;
· 配置Device B工作在客户端模式,指定Device A为NTP服务器。
2. 组网图
图1-5 配置NTP客户端/服务器模式组网图

3. 配置步骤
(1) 按照图1-5配置各接口的IP地址,并确保路由可达,具体配置过程略。
(2) 配置Device A
# 开启NTP服务。
<DeviceA> system-view
[DeviceA] ntp-service enable
# 设置本地时钟作为参考时钟,层数为2。
[DeviceA] ntp-service refclock-master 2
(3) 配置Device B
# 开启NTP服务。
<DeviceB> system-view
[DeviceB] ntp-service enable
# 配置通过NTP协议获取时间。
[DeviceB] clock protocol ntp
# 设置Device A为Device B的NTP服务器。
[DeviceB] ntp-service unicast-server 1.0.1.11
实操案例:组网及说明

本案例采用H3C HCL模拟器来模拟NTP典型组网配置。在网络拓扑图中,SW1作为时钟源,SW2作为NTP客户端。
配置步骤
1、按照网络拓扑图正确配置IP地址
2、SW2开启NTP功能,指向SW1作为NTP服务器
3、SW1开启NTP功能,作为NTP时钟源
配置关键点
SW2:
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysname SW2
[SW2]int gi 1/0/1
[SW2-GigabitEthernet1/0/1]port link-mode route
[SW2-GigabitEthernet1/0/1]ip address 10.0.0.1 24
[SW2-GigabitEthernet1/0/1]quit
[SW2]ip route-static 0.0.0.0 0.0.0.0 10.0.0.2
SW2 NTP关键配置点:
[SW2]ntp-service enable
[SW2]ntp-service unicast-server 10.0.0.2 source GigabitEthernet 1/0/1
[SW2]clock protocol ntp
SW1:
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysname SW1
[SW1]int gi 1/0/1
[SW1-GigabitEthernet1/0/1]port link-mode route
[SW1-GigabitEthernet1/0/1]ip address 10.0.0.2 24
[SW1-GigabitEthernet1/0/1]quit
[SW1]ip route-static 0.0.0.0 0.0.0.0 10.0.0.2
SW1 NTP关键配置点:
[SW1]ntp-service enable
[SW1]ntp refclock-master 2
分别查看SW2和SW1的NTP显示信息:




至此,NTP典型组网配置案例3(网络设备作为时钟源)已完成!