Yuav ua li cas Siv Ping Command hauv Windows

Cov txheej txheem:

Yuav ua li cas Siv Ping Command hauv Windows
Yuav ua li cas Siv Ping Command hauv Windows
Anonim

Cov lus txib ping yog Command Prompt hais kom siv los ntsuas lub peev xwm ntawm lub khoos phis tawj kom ncav cuag lub khoos phis tawj uas tau teev tseg. Nws yog ib txoj hauv kev yooj yim los xyuas kom meej tias lub khoos phis tawj tuaj yeem sib txuas lus nrog lwm lub khoos phis tawj lossis lub network.

Cov lus txib ping ua haujlwm los ntawm kev xa Is Taws Nem Tswj Message Protocol (ICMP) Echo Thov cov lus mus rau lub khoos phis tawj qhov chaw thiab tos kom teb. Ob daim ntaub ntawv loj uas cov lus txib ping muab yog pes tsawg ntawm cov lus teb tau xa rov qab thiab yuav siv sijhawm ntev npaum li cas rau lawv rov qab los.

Piv txwv li, koj yuav pom tsis muaj lus teb thaum pinging lub tshuab luam ntawv network, tsuas yog kom paub tias lub tshuab luam ntawv offline thiab nws cov cable xav tau hloov. Los yog tej zaum koj yuav tsum tau ping lub router kom paub tseeb tias koj lub khoos phis tawj tuaj yeem txuas rau nws kom tshem tawm nws ua qhov ua rau muaj teeb meem kev sib tham.

Lo lus "ping" kuj tseem siv online los xa mus rau cov lus luv luv, feem ntau dhau ntawm ntawv lossis email. Piv txwv li, koj tuaj yeem "ping koj tus thawj coj" lossis xa lawv cov lus hais txog qhov project, tab sis cov lus txib ping tsis muaj dab tsi ua nrog nws.

Ping Command Availability

Cov lus txib ping yog muaj los ntawm Command Prompt hauv Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, thiab Windows XP operating systems. Nws tseem muaj nyob rau hauv cov laus versions ntawm Windows zoo li Windows 98 thiab 95.

Cov lus txib no tseem tuaj yeem pom hauv Command Prompt hauv Advanced Startup Options thiab System Recovery Options kho / rov qab cov ntawv qhia zaub mov.

Image
Image

Ping Command Syntax

ping [- t] [- a] [- n suav] [- l size] [- f] [- i TTL] [- v TOS] [- r suav] [- s suav] [-w timeout] [-R ] [-S srcaddr] [-p] [- 4] [- 6] phiaj [ /?]

Qhov muaj ntawm qee qhov ping hais kom hloov pauv thiab lwm yam ping hais kom ua syntax yuav txawv ntawm kev khiav haujlwm mus rau kev ua haujlwm.

