彻底搞懂交换机TAG和UNTAG_第1页
彻底搞懂交换机TAG和UNTAG_第2页
彻底搞懂交换机TAG和UNTAG_第3页
彻底搞懂交换机TAG和UNTAG_第4页
彻底搞懂交换机TAG和UNTAG_第5页
已阅读5页,还剩14页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

实验环境:1、SW1上创建VLAN1020G1\G3II加入VLAN1,属于ACCESS,状态为UNTAGE,PVID为1G4II加入VLAN10,属于ACCESS,状态为UNTAGE,PVID为10G6II加入VLAN20,属于ACCESS,状态为UNTAGE,PVID为20G2II为TRUNKII,允许VLAN10,20及VLAN1数据通过,PVID为1SW2上创建VLAN102030G1II加入VLAN1,属于ACCESS,状态为UNTAGE,PVID为1G4II加入VLAN10,属于ACCESS,状态为UNTAGE,PVID为10G6II加入VLAN20,属于ACCESS,状态为UNTAGE,PVID为20G3口为TRUNK口,允许VLAN10,20,30及VLAN1数据通过,PVID为1SW1VLAN配置如图:

[SWL]dispvlanThetotalnumberofvlansis:3u:up;D:Down;TG:Tagged;UT:untagged;MP:Vlan-mapping;ST:~Vlan-stackmq;#:ProtccolTransparent-vlan;*:Management-vlan.;VIDType此比$PVID为]1commonroT:GE0/0/l(U)GE0/0/2(U)GE0/0/3(U)GE0/0/8(D)GE0/0/12(D)GE0/0/16(D)GE0/0/20(D)GE0/0/24(D)LrKU/U/4(D)GE0/0/13(D)GE0/0/17(D)GE0/0/21(D)l^KU/U/±U(D;GEO/O/14(D)GEO/O/18(D)GE0/0/22(D)Git0/0/ll(!)]GE0/0/15(D)GE0/0/19(D)GE0/0/23(D)10coiranonUT:GE0/0/4(U)GE0/0/5(D)PVID为10TG:GE0/0/2(U)VLAN10关联端口20coiranonUTrGE0/0/6(U)GE0/0/7(D)PVID为20TG:GE0/0/2(U)VLW20关联姿口VIDStarusPropertyMAC-LRNStatisticsDescription.1©nabledefaultenabledisableVLAN000110onablGdefaultenabledisableVLAN0010乙wdefaultenabledisableVLAN0020SW2VLAN配置如图[SW2]dispvlanThetoralnumberofvlansis:4u:up;D:Down;TG:Tagged;UT:untagged;MP:vlan-mapping;ST:vlan-stacking;#:ProrocolTransparent-vlan;*:Kanagemenr-vlan;vidTypePorts1commonUT:GE0/0/l(U)GE0/0/2(U)GE0/0/3(U)GEO/O/B(D)GE0/0/9(D)GEU/0/10(0)GECMU/11(D)GE0/0/12(D)GEO/O/13(D)GEO/O/14(D)GE0/0/15(D)GE0/0/16(D)GE0/0/17(D)GE0/0/18(D)GE0/0/19(D)GE0/0/20(D)GEO/O/21(D)GE0/0/22(D)GE0/0/23(D)GE0/0/24(D)10commonUT:GE0/0/4(U)GE0/0/5(D)TG:GE0/0/2(U)GE0/0/3(U)1同SW120common|UT:GEO/O/6(U)GE0/0/7(D)|阿GEO/572(U)GE0/0/3(U)30commonTQ:GE0/0/3(U)VIDStatusPropertyMAC-LRNStatisticsDescription1enabledefaultenabledisableVIAN000110enabledefaultenabledisableVIAN001020enabledefaultenabledisableVIAN002030enabledefaultenabledisableVIAN0030实验1:在SW1上为G2配置一个没有的PVID看效果?失败[SWl-GigabitEthernetO/O/2]porttrunkpvidvlan100Error:TheVLANdoesnotexist.abitEthernetO/O/2]

