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

08 網絡管理和監控命令參考

目錄

02-NTP命令

本章節下載 02-NTP命令  (201.10 KB)

02-NTP命令


1 NTP配置命令

1.1  NTP配置命令

1.1.1  display ntp-service sessions

【命令】

display ntp-service sessions [ verbose ] [ | { begin | exclude | include } regular-expression ]

【視圖】

任意視圖

【缺省級別】

1:監控級

【參數】

verbose:顯示NTP服務維護的所有會話的詳細信息。如果不指定該參數,則隻顯示所有會話的簡要信息。

|:使用正則表達式對顯示信息進行過濾。有關正則表達式的詳細介紹,請參見“基礎配置指導”中的“CLI”。

begin:從包含指定正則表達式的行開始顯示。

exclude:隻顯示不包含指定正則表達式的行。

include:隻顯示包含指定正則表達式的行。

regular-expression:表示正則表達式,為1~256個字符的字符串,區分大小寫。

【描述】

display ntp-service sessions命令用來顯示NTP服務維護的所有會話信息。

【舉例】

# 顯示NTP服務維護的所有會話的簡要信息。

<Sysname> display ntp-service sessions

       source          reference       stra reach poll  now offset  delay disper

********************************************************************************

[12345]127.127.1.0     127.127.1.0        3     1   64   33    0.0    0.0    0.0

note: 1 source(master),2 source(peer),3 selected,4 candidate,5 configured

Total associations :  1

表1-1 display ntp-service sessions命令顯示信息描述表

字段

描述

source

時鍾源的IP地址

reference

時鍾源的參考時鍾ID

1.     當參考時鍾為本地時鍾時,本字段的顯示情況和stra字段的取值有關:

·     當stra字段為0或1時,本字段將顯示為LOCL;

·     當stra字段為其他值時,本字段將顯示為本地時鍾的IP地址

2.     當參考時鍾為網絡中其他設備的時鍾時,本字段顯示為該設備的IP地址

stra

時鍾源的時鍾層數

時鍾層數決定了時鍾的準確度,取值範圍為1~16,層數為1的時鍾準確度最高,準確度從1到16依次遞減,層數為16的時鍾處於未同步狀態

reach

時鍾源的可達性計數,0表示時鍾源不可達

poll

輪詢間隔,即兩個連續NTP報文之間的時間間隔,單位為秒

now

最近一次接收到NTP報文或更新本地時間到現在的時間間隔

缺省單位為秒;如果時間間隔大於2048秒,則顯示為分鍾m;如果時間間隔大於300分鍾,則顯示為小時h;如果時間間隔大於96小時,則顯示為天d

offset

係統時鍾相對於參考時鍾的時鍾偏移,單位為毫秒

delay

本地設備到時鍾源的往返時延,單位為毫秒

disper

係統時鍾相對於參考時鍾的最大誤差

[12345]

1:設備選中的時鍾源,即當前與設備進行同步的時鍾源

2:該時鍾源的時鍾層數小於等於15

3:該時鍾源通過了時鍾選擇流程

4:該時鍾源為候選時鍾源

5:該時鍾源是配置命令所建立的

Total associations

總的連接數

 

# 顯示NTP服務維護的所有會話的詳細信息。

<Sysname> display ntp-service sessions verbose

 clock source: 127.127.1.0

 clock stratum: 3

 clock status: configured, master, sane, valid

 reference clock ID: 127.127.1.0

 local mode: client, local poll: 6

 peer mode: server, peer poll: 6

 offset: 0.0000 ms,delay: 0.00 ms,  disper: 0.02 ms

 root delay: 0.00 ms, root disper: 10.00 ms

 reach: 1, sync dist: 0.010, sync state: 2

 precision: 2^18, version: 3, peer interface: InLoopBack0

 reftime: 10:56:22.442 UTC Jan 7 2011(CE2686D6.71484513)

 orgtime: 10:56:22.442 UTC Jan 7 2011(CE2686D6.71484513)

 rcvtime: 10:56:22.442 UTC Jan 7 2011(CE2686D6.7149E881)

 xmttime: 10:56:22.442 UTC Jan 7 2011(CE2686D6.71464DC2)

 filter delay :  0.00   0.00   0.00   0.00   0.00   0.00   0.00   0.00

 filter offset:  0.00   0.00   0.00   0.00   0.00   0.00   0.00   0.00

 filter disper:  0.00   0.00   0.00   0.00   0.00   0.00   0.00   0.00

 Total associations : 1

