13_網(wǎng)絡(luò)時(shí)間及域名管理命令
網(wǎng)絡(luò)時(shí)間及域名管理命令 目錄目 錄第1章 SNTP配置..........................
網(wǎng)絡(luò)時(shí)間及域名管理命令 目錄
目 錄
第1章 SNTP配置.......................................................................1-1
1.1 debug sntp......................................................................................1-1
1.2 sntp server......................................................................................1-1
1.3 sntp polltime...................................................................................1-1
1.4 sntp timezone..................................................................................1-2
1.5 show sntp........................................................................................1-2
第2章 NTP配置命令..................................................................2-1
2.1 ntp enable........................................................................................2-1
2.2 ntp server........................................................................................2-1
2.3 ntp timezone...................................................................................2-1
2.4 ntp access-group............................................................................2-2
2.5 ntp authenticate..............................................................................2-2
2.6 ntp authentication-key...................................................................2-2
2.7 ntp trusted-key................................................................................2-3
2.8 ntp disable.......................................................................................2-3
2.9 ntp broadcast client........................................................................2-3
2.10 ntp multicast client.......................................................................2-3
2.11 ntp ipv6 multicast client...............................................................2-4
2.12 debug ntp authentication.............................................................2-4
2.13 debug ntp packets........................................................................2-4
2.14 debug ntp adjust...........................................................................2-5
2.15 debug ntp sync.............................................................................2-5
2.16 debug ntp events..........................................................................2-5
2.17 show ntp status............................................................................2-6
2.18 show ntp session..........................................................................2-6
第3章 DNSV4/V6配置命令.......................................................3-1
3.1 debug dns.......................................................................................3-1
3.2 dns-server.......................................................................................3-1 1
,網(wǎng)絡(luò)時(shí)間及域名管理命令 目錄
3.3 dns lookup......................................................................................3-2
3.4 show dns name-server...................................................................3-2
3.5 show dns domain-list.....................................................................3-2
3.6 show dns dynamic-hosts...............................................................3-3
3.7 ip domain-lookup............................................................................3-3
3.8 ip domain-list..................................................................................3-3
3.9 no dynamic-host.............................................................................3-4
2
,網(wǎng)絡(luò)時(shí)間及域名管理命令 第1章 SNTP 配置
第1章 SNTP 配置
1.1 debug sntp
命令:debug sntp {adjust | packet | select }
no debug sntp {adjust | packet | select}
功能:顯示或關(guān)閉SNTP 調(diào)試信息。
參數(shù):adjust – SNTP時(shí)鐘調(diào)節(jié)信息;packet – SNTP報(bào)文;select – SNTP時(shí)鐘選擇。 命令模式:特權(quán)用戶配置模式。
舉例:顯示SNTP 協(xié)議報(bào)文的調(diào)試信息。
Switch#debug sntp packet
1.2 sntp server
命令:sntp server {
no sntp server {
功能:設(shè)置SNTP/NTP服務(wù)器IPv4/IPv6地址以及服務(wù)器版本;本命令的no 操作取消設(shè)置的SNTP/NTP服務(wù)器地址。
參數(shù):
缺省情況: 缺省情況下不配置任何SNTP/NTP服務(wù)器。
命令模式:全局配置模式。
舉例:(1) 配置一個(gè)SNTP/NTP服務(wù)器IPv4地址,服務(wù)器端使用SNTPv4版本。
Switch(config)#sntp server 10.1.1.1 version 4
(2) 配置一個(gè)SNTP/NTP服務(wù)器IPv6地址。
Switch(config)#sntp server 3ffe:506:1:2::5
1.3 sntp polltime
命令:sntp polltime
no sntp polltime
功能:設(shè)置SNTP 客戶端向NTP/SNTP服務(wù)器發(fā)送請(qǐng)求的間隔;本命令的no 操作取消設(shè)置的polltime ,恢復(fù)缺省值64s 。
參數(shù):
缺省情況:polltime 缺省為64s 。
命令模式:全局配置模式。
1-1
,網(wǎng)絡(luò)時(shí)間及域名管理命令 第1章 SNTP 配置 舉例:設(shè)客戶端每隔128秒向服務(wù)器請(qǐng)求一次。
Switch#config
Switch(config)#sntp polltime 128
1.4 sntp timezone
命令:sntp timezone
no sntp timezone
功能:設(shè)置SNTP 客戶端所在的時(shí)區(qū)與UTC 的時(shí)差;本命令的no 操作取消設(shè)置的時(shí)區(qū),恢復(fù)缺省值。(UTC——Universal Time Coordinated,世界協(xié)調(diào)時(shí)間,相當(dāng)于0時(shí)區(qū)標(biāo)準(zhǔn)時(shí))。 參數(shù):
缺省情況:缺省時(shí)差設(shè)為add 8。
命令模式:全局配置模式。
舉例:設(shè)置時(shí)區(qū)為beijing 。
Switch#config
Switch(config)#sntp timezone beijing add 8
1.5 show sntp
命令:show sntp
功能:顯示SNTP 客戶端目前的配置及服務(wù)器狀態(tài)。
參數(shù):無。
命令模式:特權(quán)和配置模式。
舉例:顯示SNTP 當(dāng)前配置。
Switch#show sntp
server address version last receive
2.1.0.2 1 6
1-2
,網(wǎng)絡(luò)時(shí)間及域名管理命令 第2章 NTP 配置命令
第2章 NTP 配置命令
2.1 ntp enable
命令:ntp enable
ntp disable
功能:全局打開/關(guān)閉NTP 功能。
參數(shù):無。
缺省情況:默認(rèn)不啟動(dòng)NTP 功能。
命令模式:全局配置模式。
使用指南:無。
舉例:在交換機(jī)上啟動(dòng)NTP 功能。
Switch(config)#ntp enable
2.2 ntp server
命令:ntp server {
功能:?jiǎn)⒂米鳛闀r(shí)鐘源的指定時(shí)間服務(wù)器,no 命令取消作為時(shí)鐘源的指定時(shí)間服務(wù)器。 參數(shù):ip-address :時(shí)間服務(wù)器IPv4地址。
ipv6-address :時(shí)間服務(wù)器IPv6地址。
version :為該server 配置版本信息。
version_no:server 的版本號(hào),取值<1-4>,默認(rèn)為4。
key :為該server 配置密鑰。
key-id :密鑰編號(hào)。
缺省情況:沒有配置時(shí)間服務(wù)器。
命令模式:全局配置模式。
使用指南:無。
舉例:在交換機(jī)上配置時(shí)間服務(wù)器地址1.1.1.1。
Switch(config)#ntp server 1.1.1.1
2.3 ntp timezone
命令:ntp timezone
no ntp timezone
功能:設(shè)置NTP 客戶端所在的時(shí)區(qū)與UTC 的時(shí)差,no 命令操作取消設(shè)置的時(shí)區(qū),恢復(fù)缺省值。
參數(shù):name 為設(shè)置的時(shí)區(qū)名稱,不超過16個(gè)字符。
add 表示所設(shè)時(shí)區(qū)為UTC 時(shí)間加上time_difference。
subtract 表示所設(shè)時(shí)區(qū)為UTC 時(shí)間減去time_difference,缺省時(shí)為add 操作。time_difference為要設(shè)置的時(shí)差,范圍從0~12,缺省時(shí)為8。
缺省情況:缺省時(shí)差設(shè)為add 8。
2-1
,網(wǎng)絡(luò)時(shí)間及域名管理命令 第2章 NTP 配置命令 命令模式:全局配置模式。
使用指南:無。
舉例:設(shè)置時(shí)區(qū)為beijing 。
Switch#config
Switch(config)#ntp timezone beijing add 8
2.4 ntp access-group
命令:ntp access-group server
no ntp access-group server
功能:設(shè)置/取消NTP 服務(wù)的訪問控制列表。
參數(shù):
缺省情況:沒有配置NTP 服務(wù)訪問控制。
命令模式:全局配置模式。
使用指南:無。
舉例:創(chuàng)建NTP 的訪問列表2。
Switch(config)#ntp access-group server 2
2.5 ntp authenticate
命令:ntp authenticate
no ntp authenticate
功能:?jiǎn)⒂?取消NTP 身份驗(yàn)證功能。
參數(shù):無。
缺省情況:全局不啟用NTP 身份驗(yàn)證。
命令模式:全局配置模式。
使用指南:無。
舉例:?jiǎn)⒂肗TP 身份驗(yàn)證功能:
Switch(config)#ntp authenticate
2.6 ntp authentication-key
命令:ntp authentication-key
no ntp authentication-key
功能:?jiǎn)?dòng)/取消NTP 身份驗(yàn)證功能,定義NTP 身份驗(yàn)證的驗(yàn)證密鑰。
參數(shù):key-id :密鑰編號(hào),范圍為1-4294967295。
value :密鑰值,1-16個(gè)ascii 碼字符。
缺省情況:不配置NTP 身份驗(yàn)證的驗(yàn)證密鑰。
命令模式:全局配置模式。
使用指南:無。
舉例:定義NTP 身份驗(yàn)證的驗(yàn)證密鑰,key-id 為20,md5為abc 。
Switch(config)#ntp authentication-key 20 md5 abc
2-2
,網(wǎng)絡(luò)時(shí)間及域名管理命令 第2章 NTP 配置命令
2.7 ntp trusted-key
命令:ntp trusted-key
no ntp trusted-key
功能:指定密鑰是可信賴的,no 命令取消指定的可信賴密鑰。
參數(shù):key-id :密鑰編號(hào),范圍為1-4294967295。
缺省情況:不指定可信賴的密鑰。
命令模式:全局配置模式。
使用指南:無。
舉例:將指定密鑰20配置為可信賴狀態(tài)。
Switch(config)#ntp trusted-key 20
2.8 ntp disable
命令:ntp disable
no ntp disable
功能:關(guān)閉/開啟接口上的NTP 功能。
參數(shù):無。
缺省情況:所有接口NTP 功能打開。
命令模式:接口配置模式。
使用指南:無。
舉例:關(guān)閉vlan1接口上的NTP 功能。
Switch(config)#interface vlan 1
Switch(Config-if-Vlan1)#ntp disable
2.9 ntp broadcast client
命令:ntp broadcast client
no ntp broadcast client
功能:配置/取消指定接口來接收NTP 廣播包。
參數(shù):無。
缺省情況:接口不接收NTP 廣播包。
命令模式:接口配置模式。
使用指南:無。
舉例:打開vlan1接口接受NTP 廣播包的功能。
Switch(config)#interface vlan 1
Switch(Config-if-Vlan1)#ntp broadcast client
2.10 ntp multicast client
命令:ntp multicast client
no ntp multicast client
2-3
,網(wǎng)絡(luò)時(shí)間及域名管理命令 第2章 NTP 配置命令 功能:配置/取消指定接口來接收NTP 組播包。
參數(shù):無。
缺省情況:接口不接收NTP 組播包。
命令模式:接口配置模式。
使用指南:無。
舉例:打開vlan1接口接受NTP 組播包的功能。
Switch(config)#interface vlan 1
Switch(Config-if-Vlan1)#ntp multicast client
2.11 ntp ipv6 multicast client
命令:ntp ipv6 multicast client
no ntp ipv6 multicast client
功能:配置/取消指定接口來接收IPv6的NTP 組播包。
參數(shù):無。
缺省情況:接口不接收IPv6的NTP 組播包。
命令模式:接口配置模式。
使用指南:無。
舉例:打開vlan1接口接受IPv6的NTP 組播包的功能。
Switch(config)#interface vlan 1
Switch(Config-if-Vlan1)#ntp ipv6 multicast client
2.12 debug ntp authentication
命令:debug ntp authentication
no debug ntp authentication
功能:顯示NTP 認(rèn)證信息,no 命令關(guān)閉顯示NTP 認(rèn)證信息開關(guān)。
參數(shù):無。
缺省情況:顯示NTP 認(rèn)證信息開關(guān)關(guān)閉。
命令模式:特權(quán)模式。
使用指南:顯示NTP 認(rèn)證信息,如果該開關(guān)打開,則在收發(fā)報(bào)文過程中,如果報(bào)文攜帶了認(rèn)證信息,則會(huì)將報(bào)文中的key identifier字段打印出來。
舉例:打開顯示NTP 認(rèn)證信息的開關(guān)。
Switch(config)# debug ntp authentication
2.13 debug ntp packets
命令:debug ntp packets [send | receive]
no debug ntp packets [send | receive]
功能:打開/關(guān)閉顯示NTP 收發(fā)數(shù)據(jù)包信息的調(diào)試開關(guān)。
參數(shù):send :發(fā)送ntp 報(bào)文的調(diào)試開關(guān)。
receive :接收ntp 報(bào)文的調(diào)試開關(guān)。
無參數(shù)表示同時(shí)打開ntp 報(bào)文的發(fā)送與接收開關(guān)。
2-4
,網(wǎng)絡(luò)時(shí)間及域名管理命令 第2章 NTP 配置命令 缺省情況:顯示NTP 數(shù)據(jù)包信息的調(diào)試開關(guān)關(guān)閉。
命令模式:特權(quán)模式。
使用指南:無。
舉例:打開顯示NTP 收發(fā)數(shù)據(jù)包信息的調(diào)試開關(guān)。
Switch(config)#debug ntp packets
2.14 debug ntp adjust
命令:debug ntp adjust
no debug ntp adjust
功能:打開/關(guān)閉顯示本地時(shí)鐘調(diào)整信息的調(diào)試開關(guān)。
參數(shù):無。
缺省情況:顯示本地時(shí)鐘調(diào)整信息的調(diào)試開關(guān)關(guān)閉。
命令模式:特權(quán)模式。
使用指南:無。
舉例:打開顯示本地時(shí)鐘調(diào)整信息的調(diào)試開關(guān)。
Switch(config)#debug ntp adjust
2.15 debug ntp sync
命令:debug ntp sync
no debug ntp sync
功能:打開/關(guān)閉顯示本地時(shí)鐘同步信息的調(diào)試開關(guān)。
參數(shù):無。
缺省情況:顯示本地時(shí)鐘同步信息的調(diào)試開關(guān)關(guān)閉。
命令模式:特權(quán)模式。
使用指南:無。
舉例:打開顯示本地時(shí)鐘同步信息的調(diào)試開關(guān)。
Switch(config)#debug ntp sync
2.16 debug ntp events
命令:debug ntp events
no debug ntp events
功能:打開/關(guān)閉tp 事件的debug 調(diào)試開關(guān)。
參數(shù):無。
缺省情況:顯示ntp 事件的調(diào)試開關(guān)關(guān)閉。
命令模式:特權(quán)模式。
使用指南:該開關(guān)打開后,如果有某server 由可達(dá)變?yōu)椴豢蛇_(dá)或從不可達(dá)變?yōu)榭蛇_(dá)事件,收到非法報(bào)文事件會(huì)打印出提示信息。
舉例:打開顯示本地時(shí)鐘同步信息的調(diào)試開關(guān)。
Switch(config)#debug ntp events
2-5
,網(wǎng)絡(luò)時(shí)間及域名管理命令 第2章 NTP 配置命令
2.17 show ntp status
命令:show ntp status
功能:顯示時(shí)間同步的具體狀況,包括目前是否同步、層數(shù)、時(shí)鐘源的地址等信息。 參數(shù):無。
缺省情況:無。
命令模式:特權(quán)和配置模式。
使用指南:無。
舉例:
Switch#show ntp status
Clock status: synchronized
Clock stratum: 3
Reference clock server: 1.1.1.2
Clock offset: 0.010 s
Root delay: 0.012 ms
Root dispersion: 0.000 ms
Reference time: TUE JAN 03 01:27:24 2006
2.18 show ntp session
命令:show ntp session [
功能:顯示當(dāng)前所有的或某個(gè)具體的ntp 會(huì)話具體信息,包括有server ID、server 的層數(shù)、本地相對(duì)于server 的offset 等信息。(帶*表示該server 為優(yōu)選出的本地時(shí)鐘源) 參數(shù):ip-address :某個(gè)具體配置的時(shí)間服務(wù)器IPv4地址。
ipv6-address :某個(gè)具體配置的時(shí)間服務(wù)器IPv6地址。
無參數(shù)顯示所有server 的會(huì)話相關(guān)信息(包括廣播/組播server )。
缺省情況:無。
命令模式:特權(quán)和配置模式。
使用指南:無。
舉例:
Switch#show ntp session
server stream type rootdelay rootdispersion trustlevel * 1.1.1.2 2 unicast 0.010s 0.002s 10
2.2.2.2 3 unicast 0.005s 0.000s 10
2-6