Hello everyone,
Today I will share with you how to configure the NTP function.
CE series switches support the following NTP modes: unicast client/server mode, symmetric peer mode, broadcast mode, multicast mode, and manycast mode. The following describes how to configure the NTP client and NTP server in the unicast client/server mode, broadcast mode, multicast mode, and manycast mode.
Unicast client/server mode
Configure the NTP server.
1. Configure the NTP master clock and set the stratum to 2.
<HUAWEI> system-view
[~HUAWEI] ntp refclock-master 2
[*HUAWEI] commit
2. Enable NTP authentication, configure the authentication key, and specify the key as reliable.
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
3. Enable the NTP server.
[~HUAWEI] undo ntp server disable
[*HUAWEI] commit
Configure the NTP client.
1.Enable NTP authentication, configure the authentication key, and specify the key as reliable.
<HUAWEI> system-view
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
2. Specify an NTP unicast server for the NTP unicast client and specify key 42 for encryption.
[~HUAWEI] ntp unicast-server 10.1.1.1 authentication-keyid 42
[*HUAWEI] commit
Broadcast mode
Configure the NTP server.
1. Configure the NTP master clock and set the stratum to 2.
<HUAWEI> system-view
[~HUAWEI] ntp refclock-master 2
[*HUAWEI] commit
2. Enable NTP authentication, configure the authentication key, and specify the key as reliable.
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
3. Configure the NTP broadcast server to send NTP broadcast packets through 10GE1/0/1, and use key 42 for encryption.
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] ntp broadcast-server authentication-keyid 42
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] commit
4. Enable the NTP server.
[~HUAWEI] undo ntp server disable
[*HUAWEI] commit
Configure the NTP client.
1. Enable NTP authentication, configure the authentication key, and specify the key as reliable.
<HUAWEI> system-view
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
2. Configure the NTP broadcast client to listen to the NTP broadcast packets on 10GE1/0/1.
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] ntp broadcast-client
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] commit
Multicast mode
Configure the NTP server.
1. Configure the NTP master clock and set the stratum to 2.
<HUAWEI> system-view
[~HUAWEI] ntp refclock-master 2
[*HUAWEI] commit
2. Enable NTP authentication, configure the authentication key, and specify the key as reliable.
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
3. Configure the NTP multicast server to send NTP multicast packets through 10GE1/0/1, and use key 42 for encryption.
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] ntp multicast-server authentication-keyid 42
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] commit
4. Enable the NTP server.
[~HUAWEI] undo ntp server disable
[*HUAWEI] commit
Configure the NTP client.
1. Enable NTP authentication, configure the authentication key, and specify the key as reliable.
<HUAWEI> system-view
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
2. Configure the NTP multicast client to listen to the NTP multicast packets on 10GE1/0/1.
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] ntp multicast-client
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] commit
Manycast mode
Configure the NTP server.
1. Configure the NTP master clock and set the stratum to 2.
<HUAWEI> system-view
[~HUAWEI] ntp refclock-master 2
[*HUAWEI] commit
2. Enable NTP authentication, configure the authentication key, and specify the key as reliable.
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
3. Configure the NTP manycast server to send NTP manycast packets through 10GE1/0/1.
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] ntp manycast-server
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] commit
4. Enable the NTP server.
[~HUAWEI] undo ntp server disable
[*HUAWEI] commit
Configure the NTP client.
1. Enable NTP authentication, configure the authentication key, and specify the key as reliable.
<HUAWEI> system-view
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
2. Configure the NTP manycast client to listen to the NTP manycast packets on 10GE1/0/1, and specify key 42 for encryption.
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] ntp manycast-client authentication-keyid 42
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] commit
That is all I want to share with you! Thank you!