实验2:SW1不变,在SW2上将G2IIPVID由1改为20,在SW2的G2II抓包看效果?VIDTypePorts1commonVT:GE0/0/l(U)GE0/0/3(U)GEO/0/8(D)GE0/0/9(D)GE0/0/10(D)GE0/0/11(D)GEO/O/12(D)GE0/0/13(D)GE0/0/14{D)GE0/0/15(D)GE0/0/16(D)GE0/0/17(D)GE0/0/18(D)GE0/0/19(D)GE0/0/20(D)GE0/0/21(D)GE0/0/22(D)GE0/0/23(D)GEO/Q/24(D)TG:GE0/0/2(U)10commonUT:GE0/0/4(U)GE0/0/5(D)TG:GE0/0/2(U)GE0/0/3(U)20commonUT:GE0/0/2(U)GE0/0/6(U)GE0/0/7(D)TG:GE0/0/3(U)30commonTG:GE0/0/3<U}vidstawsPropertymac-lrnstatisticsDescription1enabledefaultenabledisableVLAN000110enabledefaultenabledisableVLAN001020enabledefaultenabledisableVLAN002030gMgiIdIqdofault;disableVLAN0030无法PING通,IflStandardnput•Wirwhartc£ik£d't豚wfio£ap<ureAnayzeQahstxsTelephonyTods成Ip由供巍I白GJ沼费妈、但喜右与,(§回QQ9E3#凶阿弟»Alterip.src--ldll■Expression...ClearNo.TimsSourceOeslinaticnProtocolIn^o10.00000062.012000IfICMPEcho(ping)request(id=0x7628.sea(be/le)=4984/30739.icmpEcho(ping)request(16-0x7828,seq(be/le)-4^85/30995,KMPEchoAlterip.src--ldllNo.TimsSourceOeslinaticnProtocolIn^o10.00000062.012000IfICMPEcho(ping)request(id=0x7628.sea(be/le)=4984/30739.icmpEcho(ping)request(16-0x7828,seq(be/le)-4^85/30995,KMPEcho〈Dino)reGuesl1ihOx7a28.sen(be〈1e)7986/31251,162126313641464954回-LOjCCOOOO111.11113KMPEcho(ping)request何•枷28.5eq(bcn«)-4S»a4730739.td-1231SS2Ii*Frane1:74bytesonvrire(592bits),74bytescaptured(392bits)i-EthernetII.Src:MuaweiTe_4d:3d:21(w:89:98:4d:3d:21),Dst:HuaweiTe_60:78:5f(54:89:98*1oesrlnarlcn:Huaw*elTe_6O:78:5f(S4:89:98:60:78:$f)aSource:Huaweire_4d:3d:21(54;89:96;4d:3d;21)Type:IP(0x0800)没有YIANIDGInternetProtocol,Src:(),Ost:(),InternetCortrolMessageProtocolrtl=128)ttl-128)ttl-12S)ttl-128)2)-4^89/32019,tt1-128)2)=4990/32275.18)-4991/32531,le)-4992/32787,le)=4993/33043.18)-4994/33299,1e)-4995/33555,le)=4987/31507.le)-4988/31763,ttl-128)tt1-123)tt1=128)tti-ize)FileEditVie^zGoCaptureAnalyzeStatirticsTelephonyToolsHelp&眼割•醐IBEX修昌中畛⑤苔殳5!(E副凶明MlFilter:ip.src==|▼Expression...ClearApplyNo.limeSourceDestinationProtocolInfoSW2上G2IIM包情况如上2图数据转发过程说明:当数据包从SW1的G1II发出时,交换机发现是未打VLAN标签的数据,此时会为数据包打上VLAN1标签。交换机检查与VLAN1关联的端II有G2/G3II,将会在2个II进行防洪,如下图:

PC-FiFC-FCOKJ3vlan1TRUfiK1020PC-PC2同在心1PC-FiFC-FCOKJ3vlan1TRUfiK1020PC-PC2同在心1的眼1G3口收到了PTNG包.但没有回包OOH-vlan102030fileEdit也e如Jpture^nilyzefileEdit也e如Jpture^nilyze5Utisbolelephonylodstldp急■参暮*1®回英3昌I<令少。石业回目IQQ曲EJ事区胞参目Filter▼Expression...G«rAppiyNo.TimeScarceDwiinstionProetxolWoFilter▼Expression...G«rAppiyNo.TimeScarceDwiinstionProetxolWo1506.097001.1ISOfi.lOOOOl.l1510.090001.11512.103001.1klStandydinput-Wir«hartc£d«t虫efio顼pu任£nayzeJabstcsTe邮ho理Joels出IpSt*由依白曰沼65(^义令睹■谷殳国亘)#网胞必aFilterip.src«-ldll■Expression...ClearApplyNo.TimeSource(kslinatioiProtocolInfo10.00000062.012000IE四.OJOCOOOO111.11113ICMPEcho(ping)request(id・0sJ628.5eq(benc)-45*34/30739.tri-128]ICMPEcho(ping)request(id=0x7628.5eaCbe/le)=49S4/30739.ttl=128)1506.097001.1ISOfi.lOOOOl.l1510.090001.11512.103001.1klStandydinput-Wir«hartc£d«t虫efio顼pu任£nayzeJabstcsTe邮ho理Joels出IpSt*由依白曰沼65(^义令睹■谷殳国亘)#网胞必aFilterip.src«-ldll■Expression...ClearApplyNo.TimeSource(kslinatioiProtocolInfo10.00000062.012000IE四.OJOCOOOO111.11113ICMPEcho(ping)request(id・0sJ628.5eq(benc)-45*34/30739.tri-128]ICMPEcho(ping)request(id=0x7628.5eaCbe/le)=49S4/30739.ttl=128)icmpEcho(ping)request(1d-0x7828,seq(be/le)-4985/30095,rrl-lPfl)ICMPEcho〈Dino)「eauesl〔iAOx7a28.sea(be〈1e)7站6,31251rtt1*128)162126313641464934ES3IFraae1:74bytesonwire(592bits),74bytescaptured(592bits)EtherrecII.sre:Huavt«iTe_4d:3d:21(54:89:98:4d:3d:21),DSt:Hua住lTe_6O:78:5f(54:89:98:(ODoesr1natlon:HuaivelTe_6O:7S:5f($4:89:98:60:78:Sf)GDSource:HuaweiTe-.4d:3d:21(54;89:98;4d:3d:21)Type:ip(0x0800)没有VLViTDInternetProtocol,Src:(),Ost:()InternetControlMessageProtocolle)=4987/31507,tt1=128)le)-4988/31763,12)7^89/32019,】e)=4990/32275.le)-4991/32S3i,le)7992/32787,le)=4993/33043,le)-49^4/33299,2)7993/335”,trl-128)ttl-12S)rtl=128)trl-128)ttl-12S)ttl=128)trl-128)tti-ize)当数据包到达SWG2I1,也就是G2II收到数据后,发现是未带标签的数据包,此时将对数据包打上PVID20,也就是将数据转发至VLAN20中,SW2查询后发现4VLAN20关联端I1有UT:G2G6G7TG:G3,如下图:

