华为交换机配置NTP服务端/客户端

时间:2023-03-09 12:49:09
华为交换机配置NTP服务端/客户端

 作者:邓聪聪

配置设备作为NTP服务器

  • 单播客户端/服务器模式

    # 配置NTP主时钟,层数为2。
    <HUAWEI> system-view
    [HUAWEI] ntp refclock-master 2
    # 配置NTP认证功能,配置认证密钥并声明该密钥可信。
    [HUAWEI] ntp authentication enable
    [HUAWEI] ntp authentication-keyid 42 authentication-mode md5 Hello@123456
    [HUAWEI] ntp reliable authentication-keyid 42
    # 使能NTP服务器功能。
    [HUAWEI] undo ntp-service disable

    配置设备作为NTP客户端

    • 单播客户端/服务器模式

      # 配置NTP认证功能,配置认证密钥并声明该密钥可信。
      <HUAWEI> system-view
      [HUAWEI] ntp authentication enable
      [HUAWEI] ntp authentication-keyid 42 authentication-mode md5 Hello@123456
      [HUAWEI] ntp reliable authentication-keyid 42
      # 为NTP单播客户端指定NTP单播服务器,并指定使用密钥ID 42加密。
      [HUAWEI] ntp unicast-server 10.1.1.1 authentication-keyid 42