【正文】
cuous mode not set100Mb/s, Fullduplex, link type is autonegotiationOutput flowcontrol is disabled, input flowcontrol is disabledOutput queue : (Urgent queue : Size/Length/Discards) 0/50/0Output queue : (Protocol queue : Size/Length/Discards) 0/500/0 Output queue : (FIFO queuing : Size/Length/Discards) 0/75/0 Last 300 seconds input rate bytes/sec, packets/sec Last 300 seconds output rate bytes/sec, packets/sec Input: 6 packets, 550 bytes, 6 buffers 0 broadcasts, 0 multicasts, 0 pauses 0 errors, 0 runts, 0 giants 0 crc, 0 align errors, 0 overruns 0 dribbles, 0 drops, 0 no buffers Output:5 packets, 532 bytes, 6 buffers 1 broadcasts, 0 multicasts, 0 pauses 0 errors, 0 underruns, 0 collisions 0 deferred, 0 lost carriers (2)配置后[RTAEthernet0/0]display interface Ethernet 0/0Ethernet0/0 current state :UP Line protocol current state :UPDescription : Ethernet0/0 Interface The Maximum Transmit Unit is 1500, Hold timer is 10(sec) Internet Address is IP Sending Frames39。 Format is PKTFMT_ETHNT_2, Hardware address is 00e0fc262f3cInternet Address is Description : HUAWEI, Quidway Series, Vlaninterface1 Interface The Maximum Transmit Unit is 1500由上述輸出可以知道,目前Sw1將要轉(zhuǎn)發(fā)到Sw2的Interface Vlan1數(shù)據(jù)幀是通過E0/2轉(zhuǎn)發(fā)的。TFTP傳輸文件有兩種模式:一種是二進(jìn)制模式,用于傳輸程序文件;另一種是ASCII碼模式,用于傳輸文本文件。destfile指的是文件上傳到TFTP服務(wù)器的存儲(chǔ)目錄;tftpserver參數(shù)代表TFTP服務(wù)器的IP地址或者主機(jī)名。3 結(jié)果驗(yàn)證同一VLAN內(nèi)部的PC可以互相訪問,在PCA上ping PCB,結(jié)果如下:C:\Documents and Settings\x99270ping Pinging with 32 bytes of data:Reply from : bytes=32 time1ms TTL=128Reply from : bytes=32 time1ms TTL=128Reply from : bytes=32 time1ms TTL=128Reply from : bytes=32 time1ms TTL=128Ping statistics for : Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milliseconds: Minimum = 0ms, Maximum = 0ms, Average = 0msPCC與PCD屬于同一個(gè)VLAN 3,在PCC上ping PCD,可以ping通,結(jié)果如下:C:\Documents and Settings\x99270ping Pinging with 32 bytes of data:Reply from : bytes=32 time1ms TTL=128Reply from : bytes=32 time1ms TTL=128Reply from : bytes=32 time1ms TTL=128Reply from : bytes=32 time1ms TTL=128Ping statistics for : Packets: Sent = 4, Received = 4, Lost = 0 (0Approximate round trip times in milliseconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms不同VLAN間的PC不能夠互相訪問。(3)創(chuàng)建三層接口,并配置IP地址在Switch A上創(chuàng)建三個(gè)三層虛接口,并配置IP地址, , , 在Switch B上創(chuàng)建三個(gè)三層虛接口,并配置IP地址, , , 在交換機(jī)上配置非直連網(wǎng)段靜態(tài)路由在Switch A上配置兩靜態(tài)路由:ip routestatic ip routestatic 在Switch B上配置兩靜態(tài)路由:ip routestatic ip routestatic 3 結(jié)果驗(yàn)證通過display ip routingtable 查看路由表Switch Adisplay ip routingtable Routing Table: public netDestination/Mask Protocol Pre Cost Nexthop Interface在PCA上ping PCC,可以得到:C:\Documents and Settings\x99270ping Pinging with 32 bytes of data:Reply from : bytes=32 time1ms TTL=126Reply from : bytes=32 time1ms TTL=126Reply from : bytes=32 time1ms TTL=126Reply from : bytes=32 time1ms TTL=126Ping statistics for : Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milliseconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms同樣,在PCA 上可以ping 通PCC、PCD。STP(Spanning Tree Protocol)是生成樹協(xié)議的英文縮寫。Switch A:端口Ethernet 0/1配置消息:{32768. 00e0fc226fda,0,e0/1}端口Ethernet 0/3配置消息:{32768. 00e0fc226fda,0, f,e0/3}Switch B:端口Ethernet 0/1配置消息:{,0,e0/1}端口Ethernet 0/2配置消息:{,0,e0/2}Switch C:端口Ethernet 0/2配置消息:{,0,e0/2}端口Ethernet 0/3配置消息:{,0,e0/3}② 選出最優(yōu)配置消息,確定根交換機(jī)各臺(tái)交換機(jī)都向外發(fā)送自己的配置消息??梢杂靡韵旅畈榭磁渲煤蟮腟TP信息:[SwitchA]display stp Protocol mode: IEEE RSTP The bridge ID (): The bridge times: Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec Root bridge ID(): Root path cost: 200 Bridge bpduprotection: disabled Timeout factor: 3 … …[SwitchB]display stp Protocol mode: IEEE RSTP The bridge ID (): The bridge times: Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec Root bridge ID(): Root path cost: 0 Bridge bpduprotection: disabled Timeout factor: 3 … …[SwitchC]display stp Protocol mode: IEEE RSTP The bridge ID (): The bridge times: Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec Root bridge ID(): Root path cost: 200 Bridge bpduprotection: disabled Timeout factor: 3 … …我們可以看到,3臺(tái)交換機(jī)都有下面信息:Root bridge ID(): 。[SwitchA]display stp interface ethernet0/1 ethernet0/3Protocol mode: IEEE RSTP The bridge ID (): The bridge times: Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec Root bridge ID(): Root path cost: 200 Bridge bpduprotection: disabled Timeout factor: 3Port 1 (Ethernet0/1) of bridge is Forwarding Port spanning tree protocol: enabled Port role: Root Port Port path cost: 200 Port priority: 128 Designated bridge ID(): The Port is a nonedged port Connected to a pointtopoint LAN segment Maximum transmission limit is 3 Packets / hello time Times: Hello Time 2 sec, Max Age 20 sec Forward Delay 15 sec, Message Age 0 BPDU sent: 4 TCN: 0, RST: 4, Config BPDU: 0 BPDU received: 458 TCN: 0, RST: 458, Config BPDU: 0Port 3 (Ethernet0/3) of bridge is Forwarding Port spanning tree protocol: enabled Port role: Designated Port Port path cost: 200 Port priority: 128 Designated bridge ID(): The Port is a nonedged port Connected to a pointtopoint LAN segment Maximum transmission limit is 3 Packets / hello time Times: Hello Time 2 sec, Max Age 20 sec Forward Delay 15 sec, Message Age 1 BPDU sent: 563 TCN: 0, RST: 563, Config BPDU: 0 BPDU received: 5 TCN: 0, RST: 5, Config BPDU: 0Switch B:端口Ethernet 0/1收到Switch A的配置消息,Switch B發(fā)現(xiàn)本端口的配置消息優(yōu)先級(jí)高于接收到的配置消息的優(yōu)先級(jí),就把接收到的配置