[SW2]dispvlanPhototalnumborofvlansis:4J:Up;D:Down;MP:Vian-mapping;If:ProtocolTransparent-vlanTG:Tagged;UT:Untagged;ST:Vian-stacking;&:Management-vlan;<ZIDTypePorts-connmonUT:GE0/0/l(U)GE0/0/10{D)GE0/0/14(D)GE0/0/1B(D)GE0/0/22(D)TG:GE0/0/2(U)GE0/0/3(U)GE0/0/1KD)GE0/0/15(D)GE0/0/19(D)GE0/0/23(D)GE0/0/8(D)GE0/0/12(D)GE0/0/16(D)GE0/0/20(D)GE0/0/24(D)GE0/0/9(D)GE0/0/13(D)GE0/0/L7(D)GE0/0/21(D)10connmonUT:GE0/0/4(U)GE0/0/5(D)cnc/nf/tti&UJ20UT:GE0/0/2(U)GE0/0/6(U)GE0/0/7(D)rccTG:GE0/0/3(U)307IDStatusPropertyMAC-LRNStatisticsDescription102030enableenableenableenabledefaultdefaultdefaultdefaultenabledisableenabledisableenabledisableenabledisableVLAN0001VLAN0010VLAN0020VLAN0030所以此时SW2会将此数据包在G2G6G7[UT]口去标签后转发,如下图:File(ditVica*GoCaptureAna^yieStatirti«TelephonyTcolsAFile(ditVica*GoCaptureAna^yieStatirti«TelephonyTcolsA5郝碧WML电53骂©昌<9寺。鄢*械f招L写Alter!♦CharApplyNoTimeQwlirutionScurce10.0000001-1.121.996000B4.009000ProtocolInfoicmpEcho(ping)request(1d=Ox8d38.seq(be/le>=7O43/33S63.icmpEcho(ping)request(1d-Ox8f38.seq(be/le)-7044/33819,ICMPEcho(ping)request(id-Ox9138.seq(be/le)-7045/B407S,T/-MOGrhrtranNfiCTriK-nvQPMcaq(b«/l€)=7046/34331,篇积云(be/le)-7047;34587.(be/le)-7048/34845,,(be/le)-7049/3$099,(6«/1€>=7050/35355,(be/le)-7051/35611.(bc/le)-7O52/35867,(b€/le)-7O53/3612J,(be/le>=7054/36379.■lOJOOOOOOlJ.lJU.13ICMPE<ho(plnglrequest(»0=0>S<C8.wq8e/®=7043/33503,ttfe®Fraae1:74byxesonwire(592b11s>^74bytescaptured(592biis)EthernetIT,Src:HLar.«iTe_4d:Jd:21($4:89:96:4d:3d:21).Ost:Hua»\tjiTe_60:78:Sf(54:89:9的Destination:HuaweiTe_60:78:5f(M:89:98:60:76:5f)0Source:MuaAeiTe_4d:3d:21(54:39:98:4d:3d:21)Type:IP(0x0800)IInternetProtocol,Src:(),Dst:()InternetControlmessageProtocolLC1=128)tt1-128)ttl=128)tt1-128)ttl=128)ttl-128)tt1-128)tt1-128)一.ttl=126)(be/le)-7O55/36635.tel-128)(bc/1e)-7056/36891,tt1-128)(b€/1e)-7057/37147,ttl-iza)(be/le)=7O58/374O3,ttl=128)在G3[TG]口含标签转发,如下图:Eile£dc松ewGoGpUnegiugStsbit<sTdephcr^IcciiUdpa«««瞬ta沃务昌〈,幸企辱业回回Eile£dc松ewGoGpUnegiugStsbit<sTdephcr^IcciiUdpa«««瞬ta沃务昌〈,幸企辱业回回qqr巴哭»Filer■Expression...ClearApplyE亿CTNo.TmcSource0.0000001.W70005.9940006.006000S.00300010.015000DertinelionProtocolInfoICMPEcho(pi「9)icmpEcho(ping)ICMPecho(ping)TCNPEcho(pirg)icmpEcho(ping)ICMP€cho(Dina)requestrequestrequestrequestrequestrequest(id-Ox4f39.0(4=0X5139,00-0x5339.(id-Ox5539.0(faOx5739,(1*0X5939.seq(be/le)-7U0z58395.seq<be/le)=7Ui/58651,seq(be/le)-7i42/58907.tt1-128)Xt1=123)Tt1-128)Eth«(fl!:OjOO»«UJ11.1.UKMPE<ho(pin9)fequestGd=<rx4n9,seq(be.le)=7140/M»5,ttJ=12fl)aT3\~Q~Fran«1:78Oytesonwire(624bits),78bytescaptured(624bits)EThernerII,Src:Huah^TC_4d:3<j:2L(54:89:95:4d:3d:21>.Dsr:HuaweiTe_60:7&5f(H:69:98:fBU2.IQVirtualLAN,PRT:CJ.CFT:(J.TD:2D000-priority:BestEffort(defauK)CO)...0-Cfl:Canonical(0)....000000010100-TO:20T^pe:ip(0x0800)internetProtocol,Src:(),Ost:()IIntarnotControlMessageProtocol3eq(be/le)-7143/59163.ttl-128)seq<be/le)=7Ud;59419,xd=123)seq(be/le)-7M5/59675.Tt1-128)eq(be/le)-7U6/59931.tt1-128)eq<be-]e)=7147/60187.tc1=128)eq(be/le)-7148/60443.Tt1-128)eq(be/le)-7U9/60699.tt1-128)eq(bele)=715O/6O955.eq(be/le)-7i51/6120.eq(be/le)-7152/61467.eq(be/le)-7153;61723.eq<be/le)-71M/61979.eq(be/le)-7155/62235.eq(be/le)-7156;624W.eq<be/le)-7157/62747.eq(be/le)-71Sfi/6?003.”1=128)Tt1-128)tt1-128)U1-12S)Tt1-128)tt1-128)U1-12S)Tt1-128)tt1-128)在G3I1抓包,看数据包是否被打上PVID为20并转发到VLAN20关联【TAG】的G3II?是,如上图。结论:接收:1、当普通数据包进入端II时,如果物理接I1ACCESS模式,交换机将对数据帧打上与PVID相同的VLIANID号,变802.11Q格式后,进入交换机内部等待转发【如ACCESS--连接

