Specifying the source interface for NTP messages

To prevent interface status changes from causing NTP communication failures, configure the device to use the IP address of an interface that is always up. For example, you can configure the device to use a loopback interface as the source IP address for the NTP messages to be sent.

When the device responds to an NTP request, the source IP address of the NTP response is always the IP address of the interface that has received the NTP request.

Follow these guidelines when you specify the source interface for NTP messages:

To specify the source interface for NTP messages:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Specify the source interface for NTP messages.

  • Specify the source interface for NTP messages:ntp-service source interface-type interface-number

  • Specify the source interface for IPv6 NTP messages:ntp-service ipv6 source interface-type interface-number

By default, no source interface is specified for NTP messages.