• 產品與解決方案
  • 行業解決方案
  • 服務
  • 支持
  • 合作夥伴
  • 關於我們

11-網絡管理和監控配置舉例

目錄

02-H3C_NTP典型配置舉例

本章節下載 02-H3C_NTP典型配置舉例  (329.17 KB)

02-H3C_NTP典型配置舉例

H3C NTP典型配置舉例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

資料版本:6W100-20190330

產品版本:Release 7577P04

 

Copyright © 2019 bobty下载软件 版權所有,保留一切權利。

非經本公司書麵許可,任何單位和個人不得擅自摘抄、複製本文檔內容的部分或全部,並不得以任何形式傳播。

除bobty下载软件 的商標外,本手冊中出現的其它公司的商標、產品標識及商品名稱,由各自權利人擁有。

本文檔中的信息可能變動,恕不另行通知。

 


目  錄

1 簡介

2 配置前提

3 NTP服務器/客戶端模式典型配置舉例

3.1 組網需求

3.2 使用版本

3.3 配置步驟

3.3.1 Switch A的配置

3.3.2 Switch B的配置

3.3.3 Switch C的配置

3.4 驗證配置

3.5 配置文件

4 NTP廣播模式典型配置舉例

4.1 組網需求

4.2 使用版本

4.3 配置步驟

4.3.1 Switch C的配置

4.3.2 Switch A的配置

4.4 驗證配置

4.5 配置文件

5 NTP組播模式典型配置舉例

5.1 組網需求

5.2 使用版本

5.3 配置步驟

5.3.1 Switch C的配置

5.3.2 Switch D的配置

5.3.3 Switch B的配置

5.3.4 Switch A的配置

5.4 驗證配置

5.5 配置文件

6 帶身份驗證的NTP客戶端/服務器模式典型配置舉例

6.1 組網需求

6.2 使用版本

6.3 配置步驟

6.3.1 Switch A的配置

6.3.2 Switch B的配置

6.3.3 Switch C的配置

6.4 驗證配置

6.5 配置文件

7 SNTP典型配置舉例

7.1 組網需求

7.2 使用版本

7.3 配置步驟

7.3.1 Switch A的配置

7.3.2 Switch B的配置

7.3.3 Switch C的配置

7.4 驗證配置

7.5 配置文件

8 IPv6 NTP服務器/客戶端模式典型配置舉例

8.1 組網需求

8.2 使用版本

8.3 配置步驟

8.3.1 Switch A的配置

8.3.2 Switch B的配置

8.3.3 Switch C的配置

8.4 驗證配置

8.5 配置文件

9 IPv6 NTP組播模式典型配置舉例

9.1 組網需求

9.2 使用版本

9.3 配置步驟

9.3.1 Switch C的配置

9.3.2 Switch D的配置

9.3.3 Switch B的配置

9.3.4 Switch A的配置

9.4 驗證配置

9.5 配置文件

10 帶身份驗證的NTP廣播模式典型配置舉例

10.1 組網需求

10.2 使用版本

10.3 配置步驟

10.3.1 Switch C的配置

10.3.2 Switch A的配置

10.4 驗證配置

10.5 配置文件

11 相關資料

 


1  簡介

本章介紹了與NTP有關的各種典型配置舉例。

2  配置前提

本文檔不嚴格與具體軟、硬件版本對應,如果使用過程中與產品實際情況有差異,請參考相關產品手冊,或以設備實際情況為準。

本文檔中的配置均是在實驗室環境下進行的配置和驗證,配置前設備的所有參數均采用出廠時的缺省配置。如果您已經對設備進行了配置,為了保證配置效果,請確認現有配置和以下舉例中的配置不衝突。

本文檔假設您已了解NTP特性。

3  NTP服務器/客戶端模式典型配置舉例

3.1  組網需求

圖1所示,網絡中有一台時間服務器Switch A,為網絡中的其它設備提供精確的時間服務,為保證網絡中的所有設備能保持一致、統一的時鍾,現要求配置NTP服務器/客戶端模式,使所有設備能從時間服務器Switch A上獲得時鍾同步。

圖1 配置NTP服務器/客戶端模式組網圖

 

3.2  使用版本

本舉例是在S7600X-CMW710-R7577P01版本上進行配置和驗證的。