表1-2 display ntp-service sessions verbose命令顯示信息描述表

字段

描述

clock source

時鍾源的IP地址

clock stratum

時鍾源的時鍾層數

時鍾層數決定了時鍾的準確度,取值範圍為1~16,層數為1的時鍾準確度最高,準確度從1到16依次遞減,層數為16的時鍾處於未同步狀態

clock status

時鍾源的狀態,該字段的取值及含義為:

·     configured:表示該會話是配置命令所建立的

·     dynamic:表示該會話是動態生成的

·     master:表示該會話對應的時鍾源是當前係統的主時鍾源

·     selected:表示該會話對應的時鍾源通過了時鍾選擇算法

·     candidate:表示該會話對應的時鍾源為候選時鍾源

·     sane:表示該會話對應的時鍾源通過健全驗證

·     insane:表示該會話對應的時鍾源未通過健全驗證

·     valid:表示該會話對應的時鍾源是有效的(通過驗證、處於同步狀態、層數有效、根延時/離差未越界等)

·     invalid:表示該會話對應的時鍾源是無效的

·     unsynced:表示該會話對應的時鍾源未同步或層數非法

reference clock ID

時鍾源的參考時鍾ID

1.     當參考時鍾為本地時鍾時,本字段的顯示情況和時鍾源的層數有關:

·     當時鍾源的層數為0或1時,本字段將顯示為LOCL;

·     當時鍾源的層數為其他值時,本字段將顯示為本地時鍾的IP地址

2.     當參考時鍾為網絡中其他設備的時鍾時,本字段顯示為該設備的IP地址

local mode

本地設備的工作模式,取值包括:

·     unspec:未指定模式

·     active:主動對等體模式

·     passive:被動對等體模式

·     client:客戶端模式

·     server:服務器模式

·     bdcast:廣播服務器模式

·     control:控製查詢模式

·     private:私有消息模式

local poll

本地設備的輪詢間隔,顯示的是2的次冪數,單位為秒,比如6表示輪詢間隔為2的6次冪,即64s

peer mode

對端設備的工作模式,取值包括:

·     unspec:未指定模式

·     active:主動對等體模式

·     passive:被動對等體模式

·     client:客戶端模式

·     server:服務器模式

·     bdcast:廣播服務器模式

·     control:控製查詢模式

·     private:私有消息模式

peer poll

對端設備的輪詢間隔,顯示的是2的次冪數,單位為秒,比如6表示輪詢間隔為2的6次冪,即64s

offset

係統時鍾相對於參考時鍾的時鍾偏移,單位為毫秒

delay

本地設備到時鍾源的往返時延,單位為毫秒

disper

係統時鍾相對於參考時鍾的最大誤差

root delay

本地設備到主參考時鍾源的往返時延,單位為毫秒

root disper

係統時鍾相對主參考時鍾的最大誤差,單位為毫秒

reach

時鍾源的可達性計數,0表示時鍾源不可達

sync dist

表示相對上一級時鍾源的同步距離,由誤差disper和往返時延delay計算而來,單位為秒

sync state

狀態機所處的狀態,有0~5共6個狀態

precision

係統時鍾的精度

version

NTP版本,取值為1~4

peer interface

源接口

未指定源接口時,此字段顯示為wildcard

reftime

NTP報文中的參考時間戳

orgtime

NTP報文中的起始時間戳

rcvtime

NTP報文的接收時間戳

xmttime

NTP報文的發送時間戳

filter delay

延遲樣本信息

filter offset

偏差樣本信息

filter disper

離差樣本信息

Total associations

總的連接數

 

說明

設備作為NTP廣播服務器或NTP組播服務器時,在設備上執行display ntp-service sessions命令不會顯示與該廣播服務器或組播服務器對應的NTP會話信息,但是這些會話會統計在總的連接數中。

 

1.1.2  display ntp-service status

【命令】

display ntp-service status [ | { begin | exclude | include } regular-expression ]