Ping Command Options
piav qhia
- t Siv qhov kev xaiv no yuav ping lub hom phiaj kom txog thaum koj yuam kom nws nres los ntawm kev siv Ctrl + C.
- a qhov kev xaiv ping no yuav daws tau, yog tias ua tau, lub npe hostname ntawm lub hom phiaj IP chaw nyob.
- n suav Qhov kev xaiv no teev tus naj npawb ntawm ICMP Echo Thov xa, los ntawm 1 txog 4294967295. Cov lus txib ping yuav xa 4 los ntawm lub neej ntawd yog - ntsis siv.
- lsize Siv qhov kev xaiv no los teeb tsa qhov loj me, hauv bytes, ntawm pob ntawv thov ncha los ntawm 32 txog 65, 527. Cov lus txib ping yuav xa daim ntawv thov 32-byte ncha yog tias koj tsis siv - l xaiv.
- f Siv qhov kev xaiv ping no los tiv thaiv ICMP Echo Thov los ntawm kev tawg ntawm routers ntawm koj thiab lub hom phiaj. Qhov kev xaiv - f feem ntau yog siv los daws teeb meem Path Maximum Transmission Unit (PMTU) teeb meem.
- i TTL qhov kev xaiv no teev lub Sijhawm Ua Neej Nyob (TTL) tus nqi, qhov siab tshaj plaws yog 255.
- v TOS qhov kev xaiv no tso cai rau koj los teeb tsa Hom Kev Pabcuam (TOS) tus nqi. Pib hauv Windows 7, qhov kev xaiv no tsis ua haujlwm ntxiv lawm tab sis tseem muaj nyob rau vim li cas kev sib raug zoo.
- r suav Siv qhov kev xaiv ping no los qhia cov naj npawb ntawm hops ntawm koj lub computer thiab lub hom phiaj lub computer lossis ntaus ntawv uas koj xav kom kaw thiab tso tawm. Tus nqi siab tshaj plaws rau suav yog 9, yog li siv cov lus txib tracert hloov yog tias koj txaus siab saib tag nrho cov hops ntawm ob lub cuab yeej.
- s suav Siv qhov kev xaiv no los qhia lub sijhawm, hauv Internet Timestamp hom, tias txhua qhov kev thov ncha tau txais thiab ncha teb raug xa mus. Tus nqi siab tshaj plaws rau suav yog 4, txhais tau tias tsuas yog thawj plaub lub hops tuaj yeem ua lub sijhawm stamped.
- w sijhawm Qhia txog tus nqi ncua sij hawm thaum ua tiav ping hais kom kho lub sijhawm, hauv milliseconds, ping tos rau txhua qhov lus teb. Yog tias koj tsis siv qhov kev xaiv - w, lub sijhawm siv sijhawm ntawm 4000 yog siv, uas yog 4 vib nas this.
- R qhov kev xaiv no qhia cov lus txib ping kom taug qab txoj kev ncig mus ncig.
- S srcaddr Siv qhov kev xaiv no los qhia qhov chaw nyob.
- p Siv qhov hloov pauv no rau ping Hyper-V Network Virtualization chaw nyob.
- 4 Qhov no yuam cov lus txib ping siv IPv4 nkaus xwb tab sis tsuas yog tsim nyog yog lub hom phiaj yog lub npe hostname thiab tsis yog tus IP chaw nyob.
- 6 Qhov no yuam cov lus txib ping kom siv IPv6 nkaus xwb tab sis ib yam li kev xaiv - 4, tsuas yog tsim nyog thaum pinging lub hostname.
target Nov yog qhov chaw koj xav ping, txawm tias tus IP chaw nyob lossis lub npe host.
/? Siv cov kev pab hloov nrog cov lus txib ping los qhia cov ncauj lus kom ntxaws txog cov lus txib ob peb xaiv.

The - f, - v, - r, - s, - j, thiab - k kev xaiv ua haujlwm thaum pinging IPv4 chaw nyob nkaus xwb. Lub - R thiab - S kev xaiv tsuas yog ua haujlwm nrog IPv6.

Lwm yam tsis tshua siv hloov pauv rau cov lus txib ping muaj xws li [- j tus tswv tsev teev npe], [- k tus tswv tsev], and [- c compartment]. Ua ping /? los ntawm Command Prompt kom paub ntau ntxiv ntawm cov kev xaiv no.

Koj tuaj yeem txuag cov lus txib ping rau cov ntaub ntawv siv tus neeg teb xov tooj rov qab.

Ping Command Piv txwv

Hauv qab no yog ob peb yam piv txwv ntawm cov lus txib uas siv ping.

Ping Google.com


ping -n 5 -l 1500 www.google.com

Hauv qhov piv txwv no, cov lus txib ping yog siv los ping lub hostname www.google.com. Qhov - n kev xaiv qhia ping hais kom xa 5 ICMP Echo Thov es tsis yog lub neej ntawd ntawm 4, thiab - l kev xaiv teeb tsa pob ntawv loj rau txhua qhov kev thov rau 1500 bytes es tsis yog lub neej ntawd ntawm 32 bytes.

Cov txiaj ntsig tau tshwm sim nyob rau hauv Command Prompt window yuav zoo li no:


Reply from 172.217.1.142: bytes=1500 time=30ms TTL=54

Reply from 172.217.1.142: bytes=1500 time=30ms TTL=54

Reply from 172.217.1.142: bytes=1500 time=29ms TTL=54

Reply from 172.217.1.142: bytes=1500 time=30ms TTL=54

Reply from 172.217.1.142: bytes=1500 time=31ms TTL=54

Ping txheeb cais rau 172.217.1.142:

Packets: Xa=5, Tau txais=5, Poob=0 (0% poob), kwv yees ncig ncig lub sijhawm hauv milli-seconds: Yam tsawg kawg nkaus=29ms, Qhov siab tshaj=31ms, Qhov nruab nrab=30ms

Qhov 0% poob tshaj tawm raws li Ping cov txheeb cais rau 74.217.1.142 piav qhia tias txhua ICMP Echo Thov cov lus xa mus rau www.google.com raug xa rov qab. Qhov no txhais tau hais tias, raws li qhov kev sib txuas hauv network no mus, nws tuaj yeem sib txuas lus nrog Google lub vev xaib zoo.

Ping localhost


ping 127.0.0.1

Hauv qhov piv txwv saum toj no, peb tab tom pinging 127.0.0.1, tseem hu ua IPv4 localhost IP chaw nyob lossis IPv4 loopback IP chaw nyob, tsis muaj kev xaiv.

Siv cov lus txib ping nrog qhov chaw nyob no yog ib txoj hauv kev zoo los sim tias Windows 'network nta ua haujlwm zoo tab sis nws tsis hais dab tsi txog koj tus kheej lub network hardware lossis koj qhov kev txuas rau lwm lub computer lossis ntaus ntawv. IPv6 version ntawm qhov kev xeem no yuav yog ping::1

Nrhiav hostname Nrog Ping


ping -a 192.168.1.22

Hauv qhov piv txwv no, peb tab tom nug cov lus txib ping kom pom lub npe hostname muab rau 192.168.1.22 IP chaw nyob, tab sis rau lwm yam ping nws li qub.

Cov lus txib tuaj yeem daws qhov chaw nyob IP, 192.168.1.22, raws li lub npe hostname J3RTY22, piv txwv li, thiab tom qab ntawd ua tiav qhov seem ntawm ping nrog qhov teeb tsa tsis raug.

Ping Router Command


ping 192.168.2.1

Zoo ib yam li cov piv txwv ping hais saum toj no, qhov no yog siv los saib seb koj lub computer puas tuaj yeem ncav cuag koj lub router. Qhov txawv ntawm no yog tias tsis yog siv ping hais kom hloov lossis pinging lub localhost, peb tab tom kuaj xyuas kev sib txuas ntawm lub computer thiab router (192.168.2.1 hauv qhov no).

Yog tias koj muaj teeb meem nkag mus rau hauv koj lub router lossis nkag mus hauv is taws nem txhua, saib seb koj lub router puas nkag tau nrog cov lus txib ping no, tau kawg, hloov 192.168.2.1 nrog koj tus router tus IP chaw nyob.

Ping Nrog IPv6


ping -t -6 SERVER

Hauv qhov piv txwv no, peb yuam cov lus txib ping siv IPv6 nrog qhov kev xaiv - 6 thiab txuas ntxiv mus rau ping SERVER tsis tas li nrog - tkev xaiv. Koj tuaj yeem cuam tshuam tus ping manually nrog Ctrl+C.

Tus lej tom qab % hauv cov lus teb tau tsim hauv qhov piv txwv ping no yog IPv6 Zone ID, uas feem ntau qhia txog kev siv network siv. Koj tuaj yeem tsim ib lub rooj ntawm Zone IDs txuam nrog koj lub network interface npe los ntawm kev ua tiav netsh interface ipv6 qhia interface IPv6 Zone ID yog tus lej hauv kab Idx.

kab hauv qab

Cov lus txib ping feem ntau yog siv nrog lwm yam kev sib tham txog kev hais kom ua raws li cov lus txib xws li tracert, ipconfig, netstat, thiab nslookup.

Lwm Ping Siv

Muab cov txiaj ntsig koj pom saum toj no, nws yog qhov tseeb tias koj tuaj yeem siv ping hais kom pom lub vev xaib tus IP chaw nyob. Ua raws li qhov txuas no kom paub ntau ntxiv txog yuav ua li cas.

Koj tseem tuaj yeem siv ping ntawm lub khoos phis tawj Linux, thiab cov cuab yeej ping thib peb muaj ib yam nkaus uas muaj cov yam ntxwv ntau dua li cov lus txib ping yooj yim.

Pom zoo: