靜態路由的配置方法和技巧

來源:酷知科普網 2.65W

學校有新舊兩個校區,每個校區是一個獨立的區域網,為了使新舊校區能夠正常相互通訊,共享資源。每個校區出口利用一臺路由器進行連線,兩臺路由器間學校申請了一條專線進行相連,要求做適當配置實現兩個校區的正常相互訪問。

靜態路由的配置方法和技巧

操作方法

(01)配置計算機PC1:IP:   Submask:  Gateway:  

靜態路由的配置方法和技巧 第2張

(02)配置計算機PC2:IP:Submask:Gateway:

靜態路由的配置方法和技巧 第3張

(03)測試連通性PC1 ping PC2Ping

靜態路由的配置方法和技巧 第4張

(04)配置路由器R1Router>enRouter#conf tRouter(config)#hostname R1R1(config)#int fa1/0R1(config-if)#no shutR1(config-if)#R1(config-if)#ip address R1(config-if)#exitR1(config)#int s2/0R1(config-if)#ip address R1(config-if)#clock rate 64000R1(config-if)#no shutR1(config-if)#endR1#clock rate 64000(必須配置時鐘才可通訊)

靜態路由的配置方法和技巧 第5張

(05)配置路由器R2R2>enR2#conf tR2(config)#hostname R2R2(config)#int fa1/0R2(config-if)#ip address R2(config-if)#no shutR2(config-if)#R2(config-if)#exitR2(config)#int s2/0R2(config-if)#ip address R2(config-if)#no shutR2(config-if)#R2(config-if)#clock rate 64000This command applies only to DCE interfacesR2(config-if)#R2(config-if)#endR2#

靜態路由的配置方法和技巧 第6張

(06)配置R1路由:R1>enR1#conf tR1(config)#ip route R1(config)#endR1#R1#show 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 - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC     is directly connected, FastEthernet1/0S     [1/0] via C     is directly connected, Serial2/0R1#

靜態路由的配置方法和技巧 第7張

(07)配置路由R2R2>enR2#conf tEnter configuration commands, one per line.  End with CNTL/Z.R2(config)#ip route R2(config)#endR2#R2#show 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 - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setS     [1/0] via C     is directly connected, FastEthernet1/0C     is directly connected, Serial2/0

靜態路由的配置方法和技巧 第8張

(08)測試連通性:PC1 Ping PC2Ping

靜態路由的配置方法和技巧 第9張

特別提示

靜態路由是指有網路管理員手工配置的路由資訊。

靜態路由除了具有簡單、高效、可靠的優點外,它的另一個好處是網路安全保密性高。

預設路由可以看做是靜態路由的一種特殊情況。當資料在查詢路由表時,沒有找到和目標相匹配的路由表項時,為資料指定路由。

路由器屬於網路層裝置,能夠根據IP包頭的資訊,選擇一條最佳路徑,將資料包轉發出去。實現不同網段的主機之間的互相訪問。路由器是根據路由表進行選路和轉發的。而路由表裡就是由一條條路由資訊組成。

熱門標籤