【正文】
0 01005 enet 101005 1500 0 0(2)查看交換機(jī)switchB上的配置文件信息:switchBshow runswitchBshow runningconfig Building configuration...Current configuration : 989 bytes!version no service passwordencryption!hostname switchB!!!interface FastEthernet0/1 switchport mode trunk!interface FastEthernet0/2 switchport access vlan 10 switchport mode access!interface FastEthernet0/3 switchport access vlan 20 switchport mode access!interface FastEthernet0/4!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEthernet0/9!interface FastEthernet0/10!interface FastEthernet0/11!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEthernet0/20!interface FastEthernet0/21!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!interface Vlan1 no ip address shutdown!line con 0!line vty 0 4 loginline vty 5 15 login!!End(3)在交換機(jī)switchA上將配置文件保存:switchAcopy runningconfig startupconfig(4)刪除某一個(gè)vlan的命令:switchA(config)no vlan 10實(shí)驗(yàn)五 靜態(tài)路由配置實(shí)驗(yàn)一、實(shí)驗(yàn)?zāi)康摹?二、實(shí)驗(yàn)原理與內(nèi)容路由器在沒有配置路由時(shí),只能實(shí)現(xiàn)與它直連的網(wǎng)絡(luò)間的通信,為了實(shí)現(xiàn)在更大范圍的網(wǎng)絡(luò)間通信,需要進(jìn)行路由配置,路由包括靜態(tài)路由、默認(rèn)路由和動(dòng)態(tài)路由幾類。靜態(tài)路由是一種特殊的路由,它由管理員手工配置而成。網(wǎng)管必需了解路由器的拓?fù)溥B接,通過手工方式指定路由路徑。但這種配置問題在于:當(dāng)一個(gè)網(wǎng)絡(luò)故障發(fā)生后,靜態(tài)路由不會(huì)自動(dòng)發(fā)生改變,必須有網(wǎng)管手工修改路由路徑。 S0/0S0/0串口線纜Router ARouter BSwitch ASwitch BPC APC BF0/0f0/0本次實(shí)驗(yàn)中,網(wǎng)絡(luò)拓?fù)浣Y(jié)構(gòu)及其相關(guān)參數(shù)如下圖:三、實(shí)驗(yàn)步驟、。2. 配置路由器Router A 的基本參數(shù) 配置路由器A的接口FastEthernet0/0和Serial0/3/0的IP地址(該步驟要注意:路由器默認(rèn)沒有配置Serial串口,應(yīng)該先給路由器添加Serial串口模塊,然后再寫以下命令)RouterenableRouterconfigure terminalEnter configuration mands, one per line. End with CNTL/Z.Router(config)hostname RouterARouterA(config)interface FastEthernet0/0RouterA(configif)no shutdown%LINK5CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO5UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upRouterA(configif)ip address RouterA(configif)RouterA(configif)exitRouterA(config)interface Serial0/3/0RouterA(configif)no shutdownRouterA(configif)clock rate 800000RouterA(configif)ip address RouterA(configif)此時(shí),RouterA上還沒有設(shè)置靜態(tài)路由。在設(shè)置靜態(tài)路由之前,先將幾臺(tái)計(jì)算機(jī)進(jìn)行ping命令,檢查不同網(wǎng)絡(luò)中的計(jì)算機(jī)之間能否通信。結(jié)果是:同一網(wǎng)絡(luò)中的計(jì)算機(jī)能通信,但是不同網(wǎng)絡(luò)中的計(jì)算機(jī)之間就不能相互通信,原因是路由器上沒有路由信息,路由器不知道如何轉(zhuǎn)發(fā)IP數(shù)據(jù)報(bào)。例【1】,在PCA上ping RouterA的f0/0接口的顯示信息如下:PCping Pinging with 32 bytes of data:Reply from : bytes=32 time=157ms TTL=255Reply from : bytes=32 time=62ms TTL=255Reply from : bytes=32 time=62ms TTL=255Reply from : bytes=32 time=62ms TTL=255Ping statistics for : Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milliseconds: Minimum = 62ms, Maximum = 157ms, Average = 85ms此結(jié)果說明從PCA到其網(wǎng)關(guān)(即RouterA的f0/0接口)之間是能通信的。例【2】,在PCA上ping RouterA的s0/0接口(),請(qǐng)自己試驗(yàn),并說明其原因。 B的基本參數(shù) 配置路由器B的接口FastEthernet0/0和Serial0/3/0的IP地址RouterenableRouterconfigure terminalEnter configuration mands, one per line. End with CNTL/Z.Router(config)hostname RouterBRouterB(config)interface FastEthernet0/0RouterB(configif)ip address RouterB(configif)no shutdown%LINK5CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO5UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upRouterB(configif)RouterB(configif)exitRouterB(config)interface Serial0/3/0RouterB(configif)ip address RouterB(configif) no shutdown%LINK5CHANGED: Interface Serial0/3/0, changed state to upRouter(configif)%LINEPROTO5UPDOWN: Line protocol on Interface Serial0/3/0, changed state to up此時(shí),路由器RouterB上也沒有設(shè)置靜態(tài)路由,請(qǐng)按照以下內(nèi)容使用ping命令進(jìn)行連通性測(cè)試:例【3】,在PCB上ping RouterB的f0/0接口(),ping命令結(jié)果如下:PCping Pinging with 32 bytes of data:Reply from : bytes=32 time=109ms TTL=255Reply from : bytes=32 time=47ms TTL=255Reply from : bytes=32 time=63ms TTL=255Reply from : bytes=32 time=63ms TTL=255Ping statistics for : Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milliseconds: Minimum = 47ms, Maximum = 109ms, Average = 70ms請(qǐng)自己分析此結(jié)果能夠ping通的原因。例【4】,在PCB上ping RouterB的s0/0接口(),請(qǐng)自己試驗(yàn),并說明其原因。例【5】在PCB上ping PCA,請(qǐng)自己試驗(yàn),并說明其原因。,命令如下:RouterA(configif)exitRouterA(config)ip route //配置路由器A的靜態(tài)路由RouterA(config)5. 在路由器RouterB上配置靜態(tài)路由,命令如下:RouterB(configif)exitRouterB(config)ip route //配置路由器B的靜態(tài)路由RouterB(config)此時(shí),可以在RouterB上查看其路由表,查看路由表的命令如下:RouterBshow ip routeCodes: C connected, S static, I IGRP, R RIP, M mobile, B BGPD EIGRP, EX EIGRP external, O OSPF, IA OSPF inter areaN1 OSPF NSSA external type 1, N2 OSPF NSSA external type 2E1 OSPF external type 1, E2 OSPF external type 2, E EGPi ISIS, L1 ISIS level1, L2 ISIS level2, ia ISIS inter area* candidate default, U peruser static route, o ODRP periodic downloaded static routeGateway of last resort is not set , 2 subnetsS [1/0] via C is directly connected, FastEthernet0/0C , Serial0/3/0注意:以上信息中,S表示靜態(tài)路由,C表示直接連接的網(wǎng)絡(luò)路由。在RouterA上查看其路由表信息如下:RouterAshow ip routeCodes: C connected, S static, I IGRP, R RIP, M mobile, B BGPD EIGRP, EX EIGRP external, O OSPF, IA OSPF inter areaN1 OSPF NSSA external type 1, N2 OSPF NSSA external type 2E1 OSPF external type 1, E2 OSPF external type 2, E EGPi ISIS, L1 ISIS level1, L2 ISIS level2, ia ISIS inter area* candidate default, U peruser static route, o ODRP periodic downloaded static routeGateway of last resort is not set , 2