Ping tag nrho IPv6 nodes ntawm ib channel

Ob peb hnub nyob twj ywm kom txog rau thaum pib ntawm qhov tshiab ntws ntawm tus nqi "Network Engineer" los ntawm OTUS. Nyob rau hauv no hais txog, peb xav qhia rau koj ib tug txhais lus ntawm cov ntaub ntawv tseem ceeb ntawm lub ncauj lus.

Ping tag nrho IPv6 nodes ntawm ib channel

Ib series ntawm cov ntawv blog ntawm cov lus qhia thiab kev ua kom yuam kev rau kev daws teeb meem IPv6 ping teeb meem (ICMPv6 Echo Thov / Echo Teb)

Thov nco ntsoov tias kuv tab tom siv Linux (tshwj xeeb yog Fedora 31), txawm li cas los xij ping hais kom ua syntax rau lwm qhov kev khiav hauj lwm yuav tsum cia siab tias yuav zoo sib xws.

Ping tag nrho IPv6 nodes ntawm ib channel

Thawj qhov lus qhia yooj yim tshaj plaws yog ping tag nrho IPv6 ntawm qhov txuas.

IPv6 siv ntau qhov chaw nyob rau txhua hom kev sib txuas lus ib-rau-ntau. Tsis muaj kev tshaj tawm (lossis tshaj tawm) IPv6 chaw nyob. Qhov no txawv IPv6 los ntawm IPv4, qhov twg muaj ntau hom chaw nyob tshaj tawm, piv txwv li, qhov "tso tawm tshaj tawm" chaw nyob 255.255.255.255 [RFC1122].

Txawm li cas los xij, muaj "tag nrho cov nodes multicast" IPv6 chaw nyob, yog li peb yuav siv qhov ntawd los ping tag nrho IPv6 nodes ntawm qhov txuas. (Ib qhov chaw nyob "tshaj tawm" tsuas yog qhov tshwj xeeb uas muaj npe multicast chaw nyob, uas yog ib pawg multicast uas suav nrog tag nrho cov nodes. Nco ntsoov tias, piv txwv li, "pab pawg" lossis multicast chaw nyob me ntsis tau qhib rau hauv Ethernet tshaj tawm chaw nyob ntawm txheej txuas ).

All-nodes multicast IPv6 chaw nyob rau channel: ff02::1. ff qhia txog qhov chaw nyob multicast IPv6. Tom ntej no 0 yog ib feem ntawm tus chij nrog unset me ntsis.

ntxiv 2 txhais cov cheeb tsam ntawm ib pawg multicast. Tsis zoo li multicast IPv4 chaw nyob, multicast IPv6 chaw nyob muaj peev xwm. Tus nqi ntsuas qhia txog ib feem ntawm lub network uas ib pob ntawv multicast raug tso cai xa mus. Thaum ib pob ntawv mus txog ntawm tus ciam teb ntawm qhov tau teev tseg, pob ntawv yuav tsum tau muab tso tseg, tsis hais seb nws qhov Hop Count tsis yog xoom. Tau kawg, yog tias qhov suav suav nce mus txog xoom ua ntej mus txog qhov teev tseg ntawm pawg multicast, nws kuj tseem rov pib dua tam sim ntawd. Nov yog daim ntawv teev tag nrho ntawm IPv6 multicast Scope.

Thaum kawg ::1 qhia tag nrho cov nodes multicast pawg.

Hais txog qhov chaw nyob ff02::1 Nws yuav tsum tau muab sau tseg tias nws yog ambiguous. Ntawm tus tswv tsev IPv6 nrog ntau qhov sib cuam tshuam, xws li router lossis multihomed host, qhov chaw nyob ff02::1 tsis muaj ib yam dab tsi uas koj tuaj yeem hais qhia qhov twg los xa ICMPv6 ncha thov rau lossis xav tias yuav tau txais ICMPv6 ncha teb thaum lawv tuaj txog. ff02::1 yog siv tau thiab tuaj yeem siv rau ntawm ib qho ntawm cov interfaces thiab cov channel txuas nrog ntau qhov sib txuas.

Yog li thaum peb ping tag nrho IPv6 nodes ntawm qhov txuas, peb yuav tsum tau qhia qee qhov kev siv hluav taws xob ping rau IPv6, uas interface siv.

Defining Interfaces - Command Line Options

Raws li peb tau pom lawm, tag nrho cov nodes multicast chaw nyob peb xav siv yog βˆ’ ff02::1 - tsis muab cov ntaub ntawv hais txog lub interface twg xa thiab tau txais ICMPv6 ncha thov thiab ncha teb pob ntawv.

Yog li, yuav ua li cas peb qhia meej lub interface siv rau qhov chaw nyob multicast lossis unicast Link-Local chaw nyob?