——PCL若收到802.11Q的数据帧,将直接丢弃【如TRUNK口一连接交换机--ACCESSII,且两端PVID不同时L如下2图:touboFCSitnulatorl要是两边如下2图:touboFCSitnulatorlPC10未改为TRU筋的,可以PING通此时两日的PVID相同PC>ping32databytcorbytGA=32byte9-32byt®a=32bytoa=32bytea-3232databytcorbytGA=32byte9-32byt®a=32bytoa=32bytea-32oeq-2aoq=3oeq-5ProoaCtrl_Ctobroeikttl=123t£na=63mattl-1295=128ttl=123ttl-123tbne-63sst-lJ5O=4768t£na=<7mati»c-63财pingAtatlatica5packet(s)txoxLsaiit-tcd5packet(s)received0.00%paekatloaarouad-tripxiin/avg/xiAX-47/56/63gSW4执行以下两条命令,将G2口改为TRUNK模式:[Huawei-GigabitEthernetO/0/2]portlink-typetrunk[Huawei-GigabitEthernetO/0/2]porttrunkallow-passvlanall

IIIError:unrecognizedconnnandfoundar[Huawei]dispportg0/0/2position.Error:UnrecognizedcommandfoundIIIError:unrecognizedconnnandfoundar[Huawei]dispportg0/0/2position.Error:Unrecognizedcommandfoundat[Huawei)dispport?vlanvirtualLAN'*1position.[Huawei]dispportvl[Huawei]dispportvlang0/0/2PortLinkTypePVIDTrunkVLANListGigabitEthGxnetO/O/2trunk[Huawei]|11-4094WLSW4命苗行徂择如咳包工具串口round-tripmin/avgZniax=31/47/63insPOping-tPingFrom.FromFromFrom.FromFromFrom.PromFromFrom.PromFrom:::::::::::::32databytesrbytes=32byr©s=32bytes=32bytes=32byre3=32bytes=32bytes=32byte5=32bytes=32bytes=32byte5=32bytes=32seq=lseq=2seq=3seq=4seq=5se«q=6seq=7oeq=8seq=9seq=10oeq=llseq=12PressCtrlCtobreakttl=128zzl=128ttl=128ttl=128zzl=128ttl=128ttl=128ttl=128ttl=128•ttl=128ttl=128ttl=128mstime=47time=47time=4?time=47timc=46nujtixne=4?mstime=31mstixnc=31nujtixne=4?mstiine=47mstime=47xnotime=47msmsmsms2、当数据包进入端II时,如果物理接IITRUNK模式,交换机将比较本端II的PVID和数据的VLANID,如果相同,剥离数据帧中VLANID使用变为普通数据帧后,进入交换机内部等待转发。如果不相同,保持数据帧原始形态,进入交换机内部等待转发。查询:1、当交换机以接收1的方式接收到带VLANID的数据帧时,在交换机内部以VLANID号进行查询,确认具体哪些接口与本VLAN关联。将数据在这些接口进行泛洪。转发:1、当端口在此VLAN中处于TAG状态时,保持数据帧原始形态,直接转发。2、当端II在此VLAN中处于UNTAG状态时,剥离数据帧中VLANID使用变为普通数据帧后再执行转发。

