- Table of Contents
-
- H3C Fixed Port Campus Switches Configuration Examples-B70D022-6W100
- 01-Login Management Configuration Examples
- 02-RBAC Configuration Examples
- 03-Software Upgrade Examples
- 04-ISSU Configuration Examples
- 05-Software Patching Examples
- 06-Ethernet Link Aggregation Configuration Examples
- 07-Port Isolation Configuration Examples
- 08-Spanning Tree Configuration Examples
- 09-VLAN Configuration Examples
- 10-VLAN Tagging Configuration Examples
- 11-DHCP Snooping Configuration Examples
- 12-Cross-Subnet Dynamic IP Address Allocation Configuration Examples
- 13-IPv6 over IPv4 Manual Tunneling with OSPFv3 Configuration Examples
- 14-ISATAP Tunnel and 6to4 Tunnel Configuration Examples
- 15-GRE Tunnel Configuration Examples
- 16-GRE with OSPF Configuration Examples
- 17-OSPF Configuration Examples
- 18-IS-IS Configuration Examples
- 19-BGP Configuration Examples
- 20-Policy-Based Routing Configuration Examples
- 21-OSPFv3 Configuration Examples
- 22-IPv6 IS-IS Configuration Examples
- 23-Routing Policy Configuration Examples
- 24-IGMP Snooping Configuration Examples
- 25-IGMP Configuration Examples
- 26-BIDIR-PIM Configuration Examples
- 27-Multicast VPN Configuration Examples
- 28-MLD Snooping Configuration Examples
- 29-IPv6 Multicast VLAN Configuration Examples
- 30-Basic MPLS Configuration Examples
- 31-MPLS L3VPN Configuration Examples
- 32-ACL Configuration Examples
- 33-Control Plane-Based QoS Policy Configuration Examples
- 34-Traffic Policing Configuration Examples
- 35-GTS and Rate Limiting Configuration Examples
- 36-Priority Mapping and Queue Scheduling Configuration Examples
- 37-Traffic Filtering Configuration Examples
- 38-AAA Configuration Examples
- 39-Port Security Configuration Examples
- 40-Portal Configuration Examples
- 41-SSH Configuration Examples
- 42-IP Source Guard Configuration Examples
- 43-Ethernet OAM Configuration Examples
- 44-CFD Configuration Examples
- 45-DLDP Configuration Examples
- 46-VRRP Configuration Examples
- 47-BFD Configuration Examples
- 48-NTP Configuration Examples
- 49-SNMP Configuration Examples
- 50-NQA Configuration Examples
- 51-Mirroring Configuration Examples
- 52-sFlow Configuration Examples
- 53-OpenFlow Configuration Examples
- 54-MAC Address Table Configuration Examples
- 55-Static Multicast MAC Address Entry Configuration Examples
- 56-IP Unnumbered Configuration Examples
- 57-MVRP Configuration Examples
- 58-MCE Configuration Examples
- 59-Congestion Avoidance and Queue Scheduling Configuration Examples
- 60-Attack Protection Configuration Examples
- 61-Smart Link Configuration Examples
- 62-RRPP Configuration Examples
- 63-BGP Route Selection Configuration Examples
- 64-IS-IS Route Summarization Configuration Examples
- 65-IRF Configuration Examples
- 66-MPLS TE Configuration Examples
- 67-VXLAN Configuration Examples
- 68-VCF Fabric Configuration Examples
- Related Documents
-
Title | Size | Download |
---|---|---|
48-NTP Configuration Examples | 279.84 KB |
Example: Configuring the NTP client/server mode
Applicable hardware and software versions
Example: Configuring the NTP broadcast mode
Applicable hardware and software versions
Configuring Device B, Device D, and Device E
Example: Configuring the NTP multicast mode
Applicable hardware and software versions
Example: Configuring NTP client/server mode with authentication
Applicable hardware and software versions
Applicable hardware and software versions
Example: Configuring the IPv6 NTP client/server mode
Applicable hardware and software versions
Example: Configuring the IPv6 NTP multicast mode
Applicable hardware and software versions
Example: Configuring the NTP broadcast mode with authentication
Applicable hardware and software versions
Configure Device B, Device D, and Device E
Introduction
This document provides NTP configuration examples.
Prerequisites
This document is not restricted to specific software or hardware versions.
The configuration examples in this document were created and verified in a lab environment, and all the devices were started with the factory default configuration. When you are working on a live network, make sure you understand the potential impact of every command on your network.
This document assumes that you have basic knowledge of NTP.
Example: Configuring the NTP client/server mode
Network configuration
As shown in Figure 1, configure the NTP client/server mode so all devices can be synchronized to Device A, the NTP server.
Applicable hardware and software versions
The following matrix shows the hardware and software versions to which this configuration example is applicable:
Hardware |
Software version |
S6520XE-HI switch series |
Supported in Release 11xx |
S5560X-EI switch series |
Supported in Release 111x |
S5500V2-EI switch series |
Supported in Release 111x |
MS4520V2-30F switch |
Supported in Release 111x |
S5560S-EI switch series S5560S-SI switch series |
Supported in Release 612x |
S5130S-HI switch series S5130S-EI switch series S5130S-SI switch series S5130S-LI switch series |
Supported in Release 612x |
S5120V2-SI switch series S5120V2-LI switch series |
Supported in Release 612x |
S3100V3-EI switch series S3100V3-SI switch series |
Supported in Release 612x |
S5110V2 switch series |
Supported in Release 612x |
S5110V2-SI switch series |
Supported in Release 612x |
S5000V3-EI switch series |
Supported in Release 612x |
S5000E-X switch series |
Supported in Release 612x |
WAS6000 switch series |
Supported in Release 612x |
E128C switch E152C switch E500C switch series E500D switch series |
Supported in Release 612x |
MS4520V2 switch series (except the MS4520V2-30F switch) |
Supported in Release 612x |
MS4320V2 switch series MS4300V2 switch series MS4320 switch series MS4200 switch series |
Supported in Release 612x |
WS5850-WiNet switch series |
Supported in Release 612x |
WS5820-WiNet switch series WS5810-WiNet switch series |
Supported in Release 612x |
Procedures
Configuring Device A
# Assign an IP address to VLAN-interface 2.
<DeviceA> system-view
[DeviceA] interface Vlan-interface 2
[DeviceA-Vlan-interface2] ip address 1.0.1.11 24
[DeviceA-Vlan-interface2] quit
# Enable the NTP service.
[DeviceA] ntp-service enable
# Specify the local clock as the reference source, with stratum level 2.
[DeviceA] ntp-service refclock-master 2
Configuring Device B
# Assign an IP address to VLAN-interface 2. (Details not shown.)
# Enable the NTP service.
<DeviceB> system-view
[DeviceB] ntp-service enable
# Specify Device A as the NTP server of Device B.
[DeviceB] ntp-service unicast-server 1.0.1.11
Configuring Device C
# Assign an IP address to VLAN-interface 2. (Details not shown.)
# Enable the NTP service.
<DeviceC> system-view
[DeviceC] ntp-service enable
# Specify Device A as the NTP server of Device C.
[DeviceC] ntp-service unicast-server 1.0.1.11
Verifying the configuration
# Verify that Device B has been synchronized to Device A, and the clock stratum level is 3 on Device B and 2 on Device A.
[DeviceB] display ntp-service status
Clock status: synchronized
Clock stratum: 3
System peer: 1.0.1.11
Local mode: client
Reference clock ID: 1.0.1.11
Leap indicator: 00
Clock jitter: 0.003479 s
Stability: 0.000 pps
Clock precision: 2^-18
Root delay: 1.95313 ms
Root dispersion: 28.38135 ms
Reference time: d5ed8cd5.577006ea Wed, Sep 25 2019 16:24:53.341
# Verify that an IPv4 NTP association has been established between Device B and Device A.
[DeviceB] display ntp-service sessions
source reference stra reach poll now offset delay disper
********************************************************************************
[12345]1.0.1.11 127.127.1.0 2 255 64 38 -10.22 1.9531 3.3416
Notes: 1 source(master), 2 source(peer), 3 selected, 4 candidate, 5 configured.
Total sessions: 1
Configuration files
· Device A:
#
interface Vlan-interface2
ip address 1.0.1.11 255.255.255.0
#
ntp-service enable
ntp-service refclock-master 2
#
· Device B:
#
interface Vlan-interface2
ip address 1.0.1.12 255.255.255.0
#
ntp-service enable
ntp-service unicast-server 1.0.1.11
#
· Device C:
#
interface Vlan-interface2
ip address 1.0.1.13 255.255.255.0
#
ntp-service enable
ntp-service unicast-server 1.0.1.11
#
Example: Configuring the NTP broadcast mode
Network configuration
As shown in Figure 2, configure the NTP broadcast mode so all devices on the same network segment can be synchronized to Device C, the NTP server.
Applicable hardware and software versions
The following matrix shows the hardware and software versions to which this configuration example is applicable:
Hardware |
Software version |
S6520XE-HI switch series |
Supported in Release 11xx |
S5560X-EI switch series |
Supported in Release 111x |
S5500V2-EI switch series |
Supported in Release 111x |
MS4520V2-30F switch |
Supported in Release 111x |
S5560S-EI switch series S5560S-SI switch series |
Supported in Release 612x |
S5130S-HI switch series S5130S-EI switch series S5130S-SI switch series S5130S-LI switch series |
Supported in Release 612x |
S5120V2-SI switch series S5120V2-LI switch series |
Supported in Release 612x |
S3100V3-EI switch series S3100V3-SI switch series |
Supported in Release 612x |
S5110V2 switch series |
Supported in Release 612x |
S5110V2-SI switch series |
Supported in Release 612x |
S5000V3-EI switch series |
Supported in Release 612x |
S5000E-X switch series |
Supported in Release 612x |
WAS6000 switch series |
Supported in Release 612x |
E128C switch E152C switch E500C switch series E500D switch series |
Supported in Release 612x |
MS4520V2 switch series (except the MS4520V2-30F switch) |
Supported in Release 612x |
MS4320V2 switch series MS4300V2 switch series MS4320 switch series MS4200 switch series |
Supported in Release 612x |
WS5850-WiNet switch series |
Supported in Release 612x |
WS5820-WiNet switch series WS5810-WiNet switch series |
Supported in Release 612x |
Procedures
Configuring Device C
# Enable the NTP service.
<DeviceC> system-view
[DeviceC] ntp-service enable
# Specify the local clock as the reference source, with stratum level 2.
[DeviceC] ntp-service refclock-master 2
# Assign an IP address to VLAN-interface 2.
[DeviceC] interface Vlan-interface 2
[DeviceC-Vlan-interface2] ip address 3.0.1.31 24
# Configure Device C to operate in broadcast server mode and send broadcast messages from VLAN-interface 2.
[DeviceC-Vlan-interface2] ntp-service broadcast-server
Configuring Device A
# Enable the NTP service.
<DeviceA> system-view
[DeviceA] ntp-service enable
# Assign an IP address to VLAN-interface 2.
[DeviceA] interface Vlan-interface 2
[DeviceA-Vlan-interface2] ip address 3.0.1.33 24
# Configure Device A to operate in broadcast client mode and receive broadcast messages on VLAN-interface 2.
[DeviceA-Vlan-interface2] ntp-service broadcast-client
Configuring Device B, Device D, and Device E
# Configure Device B, Device D, and Device E in the same way Device A is configured. (Details not shown.)
Verifying the configuration
# Verify that Device A has been synchronized to Device C, and the clock stratum level is 3 on Device A and 2 on Device C.
[DeviceA-Vlan-interface2] display ntp-service status
Clock status: synchronized
Clock stratum: 3
System peer: 3.0.1.31
Local mode: bclient
Reference clock ID: 3.0.1.31
Leap indicator: 00
Clock jitter: 0.000061 s
Stability: 0.000 pps
Clock precision: 2^-18
Root delay: 0.00000 ms
Root dispersion: 7951.43127 ms
Reference time: d5ee8d88.2faabed0 Thu, Sep 26 2019 10:40:08.186
# Verify that an IPv4 NTP association has been established between Device A and Device C.
[DeviceA-Vlan-interface2] display ntp-service sessions
source reference stra reach poll now offset delay disper
********************************************************************************
[1234]3.0.1.31 127.127.1.0 2 254 64 82 -2.190 0.0000 7937.5
Notes: 1 source(master), 2 source(peer), 3 selected, 4 candidate, 5 configured.
Total sessions: 1
Configuration files
· Device C:
#
interface Vlan-interface2
ip address 3.0.1.31 255.255.255.0
ntp-service broadcast-server
#
ntp-service enable
ntp-service refclock-master 2
#
· Device A:
#
interface Vlan-interface2
ip address 3.0.1.33 255.255.255.0
ntp-service broadcast-client
#
ntp-service enable
#
· Device B:
#
interface Vlan-interface2
ip address 3.0.1.30 255.255.255.0
ntp-service broadcast-client
#
ntp-service enable
#
· Device D:
#
interface Vlan-interface2
ip address 3.0.1.32 255.255.255.0
ntp-service broadcast-client
#
ntp-service enable
#
· Device E:
#
interface Vlan-interface2
ip address 3.0.1.34 255.255.255.0
ntp-service broadcast-client
#
ntp-service enable
#
Example: Configuring the NTP multicast mode
Network configuration
As shown in Figure 3, configure the NTP multicast mode so all devices on different network segments can be synchronized to Device C, the NTP server.
Applicable hardware and software versions
The following matrix shows the hardware and software versions to which this configuration example is applicable:
Hardware |
Software version |
S6520XE-HI switch series |
Supported in Release 11xx |
S5560X-EI switch series |
Supported in Release 111x |
S5500V2-EI switch series |
Supported in Release 111x |
MS4520V2-30F switch |
Supported in Release 111x |
S5560S-EI switch series S5560S-SI switch series |
Supported in Release 612x |
S5130S-HI switch series S5130S-EI switch series S5130S-SI switch series S5130S-LI switch series |
Supported in Release 612x |
S5120V2-SI switch series S5120V2-LI switch series |
Supported in Release 612x |
S3100V3-EI switch series S3100V3-SI switch series |
Supported in Release 612x |
S5110V2 switch series |
Supported in Release 612x |
S5110V2-SI switch series |
Supported in Release 612x |
S5000V3-EI switch series |
Supported in Release 612x |
S5000E-X switch series |
Supported in Release 612x |
WAS6000 switch series |
Supported in Release 612x |
E128C switch E152C switch E500C switch series E500D switch series |
Supported in Release 612x |
MS4520V2 switch series (except the MS4520V2-30F switch) |
Supported in Release 612x |
MS4320V2 switch series MS4300V2 switch series MS4320 switch series MS4200 switch series |
Supported in Release 612x |
WS5850-WiNet switch series |
Supported in Release 612x |
WS5820-WiNet switch series WS5810-WiNet switch series |
Supported in Release 612x |
Procedures
Configuring Device C
# Enable the NTP service.
<DeviceC> system-view
[DeviceC] ntp-service enable
# Specify the local clock as the reference source, with stratum level 2.
[DeviceC] ntp-service refclock-master 2
# Assign an IP address to VLAN-interface 2.
[DeviceC] interface Vlan-interface 2
[DeviceC-Vlan-interface2] ip address 3.0.1.31 24
# Configure Device C to operate in multicast server mode and send multicast messages from VLAN-interface 2.
[DeviceC-Vlan-interface2] ntp-service multicast-server
Configuring Device D
# Enable the NTP service.
<DeviceD> system-view
[DeviceD] ntp-service enable
# Assign an IP address to VLAN-interface 2.
[DeviceD] interface Vlan-interface 2
[DeviceD-Vlan-interface2] ip address 3.0.1.32 24
# Configure Device D to operate in multicast client mode and receive multicast messages on VLAN-interface 2.
[DeviceD-Vlan-interface2] ntp-service multicast-client
Configuring Device B
# Assign an IP address to VLAN-interface 2. (Details not shown.)
# Enable the NTP service.
<DeviceB> system-view
[DeviceB] ntp-service enable
# Configure Device B to operate in multicast client mode and receive multicast messages on VLAN-interface 2.
[DeviceB-Vlan-interface2] ntp-service multicast-client
[DeviceB-Vlan-interface2] quit
Because Device A and Device C are on different subnets, you must enable the multicast functions on Device B so that Device A can receive multicast messages from Device C.
# Enable IP multicast routing and IGMP.
[DeviceB] multicast routing
[DeviceB] interface vlan-interface 2
[DeviceB-Vlan-interface2] pim dm
[DeviceB-Vlan-interface2] quit
[DeviceB] vlan 3
[DeviceB-vlan3] port Ten-GigabitEthernet 1/0/1
[DeviceB-vlan3] quit
[DeviceB] interface vlan-interface 3
[DeviceB-Vlan-interface3] ip address 1.0.1.10 24
[DeviceB-Vlan-interface3] igmp enable
[DeviceB-Vlan-interface3] igmp static-group 224.0.1.1
[DeviceB-Vlan-interface3] quit
[DeviceB] igmp-snooping
[DeviceB-igmp-snooping] quit
[DeviceB] interface Ten-GigabitEthernet 1/0/1
[DeviceB-Ten-GigabitEthernet1/0/1] igmp-snooping static-group 224.0.1.1 vlan 3
Configuring Device A
# Enable the NTP service.
<DeviceA> system-view
[DeviceA] ntp-service enable
# Assign an IP address to VLAN-interface 3.
[DeviceA] interface Vlan-interface 3
[DeviceA-Vlan-interface3] ip address 1.0.1.11 24
# Configure Device A to operate in multicast client mode and receive multicast messages on VLAN-interface 3.
[DeviceA-Vlan-interface3] ntp-service multicast-client
Verifying the configuration
# Verify that Device A has been synchronized to Device C, and the clock stratum level is 3 on Device A and 2 on Device C.
[DeviceA-Vlan-interface3] display ntp-service status
Clock status: synchronized
Clock stratum: 3
System peer: 3.0.1.31
Local mode: bclient
Reference clock ID: 3.0.1.31
Leap indicator: 00
Clock jitter: 0.000061 s
Stability: 0.000 pps
Clock precision: 2^-18
Root delay: 1.69373 ms
Root dispersion: 1950.18005 ms
Reference time: d5ee9b15.2f3a684d Thu, Sep 26 2019 11:37:57.184
Configuration files
· Device A:
#
ntp-service enable
#
interface Vlan-interface3
ip address 1.0.1.11 255.255.255.0
ntp-service multicast-client
#
· Device B:
#
ntp-service enable
#
multicast routing
#
igmp-snooping
#
interface Vlan-interface2
ip address 3.0.1.30 255.255.255.0
pim dm
ntp-service multicast-client
#
interface Vlan-interface3
ip address 1.0.1.10 255.255.255.0
igmp enable
igmp static-group 224.0.1.1
#
interface Ten-GigabitEthernet1/0/1
port access vlan 3
igmp-snooping static-group 224.0.1.1 vlan 3
#
· Device C:
#
ntp-service enable
ntp-service refclock-master 2
#
interface Vlan-interface2
ip address 3.0.1.31 255.255.255.0
ntp-service multicast-server
#
· Device D:
#
ntp-service enable
#
interface Vlan-interface2
ip address 3.0.1.32 255.255.255.0
ntp-service multicast-client
#
Example: Configuring NTP client/server mode with authentication
Network configuration
As shown in Figure 4, configure the NTP client/server mode so all devices can be synchronized to Device A, the NTP server. Configure NTP authentication on Device A, Device B, and Device C.
Applicable hardware and software versions
The following matrix shows the hardware and software versions to which this configuration example is applicable:
Hardware |
Software version |
S6520XE-HI switch series |
Supported in Release 11xx |
S5560X-EI switch series |
Supported in Release 111x |
S5500V2-EI switch series |
Supported in Release 111x |
MS4520V2-30F switch |
Supported in Release 111x |
S5560S-EI switch series S5560S-SI switch series |
Supported in Release 612x |
S5130S-HI switch series S5130S-EI switch series S5130S-SI switch series S5130S-LI switch series |
Supported in Release 612x |
S5120V2-SI switch series S5120V2-LI switch series |
Supported in Release 612x |
S3100V3-EI switch series S3100V3-SI switch series |
Supported in Release 612x |
S5110V2 switch series |
Supported in Release 612x |
S5110V2-SI switch series |
Supported in Release 612x |
S5000V3-EI switch series |
Supported in Release 612x |
S5000E-X switch series |
Supported in Release 612x |
WAS6000 switch series |
Supported in Release 612x |
E128C switch E152C switch E500C switch series E500D switch series |
Supported in Release 612x |
MS4520V2 switch series (except the MS4520V2-30F switch) |
Supported in Release 612x |
MS4320V2 switch series MS4300V2 switch series MS4320 switch series MS4200 switch series |
Supported in Release 612x |
WS5850-WiNet switch series |
Supported in Release 612x |
WS5820-WiNet switch series WS5810-WiNet switch series |
Supported in Release 612x |
Procedures
Configuring Device A
# Assign an IP address to VLAN-interface 2.
<DeviceA> system-view
[DeviceA] interface Vlan-interface 2
[DeviceA-Vlan-interface2] ip address 1.0.1.11 24
# Enable the NTP service.
[DeviceA] ntp-service enable
# Specify the local clock as the reference source, with stratum level 2.
[DeviceA] ntp-service refclock-master 2
# Enable NTP authentication on Device A.
[DeviceA] ntp-service authentication enable
# Create a plaintext authentication key, with key ID 42 and key value aNiceKey.
[DeviceA] ntp-service authentication-keyid 42 authentication-mode md5 simple aNiceKey
# Specify the key as a trusted key.
[DeviceA] ntp-service reliable authentication-keyid 42
Configuring Device B
# Assign an IP address to VLAN-interface 2. (Details not shown.)
# Enable the NTP service.
<DeviceB> system-view
[DeviceB] ntp-service enable
# Enable NTP authentication on Device B.
[DeviceB] ntp-service authentication enable
# Create a plaintext authentication key, with key ID 42 and key value aNiceKey.
[DeviceB] ntp-service authentication-keyid 42 authentication-mode md5 simple aNiceKey
# Specify the key as a trusted key.
[DeviceB] ntp-service reliable authentication-keyid 42
# Specify Device A as the NTP server of Device B, and associate the server with key 42.
[DeviceB] ntp-service unicast-server 1.0.1.11 authentication-keyid 42
Configuring Device C
# Assign an IP address to VLAN-interface 2. (Details not shown.)
# Enable the NTP service.
<DeviceC> system-view
[DeviceC] ntp-service enable
# Enable NTP authentication on Device C.
[DeviceC] ntp-service authentication enable
# Create a plaintext authentication key, with key ID 42 and key value aNiceKey.
[DeviceC] ntp-service authentication-keyid 42 authentication-mode md5 simple aNiceKey
# Specify the key as a trusted key.
[DeviceC] ntp-service reliable authentication-keyid 42
# Specify Device A as the NTP server of Device C, and associate the server with key 42.
[DeviceC] ntp-service unicast-server 1.0.1.11 authentication-keyid 42
Verifying the configuration
# Verify that Device B has synchronized to Device A, and the clock stratum level is 3 on Device B and 2 on Device A.
[DeviceB] display ntp-service status
Clock status: synchronized
Clock stratum: 3
System peer: 1.0.1.11
Local mode: client
Reference clock ID: 1.0.1.11
Leap indicator: 00
Clock jitter: 0.005096 s
Stability: 0.000 pps
Clock precision: 2^-18
Root delay: 0.00655 ms
Root dispersion: 1.15869 ms
Reference time: d0c62687.ab1bba7d Mon, Sep 30 2019 16:06:26.764
# Verify that an IPv4 NTP association has been established between Device B and Device A.
[DeviceB] display ntp-service sessions
source reference stra reach poll now offset delay disper
********************************************************************************
[1245]1.0.1.11 127.127.1.0 2 1 64 519 -0.0 0.0065 0.0
Notes: 1 source(master),2 source(peer),3 selected,4 candidate,5 configured.
Total sessions : 1
Configuration files
· Device A:
#
interface Vlan-interface2
ip address 1.0.1.11 255.255.255.0
#
ntp-service enable
ntp-service authentication enable
ntp-service authentication-keyid 42 authentication-mode md5 cipher $c$3$4j3SKCgQWBK3Un41B9U0JXzJX9i7IuNoSqi
ntp-service reliable authentication-keyid 42
ntp-service refclock-master 2
#
· Device B:
#
interface Vlan-interface2
ip address 1.0.1.12 255.255.255.0
#
ntp-service enable
ntp-service authentication enable
ntp-service authentication-keyid 42 authentication-mode md5 cipher $c$3$22eIc8l796cpudZqiaAZ2SLzIfrgzFTVYn8X
ntp-service reliable authentication-keyid 42
ntp-service unicast-server 1.0.1.11 authentication-keyid 42
#
· Device C:
#
interface Vlan-interface2
ip address 1.0.1.13 255.255.255.0
#
ntp-service enable
ntp-service authentication enable
ntp-service authentication-keyid 42 authentication-mode md5 cipher $c$3$XJzVmJ1TJbWyYAXpPXxF7JiEOZag8CehibM8
ntp-service reliable authentication-keyid 42
ntp-service unicast-server 1.0.1.11 authentication-keyid 42
#
Example: Configuring SNTP
Network configuration
As shown in Figure 5, configure SNTP so all devices can be synchronized to Device A, the NTP server.
Applicable hardware and software versions
The following matrix shows the hardware and software versions to which this configuration example is applicable:
Hardware |
Software version |
S6520XE-HI switch series |
Supported in Release 11xx |
S5560X-EI switch series |
Supported in Release 111x |
S5500V2-EI switch series |
Supported in Release 111x |
MS4520V2-30F switch |
Supported in Release 111x |
S5560S-EI switch series S5560S-SI switch series |
Supported in Release 612x |
S5130S-HI switch series S5130S-EI switch series S5130S-SI switch series S5130S-LI switch series |
Supported in Release 612x |
S5120V2-SI switch series S5120V2-LI switch series |
Supported in Release 612x |
S3100V3-EI switch series S3100V3-SI switch series |
Supported in Release 612x |
S5110V2 switch series |
Supported in Release 612x |
S5110V2-SI switch series |
Supported in Release 612x |
S5000V3-EI switch series |
Supported in Release 612x |
S5000E-X switch series |
Supported in Release 612x |
WAS6000 switch series |
Supported in Release 612x |
E128C switch E152C switch E500C switch series E500D switch series |
Supported in Release 612x |
MS4520V2 switch series (except the MS4520V2-30F switch) |
Supported in Release 612x |
MS4320V2 switch series MS4300V2 switch series MS4320 switch series MS4200 switch series |
Supported in Release 612x |
WS5850-WiNet switch series |
Supported in Release 612x |
WS5820-WiNet switch series WS5810-WiNet switch series |
Supported in Release 612x |
Procedures
Configuring Device A
# Assign an IP address to VLAN-interface 2.
<DeviceA> system-view
[DeviceA] interface Vlan-interface 2
[DeviceA-Vlan-interface2] ip address 1.0.1.11 24
# Enable the NTP service.
[DeviceA] ntp-service enable
# Specify the local clock as the reference source, with stratum level 2.
[DeviceA] ntp-service refclock-master 2
Configuring Device B
# Assign an IP address to VLAN-interface 2. (Details not shown.)
# Enable the SNTP service.
<DeviceB> system-view
[DeviceB] sntp enable
# Specify Device A as the NTP server for Device B.
[DeviceB] sntp unicast-server 1.0.1.11
Configuring Device C
# Assign an IP address to VLAN-interface 2. (Details not shown.)
# Enable the SNTP service.
<DeviceC> system-view
[DeviceC] sntp enable
# Specify Device A as the NTP server for Device C.
[DeviceC] sntp unicast-server 1.0.1.11
Verifying the configuration
# Verify that an SNTP association has been established between Device B and Device A, and Device B has synchronized to Device A.
[DeviceB] display sntp sessions
SNTP server Stratum Version Last receive time
1.0.1.11 2 4 Thu, Sep 26 2019 17:25:09.121 (Synced)
Configuration files
· Device A:
#
interface Vlan-interface2
ip address 1.0.1.11 255.255.255.0
#
ntp-service enable
ntp-service refclock-master 2
#
· Device B:
#
interface Vlan-interface2
ip address 1.0.1.12 255.255.255.0
#
sntp enable
sntp unicast-server 1.0.1.11
#
· Device C:
#
interface Vlan-interface2
ip address 1.0.1.13 255.255.255.0
#
sntp enable
sntp unicast-server 1.0.1.11
#
Example: Configuring the IPv6 NTP client/server mode
Network configuration
As shown in Figure 1, configure the IPv6 NTP client/server mode so all devices can be synchronized to Device A, the NTP server.
Figure 6 Network diagram
Applicable hardware and software versions
The following matrix shows the hardware and software versions to which this configuration example is applicable:
Hardware |
Software version |
S6520XE-HI switch series |
Supported in Release 11xx |
S5560X-EI switch series |
Supported in Release 111x |
S5500V2-EI switch series |
Supported in Release 111x |
MS4520V2-30F switch |
Supported in Release 111x |
S5560S-EI switch series S5560S-SI switch series |
Supported in Release 612x |
S5130S-HI switch series S5130S-EI switch series S5130S-SI switch series S5130S-LI switch series |
Supported in Release 612x |
S5120V2-SI switch series S5120V2-LI switch series |
Supported in Release 612x |
S3100V3-EI switch series S3100V3-SI switch series |
Supported in Release 612x |
S5110V2 switch series |
Supported in Release 612x |
S5110V2-SI switch series |
Supported in Release 612x |
S5000V3-EI switch series |
Supported in Release 612x |
S5000E-X switch series |
Supported in Release 612x |
WAS6000 switch series |
Supported in Release 612x |
E128C switch E152C switch E500C switch series E500D switch series |
Supported in Release 612x |
MS4520V2 switch series (except the MS4520V2-30F switch) |
Supported in Release 612x |
MS4320V2 switch series MS4300V2 switch series MS4320 switch series MS4200 switch series |
Supported in Release 612x |
WS5850-WiNet switch series |
Supported in Release 612x |
WS5820-WiNet switch series WS5810-WiNet switch series |
Supported in Release 612x |
Procedures
Configuring Device A
# Assign an IPv6 address to VLAN-interface 2.
<DeviceA> system-view
[DeviceA] interface vlan-interface 2
[DeviceA-Vlan-interface2] ipv6 address 3000::34 64
[DeviceA-Vlan-interface2] quit
# Enable the NTP service.
[DeviceA] ntp-service enable
# Specify the local clock as the reference source, with stratum level 2.
[DeviceA] ntp-service refclock-master 2
Configuring Device B
# Assign an IPv6 address to VLAN-interface 2. (Details not shown.)
# Enable the NTP service.
<DeviceB> system-view
[DeviceB] ntp-service enable
# Specify Device A as the NTP server of Device B.
[DeviceB] ntp-service unicast-server 3000::34
Configuring Device C
# Assign an IPv6 address to VLAN-interface 2. (Details not shown.)
# Enable the NTP service.
<DeviceC> system-view
[DeviceC] ntp-service enable
# Specify Device A as the NTP server of Device C.
[DeviceC] ntp-service unicast-server 3000::34
Verifying the configuration
# Verify that Device B has been synchronized to Device A, and the clock stratum level is 3 on Device B and 2 on Device A.
[DeviceB] display ntp-service status
Clock status: synchronized
Clock stratum: 3
System peer: 3000::34
Local mode: client
Reference clock ID: 95.197.17.40
Leap indicator: 00
Clock jitter: 0.003479 s
Stability: 0.000 pps
Clock precision: 2^-18
Root delay: 1.95313 ms
Root dispersion: 28.38135 ms
Reference time: d5ed8cd5.577006ea Wed, Sep 25 2019 16:24:53.341
# Verify that an IPv6 NTP association has been established between Device B and Device A.
[DeviceB] display ntp-service ipv6 sessions
Notes: 1 source(master), 2 source(peer), 3 selected, 4 candidate, 5 configured.
Source: [12345] 3000::34
Reference: 127.127.1.0 Clock stratum: 2
Reachabilities: 3 Poll interval: 64
Last receive time: 62 Offset: 0.1272
Roundtrip delay: 1.8158 Dispersion: 188.47
Total sessions: 1
Configuration files
· Device A:
#
interface Vlan-interface2
ipv6 address 3000::34/64
#
ntp-service enable
ntp-service refclock-master 2
#
· Device B:
#
interface Vlan-interface2
ipv6 address 3000::35/64
#
ntp-service enable
ntp-service ipv6 unicast-server 3000::34
#
· Device C:
#
interface Vlan-interface2
ipv6 address 3000::36/64
#
ntp-service enable
ntp-service ipv6 unicast-server 3000::34
#
Example: Configuring the IPv6 NTP multicast mode
Network configuration
As shown in Figure 3, configure the IPv6 NTP multicast mode so all devices on different network segments can be synchronized to Device C, the NTP server.
Figure 7 Network diagram
Applicable hardware and software versions
The following matrix shows the hardware and software versions to which this configuration example is applicable:
Hardware |
Software version |
S6520XE-HI switch series |
Supported in Release 11xx |
S5560X-EI switch series |
Supported in Release 111x |
S5500V2-EI switch series |
Supported in Release 111x |
MS4520V2-30F switch |
Supported in Release 111x |
S5560S-EI switch series S5560S-SI switch series |
Supported in Release 612x |
S5130S-HI switch series S5130S-EI switch series S5130S-SI switch series S5130S-LI switch series |
Supported in Release 612x |
S5120V2-SI switch series S5120V2-LI switch series |
Supported in Release 612x |
S3100V3-EI switch series S3100V3-SI switch series |
Supported in Release 612x |
S5110V2 switch series |
Supported in Release 612x |
S5110V2-SI switch series |
Supported in Release 612x |
S5000V3-EI switch series |
Supported in Release 612x |
S5000E-X switch series |
Supported in Release 612x |
WAS6000 switch series |
Supported in Release 612x |
E128C switch E152C switch E500C switch series E500D switch series |
Supported in Release 612x |
MS4520V2 switch series (except the MS4520V2-30F switch) |
Supported in Release 612x |
MS4320V2 switch series MS4300V2 switch series MS4320 switch series MS4200 switch series |
Supported in Release 612x |
WS5850-WiNet switch series |
Supported in Release 612x |
WS5820-WiNet switch series WS5810-WiNet switch series |
Supported in Release 612x |
Procedures
Configuring Device C
# Configure routing protocols so that all devices can reach each other. (Details not shown.)
# Enable the NTP service.
<DeviceC> system-view
[DeviceC] ntp-service enable
# Specify the local clock as the reference source, with stratum level 2.
[DeviceC] ntp-service refclock-master 2
# Assign an IPv6 address to VLAN-interface 2.
[DeviceC] interface Vlan-interface 2
[DeviceC-Vlan-interface2] ipv6 address 3000::2 64
# Configure Device C to operate in IPv6 multicast server mode and send multicast messages from VLAN-interface 2.
[DeviceC-Vlan-interface2] ntp-service ipv6 multicast-server ff24::1
[DeviceC-Vlan-interface2] quit
Configuring Device D
# Configure routing protocols and assign an IP address to each interface so that all devices can reach each other. (Details not shown.)
# Enable the NTP service.
<DeviceD> system-view
[DeviceD] ntp-service enable
# Configure Device D to operate in IPv6 multicast client mode and receive multicast messages on VLAN-interface 2.
[DeviceD-Vlan-interface2] ntp-service ipv6 multicast-client ff24::1
[DeviceD-Vlan-interface2] quit
Configuring Device B
# Configure routing protocols and assign an IP address to each interface so that all devices can reach each other. (Details not shown.)
# Enable the NTP service.
<DeviceB> system-view
[DeviceB] ntp-service enable
# Configure Device B to operate in IPv6 multicast client mode and receive multicast messages on VLAN-interface 2.
[DeviceB-Vlan-interface2] ntp-service ipv6 multicast-client ff24::1
[DeviceB-Vlan-interface2] quit
Because Device A and Device C are on different subnets, you must enable IPv6 multicast functions on Device B before Device A can receive multicast messages from Device C.
# Enable IPv6 multicast functions.
[DeviceB] ipv6 multicast routing
[DeviceB-mrib6] quit
[DeviceB] interface vlan-interface 2
[DeviceB-Vlan-interface2] ipv6 pim dm
[DeviceB-Vlan-interface2] quit
[DeviceB] vlan 3
[DeviceB-vlan3] port Ten-GigabitEthernet 1/0/1
[DeviceB-vlan3] quit
[DeviceB] interface vlan-interface 3
[DeviceB-Vlan-interface3] mld enable
[DeviceB-Vlan-interface3] mld static-group ff24::1
[DeviceB-Vlan-interface3] quit
[DeviceB] mld-snooping
[DeviceB-mld-snooping] quit
[DeviceB] interface Ten-GigabitEthernet 1/0/1
[DeviceB-Ten-GigabitEthernet1/0/1] mld-snooping static-group ff24::1 vlan 3
[DeviceB-mld-snooping] quit
Configuring Device A
# Configure routing protocols and assign an IP address to each interface so that all devices can reach each other. (Details not shown.)
# Enable the NTP service.
<DeviceA> system-view
[DeviceA] ntp-service enable
# Configure Device A to operate in IPv6 multicast client mode and receive multicast messages on VLAN-interface 3.
[DeviceA-Vlan-interface3] ntp-service ipv6 multicast-client ff24::1
[DeviceA-Vlan-interface3] quit
Verifying the configuration
# Verify that Device A has been synchronized to Device C, and the clock stratum level is 3 on Device A and 2 on Device C.
[DeviceA] display ntp-service status
Clock status: synchronized
Clock stratum: 3
System peer: 3000::2
Local mode: bclient
Reference clock ID: 165.84.121.65
Leap indicator: 00
Clock jitter: 0.000061 s
Stability: 0.000 pps
Clock precision: 2^-18
Root delay: 1.69373 ms
Root dispersion: 1950.18005 ms
Reference time: d5ee9b15.2f3a684d Thu, Sep 26 2019 11:37:57.184
Configuration files
· Device A:
#
ntp-service enable
#
interface Vlan-interface3
ipv6 address 2000::1/64
ntp-service ipv6 multicast-client ff24::1
#
· Device B:
#
ntp-service enable
#
ipv6 multicast routing
#
mld-snooping
#
interface Vlan-interface2
ipv6 address 3000::1/64
ipv6 pim dm
ntp-service ipv6 multicast-client ff24::1
#
interface Vlan-interface3
ipv6 address 2000::2/64
mld enable
mld static-group ff24::1
#
interface Ten-GigabitEthernet1/0/1
port access vlan 3
mld-snooping static-group ff24::1 vlan 3
#
· Device C:
#
ntp-service enable
ntp-service refclock-master 2
#
interface Vlan-interface2
ipv6 address 3000::2/64
ntp-service ipv6 multicast-server ff24::1
#
· Device D:
#
ntp-service enable
#
interface Vlan-interface2
ipv6 address 3000::3/64
ntp-service ipv6 multicast-client ff24::1
#
Example: Configuring the NTP broadcast mode with authentication
Network configuration
As shown in Figure 4, configure NTP broadcast mode so all devices can be synchronized to Device A, the NTP server. Configure NTP authentication on Device A, Device B, and Device C.
Figure 8 Network diagram
Applicable hardware and software versions
The following matrix shows the hardware and software versions to which this configuration example is applicable:
Hardware |
Software version |
S6520XE-HI switch series |
Supported in Release 11xx |
S5560X-EI switch series |
Supported in Release 111x |
S5500V2-EI switch series |
Supported in Release 111x |
MS4520V2-30F switch |
Supported in Release 111x |
S5560S-EI switch series S5560S-SI switch series |
Supported in Release 612x |
S5130S-HI switch series S5130S-EI switch series S5130S-SI switch series S5130S-LI switch series |
Supported in Release 612x |
S5120V2-SI switch series S5120V2-LI switch series |
Supported in Release 612x |
S3100V3-EI switch series S3100V3-SI switch series |
Supported in Release 612x |
S5110V2 switch series |
Supported in Release 612x |
S5110V2-SI switch series |
Supported in Release 612x |
S5000V3-EI switch series |
Supported in Release 612x |
S5000E-X switch series |
Supported in Release 612x |
WAS6000 switch series |
Supported in Release 612x |
E128C switch E152C switch E500C switch series E500D switch series |
Supported in Release 612x |
MS4520V2 switch series (except the MS4520V2-30F switch) |
Supported in Release 612x |
MS4320V2 switch series MS4300V2 switch series MS4320 switch series MS4200 switch series |
Supported in Release 612x |
WS5850-WiNet switch series |
Supported in Release 612x |
WS5820-WiNet switch series WS5810-WiNet switch series |
Supported in Release 612x |
Procedures
Configure Device C
# Enable the NTP service.
<DeviceC> system-view
[DeviceC] ntp-service enable
# Specify the local clock as the reference source, with stratum level 2.
[DeviceC] ntp-service refclock-master 2
# Enable NTP authentication. Create a plaintext authentication key, with key ID 88 and key value 123456. Specify the key as a trusted key.
[DeviceC] ntp-service authentication enable
[DeviceC] ntp-service authentication-keyid 88 authentication-mode md5 simple 123456
[DeviceC] ntp-service reliable authentication-keyid 88
# Configure Device C to operate in NTP broadcast mode, and associate key 88 with Device C.
[DeviceC] interface vlan-interface 2
[DeviceC-Vlan-interface2] ip address 3.0.1.31 24
[DeviceC-Vlan-interface2] ntp-service broadcast-server authentication-keyid 88
[DeviceC-Vlan-interface2] quit
Configure Device A
# Enable the NTP service.
<DeviceA> system-view
[DeviceA] ntp-service enable
# Enable NTP authentication on Device A. Create a plaintext authentication key, with key ID 88 and key value 123456. Specify the key as a trusted key.
[DeviceA] ntp-service authentication enable
[DeviceA] ntp-service authentication-keyid 88 authentication-mode md5 simple 123456
[DeviceA] ntp-service reliable authentication-keyid 88
# Configure Device A to operate in NTP broadcast client mode and receive NTP broadcast messages on VLAN-interface 2.
[DeviceA] interface vlan-interface 2
[DeviceA-Vlan-interface2] ntp-service broadcast-client
[DeviceA-Vlan-interface2] ip address 3.0.1.33 24
[DeviceA-Vlan-interface2] quit
Configure Device B, Device D, and Device E
# Configure Device B, Device D, and Device E in the same way Device A is configured. (Details not shown.)
Verifying the configuration
# Verify that Device A has synchronized to Device C, and the clock stratum level is 3 on Device A and 2 on Device C.
[DeviceA] display ntp-service status
Clock status: synchronized
Clock stratum: 3
System peer: 3.0.1.31
Local mode: bclient
Reference clock ID: 3.0.1.31
Leap indicator: 00
Clock jitter: 0.000092 s
Stability: 0.000 pps
Clock precision: 2^-18
Root delay: 2.42615 ms
Root dispersion: 1950.98877 ms
Reference time: d5eed631.2f498d71 Thu, Sep 26 2019 15:50:09.184
Configuration files
· Device A, Device B, Device D, and Device E:
#
interface Vlan-interface2
ip address 3.0.1.33 255.255.255.0
ntp-service broadcast-client
#
ntp-service enable
ntp-service authentication enable
ntp-service authentication-keyid 88 authentication-mode md5 cipher $c$3$pU6KvpS80MadhM2zM
CCSR07HX4qEbJhHvQ==
ntp-service reliable authentication-keyid 88
#
· Device C:
#
interface Vlan-interface2
ip address 3.0.1.31 255.255.255.0
ntp-service broadcast-server authentication-keyid 88
#
ntp-service enable
ntp-service authentication enable
ntp-service authentication-keyid 88 authentication-mode md5 cipher $c$3$iJudDKiqCVO+gOaG53
63/fz4M3dQvHo2Fw==
ntp-service reliable authentication-keyid 88
ntp-service refclock-master 3
#