Thawj thiab qhov pom tseeb tshaj plaws yog muab nws ua ib qho parameter rau daim ntawv thov uas peb siv.

Rau kev siv hluav taws xob ping peb muab nws los ntawm kev xaiv -I.

[mark@opy ~]$ ping -w 1 -I enp3s2 ff02::1
ping: Warning: source address might be selected on device other than: enp3s2
PING ff02::1(ff02::1) from :: enp3s2: 56 data bytes
64 bytes from fe80::1d36:1fff:fefd:82be%enp3s2: icmp_seq=1 ttl=64 time=0.438 ms
64 bytes from fe80::f31c:ccff:fe26:a6d9%enp3s2: icmp_seq=1 ttl=64 time=0.589 ms (DUP!)
64 bytes from fe80::7e31:f5ff:fe1b:9fdb%enp3s2: icmp_seq=1 ttl=64 time=5.15 ms (DUP!)
64 bytes from fe80::f7f8:15ff:fe6f:be6e%enp3s2: icmp_seq=1 ttl=64 time=58.0 ms (DUP!)
64 bytes from fe80::877d:4ff:fe1a:b881%enp3s2: icmp_seq=1 ttl=64 time=62.3 ms (DUP!)
64 bytes from fe80::877d:4ff:fe1a:ad79%enp3s2: icmp_seq=1 ttl=64 time=62.8 ms (DUP!)
 
--- ff02::1 ping statistics ---
1 packets transmitted, 1 received, +5 duplicates, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.438/31.544/62.786/29.566 ms
[mark@opy ~]$

Siv tag nrho cov nodes multicast ping, peb tau txais cov lus teb los ntawm 6 IPv6 nodes. Cov lus teb tau los ntawm Link-Local IPv6 ntawm qhov chaw nyob, pib nrog lub npe ua ntej fe80::/10.

uas ping tsis txuas ntxiv xa ICMPv6 ncha thov tsis tu ncua kom txog thaum peb cuam tshuam nws, peb feem ntau qhia cov pob ntawv xa tawm ntawm qhov kev xaiv -c. Txawm li cas los xij, qhov no tseem tiv thaiv ping los ntawm kev lees txais thiab nthuav tawm ntau dua ib qho ICMPv6 ncha teb thaum xa cov lus thov multicast ICMPv6 ncha. Hloov chaw, peb siv qhov kev xaiv -w los qhia tias ping yuav tsum ua tiav tom qab 1 thib ob, txawm tias muaj pes tsawg ICMPv6 ncha thov lossis ncha lus teb raug xa lossis tau txais.

Lwm yam uas yuav tsum tau saib xyuas yog (DUP!) tso tawm ntawm cov lus teb thib ob thiab tom qab. Cov pob ntawv no raug txheeb xyuas tias yog cov lus teb sib npaug vim tias lawv muaj qhov sib npaug ICMP tus nqi raws li tus neeg ICMPv6 ncha thov uas tau xa hauv thawj qhov chaw. Lawv tshwm sim vim hais tias ICMPv6 multicast echo thov ua rau ntau tus neeg unicast teb. Tus naj npawb ntawm cov duplicates kuj tau qhia hauv cov ntsiab lus txheeb cais.

Txhais Interfaces - Zone ID

Lwm txoj hauv kev los nthuav tawm qhov interface rau kev siv yog ib feem ntawm qhov chaw nyob IPv6.

Peb tuaj yeem pom qhov piv txwv ntawm qhov no hauv ping cov zis, qhov chaw nyob ntawm IPv6 cov tswv tsev kuj muaj cov lus xaus. %enp3s2, piv txwv:

64 bytes from fe80::1d36:1fff:fefd:82be%enp3s2: icmp_seq=1 ttl=64 time=0.438 ms

Cov qauv no ntawm kev qhia cov interfaces tau piav qhia hauv [RFC4007], "IPv6 Defined Address Architecture." Txawm hais tias lawv feem ntau hu ua lub operating system interface, lawv txhais tau qee yam dav dav - "zone" lossis "scope."

Yog vim li cas thiaj muaj ntau thaj chaw dav dav lossis thaj tsam thaj tsam yog tias, raws li tau hais hauv [RFC4007], IPv6 node tuaj yeem muaj ntau qhov sib txawv IPv6 txuas nrog tib lub channel. Cov interfaces no yog cov tswv cuab ntawm tib cheeb tsam.

Nws yuav tsum muaj peev xwm los pab pawg ntau qhov sib cuam tshuam hauv ib cheeb tsam hauv qab kev ua haujlwm; Tam sim no kuv tsis paub tias qhov no puas ua tau hauv Linux lossis yuav ua li cas.

Siv lub ntsiab lus %<zone_id>, peb tuaj yeem tshem tawm qhov kev xaiv kab hais kom ua -I ping.

[mark@opy ~]$ ping -w 1 ff02::1%enp3s2
PING ff02::1%enp3s2(ff02::1%enp3s2) 56 data bytes
64 bytes from fe80::2392:6213:a15b:66ff%enp3s2: icmp_seq=1 ttl=64 time=0.106 ms
64 bytes from fe80::1d36:1fff:fefd:82be%enp3s2: icmp_seq=1 ttl=64 time=0.453 ms (DUP!)
64 bytes from fe80::f31c:ccff:fe26:a6d9%enp3s2: icmp_seq=1 ttl=64 time=0.606 ms (DUP!)
64 bytes from fe80::7e31:f5ff:fe1b:9fdb%enp3s2: icmp_seq=1 ttl=64 time=6.23 ms (DUP!)
64 bytes from fe80::f7f8:15ff:fe6f:be6e%enp3s2: icmp_seq=1 ttl=64 time=157 ms (DUP!)
64 bytes from fe80::877d:4ff:fe1a:ad79%enp3s2: icmp_seq=1 ttl=64 time=159 ms (DUP!)
64 bytes from fe80::877d:4ff:fe1a:b881%enp3s2: icmp_seq=1 ttl=64 time=161 ms (DUP!)
64 bytes from fe80::23d:e8ff:feec:958c%enp3s2: icmp_seq=1 ttl=64 time=179 ms (DUP!)
 
--- ff02::1%enp3s2 ping statistics ---
1 packets transmitted, 1 received, +7 duplicates, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.106/82.858/179.216/81.281 ms
 
[mark@opy ~]$

Link-Local Address Teb

Los ntawm tag nrho cov nodes multicast ping peb tau txais tag nrho ntawm 6 cov lus teb tshwj xeeb.

Cov lus teb no los ntawm unicast Link-Local IPv6 tus tswv chaw nyob. Piv txwv li, ntawm no yog thawj lo lus teb:

64 bytes from fe80::2392:6213:a15b:66ff%enp3s2: icmp_seq=1 ttl=64 time=0.106 ms

Unicast Link-Local IPv6 chaw nyob yog xav tau ntawm txhua qhov IPv6-enabled interfaces [RFC4291], "IP Version 6 Chaw Nyob Architecture". Yog vim li cas rau qhov no yog tias IPv6 node ib txwm cia li muaj qhov chaw nyob unicast IPv6, uas nws tuaj yeem siv tsawg kawg yog siv los sib txuas lus nrog lwm cov ntawm nws cov kev sib txuas ncaj qha. Qhov no suav nrog kev sib txuas lus nrog cov ntawv thov ntawm lwm tus tswv ntawm Link-Local host chaw nyob.

Qhov no ua kom yooj yim rau kev tsim thiab siv cov txheej txheem xws li IPv6 Neighbor Discovery thiab OSPFv3. Nws tseem tso cai rau cov neeg siv kawg daim ntawv thov ntawm cov tswv los sib txuas lus hauv cov channel yam tsis tas yuav muaj lwm yam kev txhawb nqa IPv6 hauv cov channel. Kev sib txuas lus ncaj qha ntawm kev sib txuas IPv6 tus tswv tsis tas yuav muaj IPv6 router lossis DHCPv6 server ntawm kev sib txuas.

Txuas-Local chaw nyob pib nrog 10-ntsis prefix fe80, ua raws li 54 xoom cov khoom thiab tom qab ntawd 64-ntsis interface ID (IID). Hauv cov lus teb thawj zaug saum toj no 2392:6213:a15b:66ff yog 64-ntsis IID.

Looped Multicast

Los ntawm lub neej ntawd, cov pob ntawv multicast raug xa rov qab los rau hauv cov node uas xa lawv. Qhov no tshwm sim rau IPv6 thiab IPv4 chaw nyob.

Yog vim li cas rau qhov kev coj cwj pwm no yog tias thaum cov pob ntawv multicast raug xa mus, kuj tseem yuav muaj kev mloog hauv zos multicast daim ntawv thov khiav ntawm tus tswv tsev xa nws tus kheej, nrog rau qhov chaw ntawm lub network. Daim ntawv thov hauv zos no yuav tsum tau txais cov pob ntawv multicast.

Peb tuaj yeem pom lub voj voog hauv zos multicast hauv peb cov zis ping:

[mark@opy ~]$ ping -w 1 ff02::1%enp3s2
PING ff02::1%enp3s2(ff02::1%enp3s2) 56 data bytes
64 bytes from fe80::2392:6213:a15b:66ff%enp3s2: icmp_seq=1 ttl=64 time=0.106 ms
64 bytes from fe80::1d36:1fff:fefd:82be%enp3s2: icmp_seq=1 ttl=64 time=0.453 ms (DUP!)
...