[SW1]dispviaThetotalnumberofvlansis:3U:Up;D:Down;TG:Tagged;UT:Untagged;MP:Vlan-rnapping;ST:Vlan-stacking;#:ProtocolTransparent-vlan;*:Management-vlan;VIDTypePortsRcomrnonUT:GE0/0/l(U)GE0/0/2(U)GE0/0/3(U)GEO/O/8(D)GE0Z0/9(D)GE0/0/10(D)GE0/0/11(D)GEO/O/12(D)GE0/0/13(D)GE0/0/14(D)GE0/0/15<D〉GE0/0/16(D)GE0/0/17(D)GE0/0/18(D)GE0/0/19(D)GE0/0/20(D)GE0/0/21(D)GE0/0/22(D)GE0/0/23(D)GEO/O/24(D)kocomrnon巧GE0/0/5(D)|tg:geo/o/2(U}20commonUT:GE0/0/6(U)GE0/0/7(D)TG:GE0/0/2(U)VIDStatusPropertyMAC-LRNStatisticsDescription从此图可以得出以下数据在出方向的信息:1、VLAN数据在通过G0/0/2转发时,将被剥离VLANIDo2、VLAN10数据在通过G0/0/4和G0/0/5时,将被剥离VLANIDo3、VLAN10数据在通过G0/0/2进,将保留VLANIDo进方向:1、普通数据进入ACCESSCl,打上PVID,使之成为802.11Q数据后,等待转发。2、普通数据进入TRUNK时,在PVID相同的接II上,两端PC可■以PING通。如下4图:Frame200:74bytesonwire(592bits),74byrescaptured(592bits)四20083.88200022Frame200:74bytesonwire(592bits),74byrescaptured(592bits)+Ethernetn.src:Mua^elTe_73:6d:75(54:89:98:73:66:75).dsl:Huaweire_24:32:7e(54:89:98:2+internetprotocol.5rc:().DSC:()+interneicontrolMessageprotocolTOC\o"1-5"\h\zinterfaceGigabitEthernetO/0/1Hportlink-typetrunkHporttrunkallow-passvlan2to4094H\o"CurrentDocument"Lz…IPOpingZ.Z.2.1Ping:32databyteszPressCtrl_CtobreakFrom:bytes=32seq=lttl=128time=47ms2、当802.11Q数据进入TRUNKI1后,首先比较VLANID是否与PVID相同,若相同,剥离VLANID后等待转发。若不同,就拿VLANID与关联的VLANID号比较,若是允许通过的VLANID相同,就保持802.11Q形态等待转发,或不是,则进接丢弃。SW2上G2「I抓包看到VLANID为30的数据己转发出去,如下图:BrnetOWIPC-PC1EthernetCopperPOSTRUNK1020-vlan!®TRUfK102。30|CapturingfromStandard「putWiresharkvlan11.1.1.sGEQ5TRUrK-vlan102030S6700lan20GlGl□BrnetOWIPC-PC1EthernetCopperPOSTRUNK1020-vlan!®TRUfK102。30|CapturingfromStandard「putWiresharkvlan11.1.1.sGEQ5TRUrK-vlan102030S6700lan20GlGl□#凶野鬼回Apply«on...Clear故据包在VLAN30关联的^□G2G3:TAG状态]上泛洪.故看到了VLANID30Sourcewhohas00?Tell.Mbyicscapiurod(512rran。1:64byicsonidr。(512,ileEditY'6GoCaptureAnaly^学曲市hTelephonyToolsHdp¥源徼融恣其笏昌I入狼岑商祥欧IrotoeolInfoARParpwhohas00?TellARPwhohasOO?Tell?Telll.ll£TimeSou心D&tinatjon18.2S2000Huawe-iTe_f3:70:a4Broadcast19.25(X)00HuawelTe_f3:70:a4Broadcast2】20.28000。HuawelTjf3:70:a4Broadcast叵1OjOOOOCOHuaweiTe_fi:70!54BroadcastARPWhoha?1.1.1=EThernetIIvSrc:HuaweiTe_f3:TOM802.IQVirtualLAN.PRI;0.CFI;000-Priori.54:89:98:f3:7O:S4),Ost:Broadcasx(ft:ff:ff:ff:ff:ff)ID:30BestEffort(default)(0)...0=CFI:onical(0)....000000011110-ID:30Type:ARP(0X0806)Trai1er;000000000000000000000000000000000000AddressResolutionProtocol(request)在SW1的G2上抓包看,同样可以接收到No.TimeSourceDestinationProtoccJWo10.000000HuaweiTeJ3;70;a4BroadcastARPWhohas00?Tell21.014000Huawe-iTe_f3:70:No.TimeSourceDestinationProtoccJWo10.000000HuaweiTeJ3;70;a4BroadcastARPWhohas00?Tell21.014000Huawe-iTe_f3:70:a4BroadcastARPwhohas00?Tell32.028000MuaweiTe_f3:7O:a4BroadcastARPwhohas007Tell3.4.四1OXJOCOX)HuaxveTe_f3:7O:d<BroadcastARPWhohas1.1.1100?腮111.1.8|u1⑥6u"Am。1:64by"Son(512bU),64byiQScapiured(512bits)9.101112130PC-PC13PC-PC143鼬g冠|女力会令密邑1回回1qq也n[匡1四器甘Alter▼Expression...ClearApplyEthernetII.5rc;HuavM«iTe_f3:70;a4〔54;89;98;f3;70;a4),D5t;Broadcast(ff;ff;ff;ff;ff;ff)3802.IQVirtualLAN,PRI:0,CFI:0.IO:30000-Priority!BestEffort(default)(0)・..0-cfi:canonical(0)....000000011110-ID:30Type:ARP(0x0806)Trailer:ooooooooooooooooooooooooooooooooooooAddressResolutionproiocol(request)SW1的G0/0/2是如何丢弃的呢?[没有找到查看的办法]交换机有没有又是ACCESSII又是TAG状态的情况呢?没有找到答案。HYBRID实验1:交换机配置:7IDTypePortsEth0/0/5(D)Eth0/0/9(D)Eth0/0/13(D)Eth0/0/17(D)Eth0/0/21(D)Eth0/0/6(D)Eth0/0/10(D)Eth0/0/14(D)Eth0/0/18(D)Eth0/0/22(D)10commonTG:Eth0/0/l(U}Eth0/0/2(U)20CQiraaoncommonUT:EthO/O/l(U>Eth0/0/2(U)7IDStatusProperty7IDTypePortsEth0/0/5(D)Eth0/0/9(D)Eth0/0/13(D)Eth0/0/17(D)Eth0/0/21(D)Eth0/0/6(D)Eth0/0/10(D)Eth0/0/14(D)Eth0/0/18(D)Eth0/0/22(D)10commonTG:Eth0/0/l(U}Eth0/0/2(U)20CQiraaoncommonUT:EthO/O/l(U>Eth0/0/2(U)7IDStatusPropertyMAC-LRNStatisticsEth0/0/3(U)Eth0/0/7(D)EthO/O/ll-(D)Eth0/0/15{D)Eth0/0/19<D)GEO/O/1(D)DescriptionenabledefaultenabledisableVLAN000110enabledefaultenabledisableVLAN001020enabledefaultenabledisableVLAN0020将ElE2配置上porthybridtaggedvlan10interfaceEth.ernetO/0/1porthybridtaggedvlan10#return[HYBRID-EthernetO/O/1]qu[HYBRID]interfacee0/0/2[HYBRID-Ethernet0/0/2]dispth#interfaceEthernet0/0/2porthybridtaggedvlan10代表当收到带有VLAN10标签的数据时,保持802.11Q格式不变,直接转发出去。普通数据帧进入时,打上PVID为1。基础酣置命令行组播U。咳包工具串口FromFromttl=128ttl=128ttl=128ttl=12::::time=l€time=32time=47time=47seq=366seq=3€7seq=3€8seq=369bytes=32bytes=32bytes=32bytes=32=22msmsFrommsFromms将El的PVID改为VLAN10看效果:interfaceEthernet0/0/1porthybridpvidvlan10porthybridtaggedvlan10#return[HYBRID-EthernetO/O/1]inte0/0/2[HYBRID-EthernetO/O/2]dispthinterfaceEthernet。/0/2porthybridtaggedvlan10VIDTypePorts1commonUT:EthO/O/l(U)Eth0/0/5(D)Eth0/0/9(D)Eth0/0/13(D)Eth0/0/17(D)Eth0/0/21(D)EthO/O/2(U)Eth0/0/6(D)Eth0/0/10(D)Eth0/0/14(D)Eth0/0/18(D)Eth0/0/22(D)10commonTG:EthO/O/l(U)Eth0/0/2(U)timeout!timeout!timeout!timeout!timeout!timeout!timeout!rrom:bytes=32aeq=427ttl=128timeProm:bytes=32seq=428tt-l=128timeRequestRequestRequestRequestRequestRequestRequest无法通信原因:当数到达El时,被打上VLAN10标签,交换机查询关联E2II与VLAN10关联,故将数据转发至E2Itimeout!timeout!timeout!timeout!timeout!timeout!timeout!a■■住.a■■住.hTmxs-飞>七压寸浅=ionmageju‘r,>.»•©*•OewF,har«wCtocMAanaaua1ao>KC0j.>.>.i,.,.,.7IC*uror»a<5tic«Cbe,1e)•'制rrv”.“17“>?0»XC0■..30:,mJ•,尸(6"・:cc:cctt■♦3X01XCO3.1.J.lLLAegC^CW.W}.;M*1M71.ttluai)Il<•«»)・|f<y.jtwC只^*>***•e<Kt•♦4.00KCIO1.1.>.XKWfctfwr»«Q>r»u«»t(l4»C«2crj.MQCtM/U>«SM.2A3M.ttlUM)•、<I>0COT<KaMb****<^•</■•>•f-LTW^<T.-|;*t41ftMlCMt•♦此时可以将E2的PVID设置为VLAN10interfaceEthernetO/O/2porthybridpvidinterfaceEthernetO/O/2porthybridpvidvlan10porthybridtaggedvlan10freturn(MYBRID-Ethernet0/0/2]inte0/0/l[MYBRlD-EthernetO/O/l]dispth*interfaceEthernerO/O/lporthybridpvidvlan10porthybridtaggedvlan10仍然无法通信JV—J7wRequestRequestRequestRequestRequestRequestRequeacRequestRequestRAffilAAt:RequestRequestW—WWLW•timeout!timeout5tinxeoutItinxeoutItimeout!timeout5timeoutItinxeoutItimeout!timeout5timeout5tinxeoutItimeout!10commonTG:Eth0/0/l(U)EthO/O/2(U)原因同上将E2配置为:interfaceEthernet0/0/2porthybridpvidvlan10porthybriduntaggedvlan10#一在E2II抓包:12.74500012.74500014.74200014.74200016.75400012.74500012.74500014.74200014.74200016.75400016.75400018.73SOOO18.73500020.98200020.98200022.97900022.9^400024.99100024.99100027.003000Z7.00300028.98500。28.9850002730.0S1000J.9700032.99400032.9800024.O7S0OOJ.3.2.1ICMPICMPICMPICMPICMPICMPICMPICMPICMPICMPICMPICMPICMPICMPICMPICMPICMPICMPICMPICMPICMPICMPrcMPEcho〈ping)requestEcho(p1ng)replyrequestreplyrequestreplyrequestreplyrequestreplyrequestreplyrequestEcho(p1ng)Echo(ping)Echo〈ping)Echo<p1ng)Echo(p1ng)Echo(ping)Echo〈ping)Echo<p1ng)Echo(ping)Echo(ping)Echo(ping)Echo(p1ng)replyEcho(ping)requestEcho<ping)replyEcho(ping)requestEcho(p1ng)replyEcho(ping)Echo<ping)Echo(ping)Echo(ping)requestreplyrequestreplyEcho<oina^raauost(1d-0x5d74,seq(be./le)-864/24579,Ttl-128)(1d=0x5d74,seq(be/le)=864/24579.itl=128)(16-0XST74.seq(be/le(id-0x5f74.seq(be/le(1d=0x6174,seq(be/1e(1d=0x6174.seq(be/le(16-0x6574.seq(be/le(id-0x6J74,seq(be/le(1d=0x6574,seq(be/1e(16-0x6574.seq(be/le(id-0x6774,3eq(be.le(id-0x6774,seq(be/le(id=0x6974.seq(be/le(1d-0x6974.seq(be/le(id-0x6b74,3eq(be/1e(ici-0x0b74,5eq(be/le(1d=0x6d74.seq(be/le(1d-0x6d74.seq(be/le(id-0x6f74.soq(ba/lo(id-0x6f74,seq(be/le(1d=0x7174.seq(be/le(1d-0x7174.seq(be/lefid-0x7J74.5QafbG/lc:PC13sniBffiI一羸薛Requesttimeout!Requesttimeout!Requesttimeout!Requesttimeout!Requesttimeout!RequesttimeoutIRequesttimeout!Requesttimeout!RequesttimeoutJRaquofittxmoout!Requesttimeout!Requesttimeout!Requesttimeout!Requesttimeout!Requesttimeout!R七bu登mtnim兰二!此时数据从El过来后,E2也给了回包,但为什么还是TIMEOUT呢?因为E2以PVID为依据,给数据包打interfaceEthernet0/0/1porthybridpvidvlan10porthybridtaggedvlan10±VLAN10标签,交换机经过查询后,发现El与VLAN10关联,将数据包转到至El,E1在VLAN10中为TAG状态,此时将保持数据帧为802.11Q格式发给PC,PC无法识别。E2以PVID为依据,给数据包打在E1「I抓包:No.TimwSource30.03100031.99600032.04300033.005000?10.000000DestinationProtocolIn1oICMPEcho(ping)requesticmpEcho(ping)reply|ICMPEcho(ping)requesticmpEtho(ping)ieplyICMPEcho(ping)raquost(id=Oxc975.seq(be.ne)=l(M6/5636,(1d-Oxc975,Od-Oxcb75t(1d=Oxcb75,(id-0xcd7S,seq(be/le)-1046/5636,seq(be/le)-l(M7/5892rseq(be/le)=i<M7/5892,saq(bO/l0)-1048/6148,-8/6148,9/6404,9/6404r0/6660,0/6660,108.034001412.02709.9990010.046011.99601/6916,176916.2/7172,2/7172,4.024006.006006.0210G8.00200ttl=128)ttl-128)tt1-128)ttl=128)tt1-128)ttl=128)rtl-128)tt1-128)ttl=128)rc1-128)ttl-128>rtl-128)tt1-128)ttl=128)抓包证明了以上说法。将El配置为:interfaceEthernet0/0/1porthybridpvidvlan10porthybriduntaggedvlan10FromFromFromFromFromFromFromFromFromFrom.ttl=128tinie=32msttl=128time=3Lmsttl=128tinie=31msttl=128tim.e=31msttl=128time=31msttl=128time=47msttl=128time=31ms:::;::bytes=32bytes=32bytes=32bytes=32bytes=32bytes=32bytes=32seq=11243eq=1125seq=1126seq=1127•aeq=l128seq=11295eq=1130恢复正常HYBRID应用:用MVt»RID$C^PCAPING通PC-CPCDPINOilPC-CP(4HN6不iBPC-8interface6ig®bitEthernet^/0/1perthybridpvidvlon10porthybriduntoggedvlen103。9interfaceOigebitCthernete/e/2porthybridpvidvlen2。perthybriduntsgged71«n29JOinterfaceGigobirE?h€rnetG/0/3perthybridpvidvlon3。porthybriduntogged10203。1cottfwnUT.6E0/G/l(U)6EO/G/5(D)GEe/e/9(D)GE0/0/13(D)GEG/G/17<D)G£e/e/2i(o)Gce/e/2(u)GE0/d/6(O)GE0/e/ie(o)GEWB/"(0)GEe/»/iS(D)Gce/e/22(D)GEe/0/3(U)SSG/G/7(D)GeG/e/n(D)Sf0/0/15(D)5£G>0/10(D)GEe/G/23(D)GE0/e/4(D)GE0/»/8(O)GE0/8/12(D)660/0/16(0)GEO?0/20(D)GE0Z8/24(D)10cottfwnUT.6E0/e/l(U)GEe/0/3(U)2。cc«ifftonUT:6Ee/0/2(U)GEe/»/3(U)3Gcc«ifftonUT:6EO/G/1(U)GE0/a/2(U)SSG/Q/3(U)VIDTypePortsPCAPINGPCC,G3II抓包Io.TimeSource10.000000l.I.l.l0e«in3tionProeocclInfoICMPIo.TimeSource10.000000l.I.l.l0.0000001.0140001.029000icmpEtho(ping)reply(1d-0x7f7d,ICMPEcho(ping)request(1d=0x807d.icmpEtho(ping)reply(1d-0x807d,seq(be/1e)-l98/50688,seq(be/le)=199/50944.seq(be/le)-199/50044,spnfbe/1e)=200/51200,1ODOOOOO1.113ICMPEcho(ping)request(id=Ox7F7d5eq(b^le)=158.50622,ttl=128)Rnreii^i±Frame1:74bytesonwire(592bits).74bytescaptured(592bits)tEthernetIIFSrc:HuaweiTe_e8:4f;cO(54:89:98:€8:4f:cP),Ost:HuaweiTe_?4:l3:e?(54:89:98::bsskninrerneiprotocolrsre.!)»osr♦intern^rControlmessageProrocoinIOOOO$48998X1?e?548998e84fcO0800ooio修r・w.0030Oe-^16ii121314is16171819lalblcId0040leif2021222324252627.・!"#$%&'e/le)-200/51200,B/l€)=201/51456.?/le)-201/51456.e/1€)=202/51712.e/le)-2O2/51712,fe/le)=2O3/51968.?/le)-2OV51968.?/le)-2O4/52224.e/1^-204/52224,?/le)-2O5/524fiO.ele)-2O5/5245O.?/le)-2O6/52736,e/1<)=206/527351?/le)-2O7/52992,B/1€)=207/52992.rtl-128)Ttl=128)rrl-128)E=128)ttl-128)E=128)ttl-128)E=128)ttl-128)tcl=128)ttl-128)rcl-128)ttl-128)rrl-128)ttl-125)rrl-128)Ttl=128)rrl-128)rtl=128)有去有回,通信正常。PCAPINGPCC,G2II抓包|£3CdptunngfromStandardinput-V/ireshdikDieEdityiewQqCaptureAnalyzeSutstisIdephon^IeohHelpI沮戏浏&目仁孕仲c®香殳回回纹Q蚊EIM留吼初3Fitter▼E>pr»sion.ClwrApplyNo.TimeSourceDestndtonProtocolInfo0.0000001.0300002.0440003.089000ICMPecho(ping)reply(1d=0xc67c,seq(be/1e)=18/4608.icmpEtho(ping)Fitter▼E>pr»sion.ClwrApplyNo.TimeSourceDestndtonProtocolInfo0.0000001.0300002.0440003.089000ICMPecho(ping)reply(1d=0xc67c,seq(be/1e)=18/4608.icmpEtho(ping)reply(1d-0xc77c,seq(be/le)-19/4S64,icmpRhe(ping)reply(id=0xc87c,seq(be/1e)=20/5120,icmpEtho(ping)reply(1d-0xc97c,seq(be/le)-21/5376,tt1=128)ttl-128)ttl=128)ttl-128)54.119000If65.1640006.17800017.22300018.25300019.282000310.327000111.341000a12.371000113.401000114.41500011015.444000116.489000117.5030001fet10.00(tt»111311.1.1ICMPEcho(ping)reply(id=0«67c.5eq(be/le)=iflZ460fl.击||«£3»1♦Frame1:74bytesonwire(592bits),74bytescaptured(592bits)I±Ethernetn,sre:HuawelTe_S4:13:e3(54:89:96:34:12:e3),ost:HuaweiTe_e8:4f:c0(54:89:98“念loternfiProtocol,竺:D":l.I.l.lrmernercontrolMessageprotocolType:0(Echo(ping)reply)code:0Checksum:Oxc7ef[correct]identifier:0xc67cSequencenumber:18(0x0012)Sequencenurber(LE):4608(0x1200)EData(32bytes)rttl-125).ttl-128),ttl-128).”1=128),ttl-128).ttl=128)ttl-128).ttl=128)ttl-128),ttl=128).ttl-128)rttl-125).ttl-128),ttl-128)PCAPINGPCC,Gill抓包