【視圖】

任意視圖

【缺省級別】

1:監控級

【參數】

|:使用正則表達式對顯示信息進行過濾。有關正則表達式的詳細介紹,請參見“基礎配置指導”中的“CLI”。

begin:從包含指定正則表達式的行開始顯示。

exclude:隻顯示不包含指定正則表達式的行。

include:隻顯示包含指定正則表達式的行。

regular-expression:表示正則表達式,為1~256個字符的字符串,區分大小寫。

【描述】

display ntp-service status命令用來顯示NTP服務的狀態信息。

【舉例】

# 顯示NTP服務的狀態信息。

<Sysname> display ntp-service status

 Clock status: unsynchronized

 Clock stratum: 16

 Reference clock ID: none

 Nominal frequency: 100.0000 Hz

 Actual frequency: 100.0000 Hz

 Clock precision: 2^17

 Clock offset: 0.0000 ms

 Root delay: 0.00 ms

 Root dispersion: 0.00 ms

 Peer dispersion: 0.00 ms

 Reference time: 00:00:00.000 UTC Jan 1 1900(00000000.00000000)

表1-3 display ntp-service status命令顯示信息描述表

字段

描述

Clock status

係統時鍾狀態,取值為:

·     synchronized:係統時鍾已同步

·     unsynchronized:係統時鍾未同步

Clock stratum

係統時鍾的層數

Reference clock ID

係統時鍾同步到遠程時間服務器時,指示遠程服務器的地址

係統時鍾同步到本地時鍾源時,指示本地時鍾源的標識:

·     本地時鍾的層數為1時,顯示為LOCL

·     本地時鍾的層數為其他值時,顯示為本地時鍾的IP地址

Nominal frequency

本地係統硬件時鍾的標稱頻率,單位為赫茲

Actual frequency

本地係統硬件時鍾的實際頻率,單位為赫茲

Clock precision

係統時鍾的精度

Clock offset

係統時鍾相對參考時鍾的偏移量,單位為毫秒

Root delay

本地設備到主參考時鍾源的往返時延,單位為毫秒

Root dispersion

係統時鍾相對主參考時鍾的最大誤差,單位為毫秒

Peer dispersion

係統時鍾相對參考時鍾的最大誤差,單位為毫秒

Reference time

參考時間戳

 

1.1.3  display ntp-service trace

【命令】

display ntp-service trace [ | { begin | exclude | include } regular-expression ]

【視圖】

任意視圖

【缺省級別】

1:監控級

【參數】

|:使用正則表達式對顯示信息進行過濾。有關正則表達式的詳細介紹,請參見“基礎配置指導”中的“CLI”。

begin:從包含指定正則表達式的行開始顯示。

exclude:隻顯示不包含指定正則表達式的行。

include:隻顯示包含指定正則表達式的行。

regular-expression:表示正則表達式,為1~256個字符的字符串,區分大小寫。

【描述】

display ntp-service trace命令用來顯示從本地設備回溯到主參考時鍾源的各個NTP時間服務器的簡要信息。

隻有本地設備與其NTP同步鏈上的所有時間服務器都能ping通時,display ntp-service trace命令才可以正常使用,否則會因超時而不能將同步鏈上的所有時間服務器都顯示出來。

【舉例】

# 顯示從本地設備回溯到主參考時鍾源的各個NTP時間服務器的簡要信息。

<Sysname> display ntp-service trace

 server 127.0.0.1,stratum 2, offset -0.013500, synch distance 0.03154

 server 133.1.1.1,stratum 1, offset -0.506500, synch distance 0.03429

 refid LOCL

以上信息顯示服務器127.0.0.1的同步鏈,表示服務器127.0.0.1同步到服務器133.1.1.1,服務器133.1.1.1從本地時鍾源得到同步。

表1-4 display ntp-service trace命令顯示信息描述表

字段

描述

server

NTP時間服務器的IP地址

stratum

表示相應係統時鍾的層數

offset

表示相對上一級時鍾的時鍾偏差,單位為秒

synch distance

表示相對上一級時鍾源的同步距離,由誤差disper和往返時延delay計算而來,單位為秒

refid

主參考時鍾源的標識,主參考時鍾的層數為0時,顯示為LOCL;為其他值時,顯示為主參考時鍾的IP地址

 

1.1.4  ntp-service access

【命令】

ntp-service access { peer | query | server | synchronization } acl-number

undo ntp-service access { peer | query | server | synchronization }

【視圖】

係統視圖

【缺省級別】

3:管理級

【參數】

peer:完全訪問權限。該權限既允許對端設備向本地設備同步和控製查詢,同時本地設備也可以同步到對端設備。所謂控製查詢,就是查詢NTP的一些狀態,比如告警信息,驗證狀態,時鍾源信息等。

query:允許控製查詢權限。該權限隻允許對端設備對本地設備的NTP服務進行控製查詢,但是不能向本地設備同步。

server:允許服務器訪問與查詢權限。該權限允許對端設備向本地設備同步和控製查詢,但本地設備不會同步到對端設備。

synchronization:隻允許服務器訪問權限。該權限隻允許對端設備向本地設備同步,但不能進行控製查詢。

acl-number:基本訪問控製列表號,取值範圍為2000~2999。

【描述】

ntp-service access命令用來設置對端設備對本地設備NTP服務的訪問控製權限。undo ntp-service access命令用來取消設置的訪問控製權限。

缺省情況下,對端設備對本地設備NTP服務的訪問控製權限為peer

NTP服務的訪問控製權限從高到低依次為peerserversynchronizationquery。當設備接收到NTP服務請求報文時,會按照此順序進行匹配,以第一個匹配的權限為準。如果沒有匹配任何權限,則丟棄此NTP服務請求報文。

需要注意的是:

·     ntp-service access命令中指定的訪問控製列表號必須已經創建並配置完成。

·     ntp-service access命令提供了一種最小限度的安全措施,更安全的方法是進行身份驗證。相關配置可參考命令ntp-service authentication enable

【舉例】

# 配置10.10.0.0/16網段的對端設備對本地設備具有完全訪問權限。

<Sysname> system-view

[Sysname] acl number 2001

[Sysname-acl-basic-2001] rule permit source 10.10.0.0 0.0.255.255

[Sysname-acl-basic-2001] quit

[Sysname] ntp-service access peer 2001

1.1.5  ntp-service authentication enable

【命令】

ntp-service authentication enable

undo ntp-service authentication enable

【視圖】

係統視圖

【缺省級別】

3:管理級

【參數】

【描述】

ntp-service authentication enable命令用來使能NTP身份驗證功能。undo ntp-service authentication enable命令用來關閉NTP身份驗證功能。

缺省情況下,NTP身份驗證功能處於關閉狀態。

相關配置可參考命令ntp-service authentication-keyidntp-service reliable authentication-keyid

【舉例】

# 使能NTP身份驗證功能。

<Sysname> system-view

[Sysname] ntp-service authentication enable

1.1.6  ntp-service authentication-keyid

【命令】

ntp-service authentication-keyid keyid authentication-mode md5 [ cipher | simple ] value

undo ntp-service authentication-keyid keyid

【視圖】

係統視圖

【缺省級別】

3:管理級

【參數】

keyid:密鑰編號,取值範圍為1~4294967295。

cipher:表示以密文形式設置密鑰。

simple:表示以明文形式設置密鑰。

value:表示NTP服務的MD5驗證密鑰,區分大小寫。明文形式設置密鑰時為1~32個字符的字符串,密文形式設置密鑰時為1~73個字符的字符串。如果不指定密文形式或明文形式,則表示以明文形式設置密鑰。

【描述】

ntp-service authentication-keyid命令用來設置NTP驗證密鑰。undo ntp-service authentication-keyid命令用來取消NTP驗證密鑰。

缺省情況下,沒有設置NTP驗證密鑰。

在一些對安全性要求較高的網絡中,運行NTP協議時需要啟用驗證功能。通過客戶端和服務器端的密碼驗證,保證客戶端隻與通過驗證的設備進行同步,提高了網絡安全性。

配置NTP驗證密鑰後,還需要通過ntp-service reliable authentication-keyid命令將該密鑰設置為可信密鑰。

以明文或密文方式設置的密鑰,均以密文方式保存在配置文件中。

注意

·     目前設備隻支持MD5的密鑰驗證算法。