3.3  配置步驟

3.3.1  Switch A的配置

# 配置接口Vlan-interface2的IP地址。

<SwitchA> system-view

[SwitchA] interface Vlan-interface 2

[SwitchA-Vlan-interface2] ip address 1.0.1.11 24

[SwitchA-Vlan-interface2] quit

# 開啟NTP功能。

[SwitchA] ntp-service enable

# 設置本地時鍾作為參考時鍾,層數為2。

[SwitchA] ntp-service refclock-master 2

3.3.2  Switch B的配置

# 配置接口的IP地址,配置步驟這裏省略。

# 開啟NTP功能。

<SwitchB> system-view

[SwitchB] ntp-service enable

# 設置NTP Server為Switch B的時間服務器。

[SwitchB] ntp-service unicast-server 1.0.1.11

3.3.3  Switch C的配置

# 配置接口的IP地址,配置步驟這裏省略。

# 開啟NTP功能。

<SwitchC> system-view

[SwitchC] ntp-service enable

# 設置NTP Server為Switch C的時間服務器。

[SwitchC] ntp-service unicast-server 1.0.1.11

3.4  驗證配置

# 以上配置完成後,Switch B和Switch C向Switch A進行時間同步。以Switch B為例,查看NTP的運行狀態。

[SwitchB] 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 2013 16:24:53.341

此時Switch B已經與Switch A同步,層數比Switch A的層數大1,為3。

# 查看Switch B的NTP會話信息,可以看到Switch B與Switch A建立了連接。

[SwitchB] 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

3.5  配置文件

·              Switch A上的配置

#

interface Vlan-interface2

 ip address 1.0.1.11 255.255.255.0

#

 ntp-service enable

 ntp-service refclock-master 2

#

·              Switch 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

#

·              Switch 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

#

4  NTP廣播模式典型配置舉例

4.1  組網需求

圖2所示,網絡中設備較多,所有設備都位於同一個網段(3.0.1.0/24)中,為了便於管理,現要求通過配置NTP廣播模式,使網絡中的設備擁有一致,統一的時間。

圖2 NTP廣播模式配置組網圖

 

4.2  使用版本

本舉例是在S7600X-CMW710-R7577P01版本上進行配置和驗證的。

4.3  配置步驟

4.3.1  Switch C的配置

# 開啟NTP功能。

<SwitchC> system-view

[SwitchC] ntp-service enable

# 設置本地時鍾作為參考時鍾,層數為2。

[SwitchC] ntp-service refclock-master 2

# 配置接口Vlan-interface2的IP地址。

[SwitchC] interface Vlan-interface 2

[SwitchC-Vlan-interface2] ip address 3.0.1.31 24

# 配置Switch C為廣播服務器,從Vlan-interface2向網絡中發送NTP廣播報文。

[SwitchC-Vlan-interface2] ntp-service broadcast-server

4.3.2  Switch A的配置

# 配置接口的IP地址,配置步驟這裏省略。

# 開啟NTP功能。

<SwitchA> system-view

[SwitchA] ntp-service enable

# 設置為廣播客戶端,從Vlan-interface2監聽廣播消息。

[SwitchA-Vlan-interface2] ntp-service broadcast-client

Switch B、Switch D和Switch E的配置與Switch A相同,此處不再贅述。

 

4.4  驗證配置

# Switch A為例,查看NTP的運行狀態。