Cov lus teb thawj zaug thiab ceev tshaj plaws (0,106 ms piv rau 0,453 ms) yog los ntawm Link-Local chaw nyob configured ntawm lub interface nws tus kheej enp3s2.

[mark@opy ~]$ ip addr show dev enp3s2 | grep fe80
    inet6 fe80::2392:6213:a15b:66ff/64 scope link noprefixroute 
[mark@opy ~]$

Π’ΠΈΠ»ΠΈΡ‚Π° ping muab ib txoj hauv kev los txwv cov lus tawm tswv yim hauv zos multicast siv qhov parameter -L. Yog tias peb xa tag nrho cov nodes multicast ping nrog tus chij no, ces cov lus teb raug txwv rau cov chaw taws teeb. Peb tsis tau txais cov lus teb los ntawm Link-Local chaw nyob ntawm tus xa interface.

[mark@opy ~]$ ping -L -w 1 ff02::1%enp3s2
PING ff02::1%enp3s2(ff02::1%enp3s2) 56 data bytes
64 bytes from fe80::1d36:1fff:fefd:82be%enp3s2: icmp_seq=1 ttl=64 time=0.383 ms
 
64 bytes from fe80::f31c:ccff:fe26:a6d9%enp3s2: icmp_seq=1 ttl=64 time=0.467 ms (DUP!)
...

Ping Link-Local Addresses

Raws li koj tuaj yeem kwv yees, unicast Link-Local chaw nyob los ntawm lawv tus kheej kuj tsis muab cov ntaub ntawv txaus los qhia qhov twg interface siv kom ncav cuag lawv. Raws li nrog tag nrho cov nodes multicast ping, peb kuj yuav tsum tau hais kom meej lub interface raws li ib tug hais kom ua kab parameter ping lossis cheeb tsam ID nrog chaw nyob thaum pinging Link-Local chaw nyob.

Lub sijhawm no peb tuaj yeem siv tau -ckom txwv cov pob ntawv thiab cov lus teb xa thiab tau txais ping, vim peb tab tom ua unicast ping.

[mark@opy ~]$ ping -c 1 fe80::f31c:ccff:fe26:a6d9%enp3s2
 
PING fe80::f31c:ccff:fe26:a6d9%enp3s2(fe80::fad1:11ff:feb7:3704%enp3s2) 56 data bytes
64 bytes from fe80::f31c:ccff:fe26:a6d9%enp3s2: icmp_seq=1 ttl=64 time=0.395 ms
 
--- fe80::f31c:ccff:fe26:a6d9%enp3s2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.395/0.395/0.395/0.000 ms
[mark@opy ~]$

Ping (tag nrho) lwm qhov chaw nyob IPv6?

Hauv tsab xov xwm no, peb pom yuav ua li cas ping tag nrho IPv6 nodes ntawm ib channel siv tag nrho cov nodes multicast IPv6 chaw nyob ff02::1. Peb kuj tau pom yuav ua li cas qhia meej qhov interface siv nrog txhua qhov chaw nyob multicast IPv6, vim qhov chaw nyob nws tus kheej tsis tuaj yeem muab cov ntaub ntawv no. Peb siv ob qho kev xaiv kab hais kom ua ping, los yog teev lub interface siv cov lus tom qab %<zone_id>.

Tom qab ntawd peb tau kawm txog unicast Link-Local chaw nyob, uas yog qhov chaw nyob siv los teb rau tag nrho cov nodes multicast ICMPv6 ncha thov.

Peb kuj tau pom yuav ua li cas cov pob ntawv multicast raug xa rov qab mus rau qhov xa ntawm lub neej ntawd thiab yuav ua li cas lov tes taw qhov no rau kev siv hluav taws xob ping.

Thaum kawg, peb pinged ib qhov chaw nyob Link-Local siv lub ntsiab lus %<zone_id>, txij li Link-Local chaw nyob lawv tus kheej kuj tsis muab cov ntaub ntawv hais txog kev tawm mus.

Yog li dab tsi txog ping tag nrho lwm cov nodes thiab tau txais lawv qhov chaw nyob thoob ntiaj teb unicast (GUAs) (uas yog, lawv cov chaw nyob hauv Is Taws Nem) lossis lawv qhov chaw nyob hauv zos unicast (ULAs)? Peb mam li saib qhov no hauv tsab ntawv blog tom ntej.

Yog tag nrho.

Koj tuaj yeem paub ntau ntxiv txog peb chav kawm ntawm qhib hnub sau ntawv.

Tau qhov twg los: www.hab.com

Ntxiv ib saib