·     每台設備可以配置的最大密鑰個數為1024。

·     如果NTP驗證密鑰被指定為可信密鑰,刪除密鑰後,該密鑰將自動變為不可信密鑰,不必再執行undo ntp-service reliable authentication-keyid命令。

 

相關配置可參考命令ntp-service reliable authentication-keyid

【舉例】

# 設置MD5身份驗證密鑰,密鑰ID號為10,密鑰為BetterKey。

<Sysname> system-view

[Sysname] ntp-service authentication enable

[Sysname] ntp-service authentication-keyid 10 authentication-mode md5 BetterKey

1.1.7  ntp-service broadcast-client

【命令】

ntp-service broadcast-client

undo ntp-service broadcast-client

【視圖】

VLAN接口視圖

【缺省級別】

3:管理級

【參數】

【描述】

ntp-service broadcast-client命令用來配置設備工作在NTP廣播客戶端模式,並使用當前接口接收NTP廣播報文。undo ntp-service broadcast-client命令用來取消NTP廣播客戶端模式的配置。

缺省情況下,設備沒有工作在任何NTP模式。

【舉例】

# 配置設備工作在廣播客戶端模式,在VLAN接口1上接收NTP廣播報文。

<Sysname> system-view

[Sysname] interface vlan-interface 1

[Sysname-Vlan-interface1] ntp-service broadcast-client

1.1.8  ntp-service broadcast-server

【命令】

ntp-service broadcast-server [ authentication-keyid keyid | version number ] *

undo ntp-service broadcast-server

【視圖】

VLAN接口視圖

【缺省級別】

3:管理級

【參數】

authentication-keyid keyid:指定向廣播客戶端發送廣播報文時使用的密鑰編號。keyid取值範圍為1~4294967295。如果不需要驗證,則該參數不需配置。

version number:定義NTP版本號。number取值範圍為1~4,缺省值為3。

【描述】

ntp-service broadcast-server命令用來配置設備工作在NTP廣播服務器模式,並使用當前接口發送NTP廣播報文。undo ntp-service broadcast-server命令用來取消NTP廣播服務器模式的配置。

缺省情況下,設備沒有工作在任何NTP模式。

【舉例】

# 配置設備工作在廣播服務器模式,在VLAN接口1上發送NTP廣播報文,用4號密鑰進行加密,設置NTP版本號為3。

<Sysname> system-view

[Sysname] interface vlan-interface 1

[Sysname-Vlan-interface1] ntp-service broadcast-server authentication-keyid 4 version 3

1.1.9  ntp-service dscp

【命令】

ntp-service dscp dscp-value

undo ntp-service dscp

【視圖】

係統視圖

【缺省級別】

2:係統級

【參數】

dscp-value:報文的DSCP優先級,取值範圍為0~63。

【描述】

ntp-service dscp命令用來配置NTP報文的DSCP優先級。undo ntp-service dscp命令用來恢複缺省情況。

缺省情況下,NTP報文的DSCP優先級為16。

【舉例】

# 配置NTP報文的DSCP優先級為30。

<Sysname> system-view

[Sysname] ntp-service dscp 30

1.1.10  ntp-service in-interface disable

【命令】

ntp-service in-interface disable

undo ntp-service in-interface disable

【視圖】

VLAN接口視圖

【缺省級別】

3:管理級

【參數】

【描述】

ntp-service in-interface disable命令用來禁止接口接收NTP報文。undo ntp-service in-interface disable命令用來恢複缺省情況。

缺省情況下,允許接口接收NTP報文。

【舉例】

# 禁止VLAN接口1接收NTP報文。

<Sysname> system-view

[Sysname] interface vlan-interface 1

[Sysname-Vlan-interface1] ntp-service in-interface disable

1.1.11  ntp-service max-dynamic-sessions

【命令】

ntp-service max-dynamic-sessions number

undo ntp-service max-dynamic-sessions

【視圖】

係統視圖

【缺省級別】

3:管理級

【參數】

number:允許建立的動態NTP會話的數目,取值範圍為0~100。

【描述】

ntp-service max-dynamic-sessions命令用來配置允許建立的動態NTP會話的數目。undo ntp-service max-dynamic-sessions命令用來恢複缺省情況。

缺省情況下,允許建立的動態NTP會話的數目為100。

同一設備同一時間內存在的連接數目最多為128個,其中包括靜態連接數和動態連接數。靜態連接是用戶手動配置NTP相關命令而建立的連接;動態連接是係統運行過程中建立的臨時連接,若係統長期收不到報文就會刪除該臨時連接。

例如,在客戶端/服務器模式中,當用戶在客戶端配置向服務器端同步的命令的時候,係統會在客戶端建立一個靜態連接,服務器端在收到報文之後隻是被動的響應報文,而不會建立連接(包括靜態和動態連接);在對等體模式中,主動對等體端會建立靜態連接,被動對等體端會建立動態連接;在組播和廣播模式中,服務器端會建立靜態連接,而在客戶端會建立動態連接。

【舉例】

# 設置允許建立的動態NTP會話的數目為50個。

<Sysname> system-view

[Sysname] ntp-service max-dynamic-sessions 50

1.1.12  ntp-service multicast-client

【命令】

ntp-service multicast-client [ ip-address ]

undo ntp-service multicast-client [ ip-address ]

【視圖】

VLAN接口視圖

【缺省級別】

3:管理級

【參數】

ip-address:組播IP地址,缺省值為224.0.1.1。

【描述】

ntp-service multicast-client命令用來配置設備工作在NTP組播客戶端模式,並使用當前接口接收NTP組播報文。undo ntp-service multicast-client命令用來取消NTP組播客戶端模式的配置。

缺省情況下,設備沒有工作在任何NTP模式。

【舉例】

# 配置設備工作在組播客戶端模式,在VLAN接口1上接收NTP組播報文,組播報文對應的組播組地址為224.0.1.1。

<Sysname> system-view

[Sysname] interface vlan-interface 1

[Sysname-Vlan-interface1] ntp-service multicast-client 224.0.1.1

1.1.13  ntp-service multicast-server

【命令】

ntp-service multicast-server [ ip-address ] [ authentication-keyid keyid | ttl ttl-number | version number ] *

undo ntp-service multicast-server [ ip-address ]

【視圖】

VLAN接口視圖

【缺省級別】

3:管理級

【參數】

ip-address:組播IP地址,缺省值為224.0.1.1。

authentication-keyid keyid:指定向組播客戶端發送組播報文時使用的密鑰編號keyid取值範圍為1~4294967295。如果不需要驗證,則該參數不需配置。

ttl ttl-number:定義組播報文的生存期。ttl-number取值範圍為1~255,缺省值為16。

version number:定義NTP版本號。number取值範圍為1~4,缺省值為3。

【描述】

ntp-service multicast-server命令用來配置設備工作在NTP組播服務器模式,並使用當前接口發送NTP組播報文。undo ntp-service multicast-server命令用來取消NTP組播服務器模式的配置。

缺省情況下,設備沒有工作在任何NTP模式。

【舉例】

# 配置設備工作在組播服務器模式,在VLAN接口1上發送NTP組播報文,組播組地址為224.0.1.1,用4號密鑰進行加密,設置NTP版本號為3。

<Sysname> system-view

[Sysname] interface vlan-interface 1

[Sysname-Vlan-interface1] ntp-service multicast-server 224.0.1.1 version 3 authentication-keyid 4

1.1.14  ntp-service reliable authentication-keyid

【命令】

ntp-service reliable authentication-keyid keyid

undo ntp-service reliable authentication-keyid keyid

【視圖】

係統視圖

【缺省級別】

3:管理級

【參數】

keyid:密鑰編號,取值範圍為1~4294967295。

【描述】

ntp-service reliable authentication-keyid命令用來指定已創建的密鑰是可信的。當啟用身份驗證時,客戶端隻會同步到提供可信密鑰的服務器;如果服務器提供的密鑰不是可信的,那麼客戶端不會與其同步。undo ntp-service reliable authentication-keyid命令用來取消可信密鑰。

缺省情況下,沒有配置可信密鑰。

【舉例】

# 設置啟用NTP身份驗證,采用MD5加密方法,密鑰ID號為37,密鑰為BetterKey。

<Sysname> system-view

[Sysname] ntp-service authentication enable

[Sysname] ntp-service authentication-keyid 37 authentication-mode md5 BetterKey

# 指定該密鑰為可信密鑰。

[Sysname] ntp-service reliable authentication-keyid 37

1.1.15  ntp-service source-interface

【命令】

ntp-service source-interface interface-type interface-number

undo ntp-service source-interface

【視圖】

係統視圖

【缺省級別】

3:管理級

【參數】

interface-type interface-number:接口類型及接口編號。

【描述】

ntp-service source-interface命令用來指定NTP報文的源接口。undo ntp-service source-interface命令用來恢複缺省情況。

缺省情況下,沒有指定NTP報文的源接口,即根據路由選擇NTP報文的源IP地址。

如果不想讓本地設備上其他接口的IP地址成為應答報文的目的地址,可以使用該命令指定NTP報文的源接口,此時報文中的源IP地址為該接口的IP地址。

如果指定的NTP源接口處於down狀態,則根據路由表查找報文的出接口,並采用出接口的IP地址作為NTP報文的源IP地址。

【舉例】

# 指定NTP報文的源接口為VLAN接口1。

<Sysname> system-view

[Sysname] ntp-service source-interface vlan-interface 1

1.1.16  ntp-service unicast-peer

【命令】

ntp-service unicast-peer { ip-address | peer-name } [ authentication-keyid keyid | priority | source-interface interface-type interface-number | version number ] *

undo ntp-service unicast-peer { ip-address | peer-name }

【視圖】

係統視圖

【缺省級別】

3:管理級

【參數】

ip-address:被動對等體的IP地址。隻能是一個單播地址,不能為廣播地址、組播地址或本地時鍾的IP地址。

peer-name:被動對等體的主機名字,為1~20個字符的字符串。

authentication-keyid keyid:指定向對等體發送報文使用的密鑰編號。keyid取值範圍為1~4294967295。

priority:在同等條件下,優先選擇ip-addresspeer-name指定的對等體為同步對等體。

source-interface interface-type interface-number:指定NTP報文的源接口。本地設備給對端發送NTP報文時,報文中的源IP地址為該接口的主IP地址。interface-type interface-number為接口類型和接口編號。

version number:定義NTP版本號。number取值範圍為1~4,缺省值為3。

【描述】

ntp-service unicast-peer命令用來為設備指定被動對等體。undo ntp-service unicast-peer命令用來取消為設備指定的被動對等體。

缺省情況下,沒有為設備指定被動對等體。

【舉例】

# 配置設備工作在主動對等體模式,被動對等體的IP地址為10.1.1.1,NTP版本號為3,NTP報文的源IP地址為VLAN接口1的主IP地址。

<Sysname> system-view

[Sysname] ntp-service unicast-peer 10.1.1.1 version 3 source-interface vlan-interface 1

1.1.17  ntp-service unicast-server

【命令】

ntp-service unicast-server { ip-address | server-name } [ authentication-keyid keyid | priority | source-interface interface-type interface-number | version number ] *

undo ntp-service unicast-server { ip-address | server-name }

【視圖】

係統視圖

【缺省級別】

3:管理級

【參數】

ip-address:NTP服務器的IP地址。隻能是一個單播地址,不能為廣播地址、組播地址或本地時鍾的IP地址。

server-name:NTP服務器的主機名字,為1~20個字符的字符串。

authentication-keyid keyid:指定向NTP服務器發送報文使用的密鑰編號。keyid取值範圍為1~4294967295。

priority:指定在同等條件下,優先選擇該服務器。

source-interface interface-type interface-number:指定NTP報文的源接口。本地設備給服務器發送NTP報文時,報文中的源IP地址為該接口的主IP地址。interface-type interface-number為接口類型和接口編號。

version number:指定NTP版本號。number取值範圍為1~4,缺省值為3。

【描述】

ntp-service unicast-server命令用來為設備指定NTP服務器。undo ntp-service unicast-server命令用來取消為設備指定的NTP服務器。

缺省情況下,沒有為設備指定NTP服務器。

【舉例】

# 配置設備的NTP服務器為10.1.1.1,版本號為3。

<Sysname> system-view

[Sysname] ntp-service unicast-server 10.1.1.1 version 3

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

BOB登陆
官網
聯係我們