No.TimeSource10.000000Destination20.031000ProceedInfoICMPEcho(ping)request(id-0xbd7dtseq(be/1e)-258/5131icmpEcho(ping)reply(1d-0xbd7d,seq(be/le)-258/513,ICMPEcho(ping)request(1d=0xbe7d,seq(be.<le)=259/769,31.029000Trwpttl-128)ctl-128)ttl=128)ttl-128)No.TimeSource10.000000Destination20.031000ProceedInfoICMPEcho(ping)request(id-0xbd7dtseq(be/1e)-258/5131icmpEcho(ping)reply(1d-0xbd7d,seq(be/le)-258/513,ICMPEcho(ping)request(1d=0xbe7d,seq(be.<le)=259/769,31.029000Trwpttl-128)ctl-128)ttl=128)ttl-128)5/1e)-260/1025.ttl-12871e)-26Q/1025.ttl-128i/le)-261/1281,ttl-128i/le)=261/1281.Xtl=128?/le)-262/1537»ttl-128i/le)-262/1537,ttl-128i/le)=263/1793.E=128s/le)-263/1703.ttl-128i/le)=264/2049.tt1=128?/le)-264/2(M9,ttl-128i/le)-265/23O5,ttl-128=265/2305,ttl=12B?/le)-266/2561,ttl-128心c、一/r一■■oFileEdit皿ewGoCaptureAnalyze§atistiesTelephonyToolsHelp麒tiaci豳博*第昌i队令夺业iglBli00Q曰#图最参i可Filter:▼Expression...ClearApplyNo.TimeSourceDestinationProtocolInfo没有数据包。PCAPINGPCB.G3口抓包回CapturingfromStandardinput・WiresharkFileEditViewGoCaptureAnalyzeStatstiesTekphonyTookHelpFrame2:60bytesonwire(480bits),60bytescaptured(480卧簸啜i蒙恣隧密昌r佥•命寄丑id回I曲qqFrame2:60bytesonwire(480bits),60bytescaptured(480Filter▼Expression...ClearApplyNo.TimeSourceDe^inationProtocolInfo10.000000HuaweiTe_e8:4f;c0BroadcastARPwhohas?Tell21.029000HuaweiTe_e8:4f:cOBroadcastARPWhohas?Tell32.02S000HuaweiTe__es:4f:coBroadcastarpwhohas?TG43.057000HuaweiTe_e8:4f:cOBroadcastarpwhohas^Tell54・056000HuaweiTe_e8:4f:cOBroadcastARPwhoh

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论