[SwitchA-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 2013 10:40:08.186

此時Switch A已經與Switch C同步,層數比Switch C的層數大1,為3。

# 查看Switch A的NTP會話信息,可以看到Switch A與Switch C建立了連接。

[SwitchA-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

4.5  配置文件

·              設備Switch 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

#

·              設備Switch A

#

interface Vlan-interface2

 ip address 3.0.1.33 255.255.255.0

 ntp-service broadcast-client

#

 ntp-service enable

#

·              設備Switch B

#

interface Vlan-interface2

 ip address 3.0.1.30 255.255.255.0

 ntp-service broadcast-client

#

 ntp-service enable

#

·              設備Switch D

#

interface Vlan-interface2

 ip address 3.0.1.32 255.255.255.0

 ntp-service broadcast-client

#

 ntp-service enable

#

·              設備Switch E

#

interface Vlan-interface2

 ip address 3.0.1.34 255.255.255.0

 ntp-service broadcast-client

#

 ntp-service enable

#

5  NTP組播模式典型配置舉例

5.1  組網需求

圖3所示,網絡中有一台時間服務器Switch C,網絡中設備較多,而且這些設備分布在不同網段中,為了便於管理,現要求配置NTP組播模式,使網絡中的設備擁有統一,一致的時間。

圖3 配置NTP組播模式組網圖

 

5.2  使用版本

本舉例是在S7600X-CMW710-R7577P01版本上進行配置和驗證的。

5.3  配置步驟

5.3.1  Switch C的配置

# 開啟NTP功能。

<SwitchC> system-view

[SwitchC] ntp-service enable

# 設置本地時鍾作為參考時鍾,層數為2。

[SwitchC] ntp-service refclock-master 2

# 配置接口Vlan-interface2的IP地址。

[SwitchC] interface Vlan-interface 2

[SwitchC-Vlan-interface2] ip address 3.0.1.31 24

# 設置Switch C為組播服務器,從VLAN接口2發送組播報文。

[SwitchC-Vlan-interface2] ntp-service multicast-server

5.3.2  Switch D的配置

# 開啟NTP功能。

<SwitchD> system-view

[SwitchD] ntp-service enable

# 配置接口Vlan-interface2的IP地址。

[SwitchD] interface Vlan-interface 2

[SwitchD-Vlan-interface2] ip address 3.0.1.32 24

# 設置Switch D為組播客戶端,從VLAN接口2監聽組播報文。

[SwitchD-Vlan-interface2] ntp-service multicast-client

5.3.3  Switch B的配置

# 配置接口的IP地址,配置步驟這裏省略。

# 開啟NTP功能。

<SwitchB> system-view

[SwitchB] ntp-service enable

# 設置Switch B為組播客戶端,從VLAN接口2監聽組播報文。

[SwitchB-Vlan-interface2] ntp-service multicast-client

[SwitchB-Vlan-interface2] quit

由於Switch A與Switch C不在同一網段,所以Switch B上需要配置組播功能,否則Switch A收不到Switch C發出的組播報文。

# 配置組播功能。

[SwitchB] multicast routing

[SwitchB] interface vlan-interface 2

[SwitchB-Vlan-interface2] pim dm

[SwitchB-Vlan-interface2] quit

[SwitchB] vlan 3

[SwitchB-vlan3] port Ten-GigabitEthernet 1/0/1

[SwitchB-vlan3] quit

[SwitchB] interface vlan-interface 3

[SwitchB-Vlan-interface3] ip address 1.0.1.10 24

[SwitchB-Vlan-interface3] igmp enable

[SwitchB-Vlan-interface3] igmp static-group 224.0.1.1

[SwitchB-Vlan-interface3] quit

[SwitchB] igmp-snooping

[SwitchB-igmp-snooping] quit

[SwitchB] interface Ten-GigabitEthernet 1/0/1

[SwitchB-Ten-GigabitEthernet1/0/1] igmp-snooping static-group 224.0.1.1 vlan 3

5.3.4  Switch A的配置

# 開啟NTP功能。

<SwitchA> system-view

[SwitchA] ntp-service enable

# 配置接口Vlan-interface3的IP地址。

[SwitchA] interface Vlan-interface 3

[SwitchA-Vlan-interface3] ip address 1.0.1.11 24

# 設置Switch A為組播客戶端,從VLAN接口3監聽組播報文。

[SwitchA-Vlan-interface3] ntp-service multicast-client

5.4  驗證配置

# Switch A為例,查看NTP的運行狀態。

[SwitchA-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 2013 11:37:57.184

此時Switch A已經與Switch C同步,層數比Switch C的層數大1,為3。

5.5  配置文件

·              設備Switch A

#

 ntp-service enable

#

interface Vlan-interface3

 ip address 1.0.1.11 255.255.255.0

 ntp-service multicast-client

#

·              設備Switch 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

#

·              設備Switch 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

#

·              設備Switch D

#

 ntp-service enable

#

interface Vlan-interface2

 ip address 3.0.1.32 255.255.255.0

 ntp-service multicast-client

#

6  帶身份驗證的NTP客戶端/服務器模式典型配置舉例

6.1  組網需求

網絡中有一台時間服務器Switch A,為網絡中的其它設備提供精確的時間服務,為保證網絡中的所有設備能保持一致、統一的時鍾,現要求:

·              配置NTP服務器/客戶端模式,使所有設備能從時間服務器Switch A上獲得時鍾同步。

·              設備在獲得時鍾同步前,需要通過Switch A的NTP驗證。

圖4 帶身份驗證的NTP客戶端/服務器模式典型配置舉例組網圖

 

6.2  使用版本

本舉例是在S7600X-CMW710-R7577P01版本上進行配置和驗證的。

6.3  配置步驟

6.3.1  Switch A的配置

# 配置接口Vlan-interface2的IP地址。

<SwitchA> system-view

[SwitchA] interface Vlan-interface 2

[SwitchA-Vlan-interface2] ip address 1.0.1.11 24

# 開啟NTP服務。

[SwitchA] ntp-service enable

# 設置本地時鍾作為參考時鍾,層數為2。

[SwitchA] ntp-service refclock-master 2

# 在Switch A上啟動NTP驗證功能。

[SwitchA] ntp-service authentication enable

# 創建編號為42的NTP驗證密鑰,密鑰值為aNiceKey,以明文形式輸入。

[SwitchA] ntp-service authentication-keyid 42 authentication-mode md5 simple aNiceKey

# 配置編號為42的密鑰為可信密鑰。

[SwitchA] ntp-service reliable authentication-keyid 42

6.3.2  Switch B的配置

# 配置接口的IP地址,配置步驟這裏省略。

# 開啟NTP服務。

<SwitchB> system-view

[SwitchB] ntp-service enable

# 在Switch B上啟動NTP驗證功能。

[SwitchB] ntp-service authentication enable

# 創建編號為42的NTP驗證密鑰,密鑰值為aNiceKey,以明文形式輸入。

[SwitchB] ntp-service authentication-keyid 42 authentication-mode md5 simple aNiceKey

# 配置編號為42的密鑰為可信密鑰。

[SwitchB] ntp-service reliable authentication-keyid 42

# 設置Switch A為Switch B的NTP服務器,並將該服務器與編號為42的密鑰關聯。

[SwitchB] ntp-service unicast-server 1.0.1.11 authentication-keyid 42

以上配置將使得Switch B與Switch A進行時間同步。

6.3.3  Switch C的配置

# 配置接口的IP地址,配置步驟這裏省略。

# 開啟NTP服務。

<SwitchC> system-view

[SwitchC] ntp-service enable

# 在Switch C上啟動NTP驗證功能。

[SwitchC] ntp-service authentication enable

# 創建編號為42的NTP驗證密鑰,密鑰值為aNiceKey,以明文形式輸入。

[SwitchC] ntp-service authentication-keyid 42 authentication-mode md5 simple aNiceKey

# 配置編號為42的密鑰為可信密鑰。

[SwitchC] ntp-service reliable authentication-keyid 42

# 設置Switch A為Switch C的NTP服務器,並將該服務器與編號為42的密鑰關聯。

[SwitchC] ntp-service unicast-server 1.0.1.11 authentication-keyid 42

以上配置將使得Switch C與Switch A進行時間同步。

6.4  驗證配置

# 完成上述配置後,Switch B、SwitchC可以與Switch A的時間同步。同步後查看Switch B的狀態。可以看出,Switch B已經與Switch A同步,層數比Switch A的層數大1,為3。

[SwitchB] 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 2013 16:06:26.764

# 查看Switch B的NTP服務的所有IPv4會話信息,可以看到Switch B與Switch A建立了會話。

[SwitchB] 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

6.5  配置文件

·              設備Switch 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

#

·              設備Switch 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

#

·              設備Switch 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

#

7  SNTP典型配置舉例

7.1  組網需求

圖5所示,網絡中有一台時間服務器Switch A,為網絡中的其它網絡設備提供精確的時間服務,為保證網絡中的所有設備能保持一致、統一的時鍾,現要求配置所有網絡設備為SNTP客戶端,使所有設備能從時間服務器Switch A上獲得時鍾同步。

圖5 SNTP典型配置舉例組網圖

 

7.2  使用版本

本舉例是在S7600X-CMW710-R7577P01版本上進行配置和驗證的。

7.3  配置步驟

7.3.1  Switch A的配置

# 配置接口Vlan-interface2的IP地址。

<SwitchA> system-view

[SwitchA] interface Vlan-interface 2

[SwitchA-Vlan-interface2] ip address 1.0.1.11 24

# 開啟NTP功能。

[SwitchA] ntp-service enable

# 設置本地時鍾作為參考時鍾,層數為2。

[SwitchA] ntp-service refclock-master 2

7.3.2  Switch B的配置

# 配置接口的IP地址,配置步驟這裏省略。

# 開啟SNTP功能。

<SwitchB> system-view

[SwitchB] sntp enable

# 設置Switch A為Switch B的時間服務器。

[SwitchB] sntp unicast-server 1.0.1.11

7.3.3  Switch C的配置

# 配置接口的IP地址,配置步驟這裏省略。

# 開啟SNTP功能。

<SwitchC> system-view

[SwitchC] sntp enable

# 設置Switch A為Switch C的時間服務器。

[SwitchC] sntp unicast-server 1.0.1.11

7.4  驗證配置

# 以上配置完成後,Switch B和Switch C向Switch A進行時間同步。以Switch B為例,查看Switch B的NTP會話信息,可以看到Switch B與Switch A建立了連接。

[SwitchB] display sntp sessions

SNTP server     Stratum   Version    Last receive time

1.0.1.11        2         4          Thu, Sep 26 2013 17:25:09.121 (Synced)

7.5  配置文件

·              Switch A上的配置

#

interface Vlan-interface2

 ip address 1.0.1.11 255.255.255.0

#

 ntp-service enable

 ntp-service refclock-master 2

#

·              Switch B上的配置

#

interface Vlan-interface2

 ip address 1.0.1.12 255.255.255.0

#

 sntp enable

 sntp unicast-server 1.0.1.11

#

·              Switch C上的配置

#

interface Vlan-interface2

 ip address 1.0.1.13 255.255.255.0

#

 sntp enable

 sntp unicast-server 1.0.1.11

#

8  IPv6 NTP服務器/客戶端模式典型配置舉例

8.1  組網需求

3.1  圖1所示,IPv6網絡中有一台時間服務器Switch A,為網絡中的其它設備提供精確的時間服務,為保證網絡中所有設備的時間保持一致,現要求配置IPv6 NTP服務器/客戶端模式,使所有設備能從時間服務器Switch A上獲得時鍾同步。

圖6 配置IPv6 NTP服務器/客戶端模式組網圖

 

8.2  使用版本

本舉例是在S7600X-CMW710-R7577P01版本上進行配置和驗證的。

8.3  配置步驟

8.3.1  Switch A的配置

# 配置接口Vlan-interface2的IP地址。

<SwitchA> system-view

[SwitchA] interface vlan-interface 2

[SwitchA-Vlan-interface2] ipv6 address 3000::34 64

[SwitchA-Vlan-interface2] quit

# 開啟NTP功能。

[SwitchA] ntp-service enable

# 設置本地時鍾作為參考時鍾,層數為2。

[SwitchA] ntp-service refclock-master 2

8.3.2  Switch B的配置

# 配置接口的IP地址,配置步驟這裏省略。

# 開啟NTP功能。

<SwitchB> system-view

[SwitchB] ntp-service enable

# 設置NTP Server為Switch B的時間服務器。

[SwitchB] ntp-service ipv6 unicast-server 3000::34

8.3.3  Switch C的配置

# 配置接口的IP地址,配置步驟這裏省略。

# 開啟NTP功能。

<SwitchC> system-view

[SwitchC] ntp-service enable

# 設置NTP Server為Switch C的時間服務器。

[SwitchC] ntp-service ipv6 unicast-server 3000::34

8.4  驗證配置

# 以上配置完成後,Switch B和Switch C向Switch A進行時間同步。以Switch B為例,查看NTP的運行狀態。

[SwitchB] 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 2013 16:24:53.341

此時Switch B已經與Switch A同步,層數比Switch A的層數大1,為3。

# 查看Switch B的NTP會話信息,可以看到Switch B與Switch A建立了連接。

[SwitchB] 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

8.5  配置文件

·              設備Switch A

#

interface Vlan-interface2

 ipv6 address 3000::34/64

#

 ntp-service enable

 ntp-service refclock-master 2

#

·              設備Switch B

#

interface Vlan-interface2

 ipv6 address 3000::35/64

#

 ntp-service enable

 ntp-service ipv6 unicast-server 3000::34

#

·              設備Switch C

#

interface Vlan-interface2

 ipv6 address 3000::36/64

#

 ntp-service enable

 ntp-service ipv6 unicast-server 3000::34

#

9  IPv6 NTP組播模式典型配置舉例

9.1  組網需求

5.1  圖3所示,IPv6網絡中有一台時間服務器Switch C,網絡中設備較多,而且這些設備分布在不同網段中,為了便於管理,現要求配置IPv6 NTP組播模式,使網絡中所有設備的時間保持一致。

圖7 配置IPv6 NTP組播模式組網圖

 

9.2  使用版本

本舉例是在S7600X-CMW710-R7577P01版本上進行配置和驗證的。

9.3  配置步驟

9.3.1  Switch C的配置

# 配置路由協議,以保證各設備間能夠路由可達,配置步驟這裏省略。

# 開啟NTP功能。

<SwitchC> system-view

[SwitchC] ntp-service enable

# 設置本地時鍾作為參考時鍾,層數為2。

[SwitchC] ntp-service refclock-master 2

# 配置接口Vlan-interface2的IP地址。

[SwitchC] interface Vlan-interface 2

[SwitchC-Vlan-interface2] ipv6 address 3000::2 64

# 設置Switch C為IPv6組播服務器,從VLAN接口2向組播地址FF24::1發送NTP組播報文。

[SwitchC-Vlan-interface2] ntp-service ipv6 multicast-server ff24::1

[SwitchC-Vlan-interface2] quit

9.3.2  Switch D的配置

# 配置路由協議,以及接口的IP地址,以保證各設備間能夠路由可達,配置步驟這裏省略。

# 開啟NTP功能。

<SwitchD> system-view

[SwitchD] ntp-service enable

# 設置Switch D為組播客戶端,從VLAN接口2監聽組播報文。

[SwitchD-Vlan-interface2] ntp-service ipv6 multicast-client ff24::1

[SwitchD-Vlan-interface2] quit

9.3.3  Switch B的配置

# 配置路由協議,以及接口的IP地址,以保證各設備間能夠路由可達,配置步驟這裏省略。

# 開啟NTP功能。

<SwitchB> system-view

[SwitchB] ntp-service enable

# 設置Switch B為組播客戶端,從VLAN接口2監聽組播報文。

[SwitchB-Vlan-interface2] ntp-service ipv6 multicast-client ff24::1

[SwitchB-Vlan-interface2] quit

由於Switch A與Switch C不在同一網段,所以Switch B上需要配置組播功能,否則Switch A收不到Switch C發出的組播報文。

# 配置組播功能。

[SwitchB] ipv6 multicast routing

[SwitchB-mrib6] quit

[SwitchB] interface vlan-interface 2

[SwitchB-Vlan-interface2] ipv6 pim dm

[SwitchB-Vlan-interface2] quit

[SwitchB] vlan 3

[SwitchB-vlan3] port Ten-GigabitEthernet 1/0/1

[SwitchB-vlan3] quit

[SwitchB] interface vlan-interface 3

[SwitchB-Vlan-interface3] mld enable

[SwitchB-Vlan-interface3] mld static-group ff24::1

[SwitchB-Vlan-interface3] quit

[SwitchB] mld-snooping

[SwitchB-mld-snooping] quit

[SwitchB] interface Ten-GigabitEthernet 1/0/1

[SwitchB-Ten-GigabitEthernet1/0/1] mld-snooping static-group ff24::1 vlan 3

[SwitchB-mld-snooping] quit

9.3.4  Switch A的配置

# 配置路由協議,以及接口的IP地址,以保證各設備間能夠路由可達,配置步驟這裏省略。

# 開啟NTP功能。

<SwitchA> system-view

[SwitchA] ntp-service enable

# 設置Switch A為組播客戶端,從VLAN接口3監聽組播報文。

[SwitchA-Vlan-interface3] ntp-service ipv6 multicast-client ff24::1

[SwitchA-Vlan-interface3] quit

9.4  驗證配置

# Switch A為例,查看NTP的運行狀態。

[SwitchA] 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 2013 11:37:57.184

此時Switch A已經與Switch C同步,層數比Switch C的層數大1,為3。

9.5  配置文件

·              設備Switch A

#

 ntp-service enable

#

interface Vlan-interface3

 ipv6 address 2000::1/64

 ntp-service ipv6 multicast-client ff24::1

#

·              設備Switch 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

#

·              設備Switch C

#

 ntp-service enable

ntp-service refclock-master 2

#

interface Vlan-interface2

 ipv6 address 3000::2/64

 ntp-service ipv6 multicast-server ff24::1

#

·              設備Switch D

#

 ntp-service enable

#

interface Vlan-interface2

 ipv6 address 3000::3/64

 ntp-service ipv6 multicast-client ff24::1

#

10  帶身份驗證的NTP廣播模式典型配置舉例

10.1  組網需求

6.1  圖4所示,網絡中設備較多,所有設備都位於同一個網段(3.0.1.0/24)中,為了使網絡中所有設備的時間保持一致,現要求:

·              配置NTP廣播模式。

·              NTP廣播客戶端與NTP廣播服務器進行時間同步前,必須先進行身份驗證,以保證時鍾同步的安全性,防止攻擊者將自己偽裝成為一個時鍾服務器而對客戶時鍾發起攻擊。

圖8 帶身份驗證的NTP廣播模式典型配置舉例組網圖

 

10.2  使用版本

本舉例是在S7600X-CMW710-R7577P01版本上進行配置和驗證的。

10.3  配置步驟

10.3.1  Switch C的配置

# 開啟NTP功能。

<SwitchC> system-view

[SwitchC] ntp-service enable

# 設置本地時鍾作為參考時鍾,層數為2。

[SwitchC] ntp-service refclock-master 2

# 配置NTP驗證,密鑰編號為88,密鑰為123456。

[SwitchC] ntp-service authentication enable

[SwitchC] ntp-service authentication-keyid 88 authentication-mode md5 simple 123456

[SwitchC] ntp-service reliable authentication-keyid 88

# 設置Switch C為NTP廣播服務器並指定密鑰編號。

[SwitchC] interface vlan-interface 2

[SwitchC-Vlan-interface2] ip address 3.0.1.31 24

[SwitchC-Vlan-interface2] ntp-service broadcast-server authentication-keyid 88

[SwitchC-Vlan-interface2] quit

10.3.2  Switch A的配置

# 開啟NTP功能。

<SwitchA> system-view

[SwitchA] ntp-service enable

# 配置NTP驗證,密鑰編號與密鑰與Switch C完全相同。

[SwitchA] ntp-service authentication enable

[SwitchA] ntp-service authentication-keyid 88 authentication-mode md5 simple 123456

[SwitchA] ntp-service reliable authentication-keyid 88

# 設置Switch A為NTP廣播客戶端。

[SwitchA] interface vlan-interface 2

[SwitchA-Vlan-interface2] ntp-service broadcast-client

[SwitchA-Vlan-interface2] ip address 3.0.1.33 24

[SwitchA-Vlan-interface2] quit

以上配置將Switch A配置為從VLAN接口2監聽廣播報文,接收到Switch C發出的廣播報文後與自己的時鍾進行同步。

說明

除IP地址外,Switch B、Switch D和Switch E與SwitchA的其他配置完全相同,此處不再贅述。

 

10.4  驗證配置

# Switch A為例,查看NTP的運行狀態。

[SwitchA] 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 2013 15:50:09.184

此時Switch A已經與Switch C同步,層數比Switch C的層數大1,為3。

10.5  配置文件

·              設備Switch A、Switch B、Switch D和Switch 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$pU6KvpS80MadhM2zMCCSR07HX4qEbJhHvQ==

 ntp-service reliable authentication-keyid 88

#

·              設備Switch 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+gOaG5363/fz4M3dQvHo2Fw==

 ntp-service reliable authentication-keyid 88

 ntp-service refclock-master 3

#

11  相關資料

·              H3C S7600-X係列以太網交換機 網絡管理和監控配置指導-R757X

·              H3C S7600-X係列以太網交換機 網絡管理和監控命令參考-R757X

 

不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!

BOB登陆
官網
聯係我們