日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

3分钟配置好静态路由

發布時間:2025/3/20 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 3分钟配置好静态路由 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

實驗目的

1.?了解靜態路由的原理

2.?掌握靜態路由的配置

實驗任務

1.?任務1

2.?任務2

任務1:實驗拓撲

?

任務1:實驗需求

1.?根據實驗拓撲圖,完成設備的基本配置;

2.?在路由器R1、R2、R3上配置靜態路由,保證全網路由可達;

?

任務1:實驗步驟

步驟1:設備的基本配置

  • ?
  • ?
  • ?
配置PC1:VPCS> set pcname PC1 //設置主機名PC1> ip 192.168.1.1/24 192.168.1.254 //設置IP地址與網關
  • ?
  • ?
  • ?
  • ?
  • ?
配置PC2:VPCS> set pcname PC2PC2> ip 192.168.2.1/24 192.168.2.254
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
配置R1: Router>enableRouter#configure terminalRouter(config)#hostname R1R1(config)#no ip domain-lookupR1(config)#line console 0R1(config-line)#exec-timeout 0 0R1(config-line)#logging synchronousR1(config-line)#exitR1(config)#interface ethernet0/0R1(config-if)#ip address 192.168.1.254 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exitR1(config)#interface serial1/0R1(config-if)#ip address 192.168.12.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#endR1#
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
配置R2: Router>enableRouter#configure terminalRouter(config)#hostname R2R2(config)#no ip domain-lookupR2(config)#line console 0R2(config-line)#exec-timeout 0 0R2(config-line)#logging synchronousR2(config-line)#exitR2(config)#interface serial1/0R2(config-if)#ip address 192.168.12.2 255.255.255.0R2(config-if)#no shutdownR2(config-if)#exitR2(config)#interface serial1/1R2(config-if)#ip address 192.168.23.2 255.255.255.0R2(config-if)#no shutdownR2(config-if)#endR2#
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
配置R3: Router>enableRouter#configure terminalRouter(config)#hostname R3R3(config)#no ip domain-lookupR3(config)#line console 0R3(config-line)#exec-timeout 0 0R3(config-line)#logging synchronousR3(config-line)#exitR3(config)#interface ethernet0/0R3(config-if)#ip address 192.168.2.254 255.255.255.0R3(config-if)#no shutdownR3(config-if)#exitR3(config)#interface serial1/0R3(config-if)#ip address 192.168.23.3 255.255.255.0R3(config-if)#no shutdownR3(config-if)#endR3#

步驟2:檢查設備接口狀態

檢查PC1

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
PC1> show ipNAME : PC1[1]IP/MASK : 192.168.1.1/24GATEWAY : 192.168.1.254DNS :MAC : 00:50:79:66:68:04LPORT : 20000RHOST:PORT : 127.0.0.1:30000MTU : 1500

?

檢查R1:

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
R1#show ip interface briefInterface IP-Address OK? Method Status ProtocolEthernet0/0 192.168.1.254 YES manual up up Ethernet0/1 unassigned YES unset administratively down down Ethernet0/2 unassigned YES unset administratively down down Ethernet0/3 unassigned YES unset administratively down down Serial1/0 192.168.12.1 YES manual up up Serial1/1 unassigned YES unset administratively down down Serial1/2 unassigned YES unset administratively down down Serial1/3 unassigned YES unset administratively down down

?

檢查R2

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
R2#show ip interface briefInterface IP-Address OK? Method Status ProtocolEthernet0/0 unassigned YES unset administratively down down Ethernet0/1 unassigned YES unset administratively down down Ethernet0/2 unassigned YES unset administratively down down Ethernet0/3 unassigned YES unset administratively down down Serial1/0 192.168.12.2 YES manual up up Serial1/1 192.168.23.2 YES manual up up Serial1/2 unassigned YES unset administratively down down Serial1/3 unassigned YES unset administratively down down

?

檢查R3

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
R3#show ip interface briefInterface IP-Address OK? Method Status ProtocolEthernet0/0 192.168.2.254 YES manual up up Ethernet0/1 unassigned YES unset administratively down down Ethernet0/2 unassigned YES unset administratively down down Ethernet0/3 unassigned YES unset administratively down down Serial1/0 192.168.23.3 YES manual up up Serial1/1 unassigned YES unset administratively down down Serial1/2 unassigned YES unset administratively down down Serial1/3 unassigned YES unset administratively down down

?

檢查PC2

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
PC2> show ipNAME : PC2[1]IP/MASK : 192.168.2.1/24GATEWAY : 192.168.2.254DNS :MAC : 00:50:79:66:68:05LPORT : 20000RHOST:PORT : 127.0.0.1:30000MTU : 1500

?

步驟3:測試直連網絡的連通性

測試PC1跟網關的網絡連通性:

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
PC1> ping 192.168.1.25484 bytes from 192.168.1.254 icmp_seq=1 ttl=255 time=0.359 ms84 bytes from 192.168.1.254 icmp_seq=2 ttl=255 time=0.459 ms84 bytes from 192.168.1.254 icmp_seq=3 ttl=255 time=0.463 ms84 bytes from 192.168.1.254 icmp_seq=4 ttl=255 time=0.403 ms84 bytes from 192.168.1.254 icmp_seq=5 ttl=255 time=0.417 ms

測試R1跟R2之間的網絡連通性:

  • ?
  • ?
  • ?
  • ?
  • ?
R1#ping 192.168.12.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 8/9/10 ms

?

測試R2跟R3之間的網絡連通性:

  • ?
  • ?
  • ?
  • ?
  • ?
R2#ping 192.168.23.3Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/11 ms

?

測試PC2跟網關的網絡連通性:

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
PC2> ping 192.168.2.25484 bytes from 192.168.2.254 icmp_seq=1 ttl=255 time=0.469 ms84 bytes from 192.168.2.254 icmp_seq=2 ttl=255 time=0.484 ms84 bytes from 192.168.2.254 icmp_seq=3 ttl=255 time=0.518 ms84 bytes from 192.168.2.254 icmp_seq=4 ttl=255 time=0.400 ms84 bytes from 192.168.2.254 icmp_seq=5 ttl=255 time=0.405 ms注意,雖然設備之間的網絡連通性正常了,但是PC1和PC2之間的網絡是不可達的:PC1> ping 192.168.2.1*192.168.1.254 icmp_seq=1 ttl=255 time=0.345 ms (ICMP type:3, code:1, Destination host unreachable)*192.168.1.254 icmp_seq=2 ttl=255 time=0.462 ms (ICMP type:3, code:1, Destination host unreachable)*192.168.1.254 icmp_seq=3 ttl=255 time=0.543 ms (ICMP type:3, code:1, Destination host unreachable)*192.168.1.254 icmp_seq=4 ttl=255 time=0.494 ms (ICMP type:3, code:1, Destination host unreachable)*192.168.1.254 icmp_seq=5 ttl=255 time=0.467 ms (ICMP type:3, code:1, Destination host unreachable)因為PC1把數據包發送給R1后,R1沒有到達網絡192.168.2.0/24的路由,所以R1無法轉發數據包。

?

檢查R1的路由表:

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
R1#show ip routeCodes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfRGateway of last resort is not set 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.1.0/24 is directly connected, Ethernet0/0L 192.168.1.254/32 is directly connected, Ethernet0/0 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.12.0/24 is directly connected, Serial1/0L 192.168.12.1/32 is directly connected, Serial1/0R1只有兩條直連路由,分別是192.168.1.0/24和192.168.12.0/24。因此,我們需要在R1上配置去往192.168.2.0/24的靜態路由。

?

步驟4:配置靜態路由

配置R1

  • ?
  • ?
  • ?
R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.12.2//當然也可以跟出接口路由要有去有回網絡才能通,所以R3上要配置回程路由。

?

配置R3

  • ?
  • ?
  • ?
R3(config)#ip route 192.168.1.0 255.255.255.0 serial 1/0//當然也可以跟下一跳另外,沿途的路由器也要有去往源和目標網絡的路由。

?

配置R2

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.12.1//當然也可以跟出接口R2(config)#ip route 192.168.2.0 255.255.255.0 192.168.23.3//當然也可以跟出接口這樣當PC1把數據包發送給R1時,R1查路由表:R1#show ip routeCodes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfRGateway of last resort is not set 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.1.0/24 is directly connected, Ethernet0/0L 192.168.1.254/32 is directly connected, Ethernet0/0S 192.168.2.0/24 [1/0] via 192.168.12.2 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.12.0/24 is directly connected, Serial1/0L 192.168.12.1/32 is directly connected, Serial1/0R1有到達網絡192.168.2.0/24的路由,所以R1把數據包發送給下一跳R2,R2檢查路由表:R2#show ip routeCodes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfRGateway of last resort is not setS 192.168.1.0/24 [1/0] via 192.168.12.1S 192.168.2.0/24 [1/0] via 192.168.23.3 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.12.0/24 is directly connected, Serial1/0L 192.168.12.2/32 is directly connected, Serial1/0 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.23.0/24 is directly connected, Serial1/1L 192.168.23.2/32 is directly connected, Serial1/1R2有到達網絡192.168.2.0/24的路由,所以R2把數據包發送給下一跳R3,R3檢查路由表:R3#show ip routeCodes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfRGateway of last resort is not setS 192.168.1.0/24 is directly connected, Serial1/0 192.168.2.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.2.0/24 is directly connected, Ethernet0/0L 192.168.2.254/32 is directly connected, Ethernet0/0 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.23.0/24 is directly connected, Serial1/0L 192.168.23.3/32 is directly connected, Serial1/0R3上192.168.2.0/24是自己的直連網絡,所以R3把數據包直接發給PC2?;爻虜祿霓D發原理一樣,這里不再撰述。

?

步驟5:測試PC1跟PC2的網絡連通性

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
PC1> ping 192.168.2.184 bytes from 192.168.2.1 icmp_seq=1 ttl=61 time=22.503 ms84 bytes from 192.168.2.1 icmp_seq=2 ttl=61 time=18.859 ms84 bytes from 192.168.2.1 icmp_seq=3 ttl=61 time=19.251 ms84 bytes from 192.168.2.1 icmp_seq=4 ttl=61 time=19.350 ms84 bytes from 192.168.2.1 icmp_seq=5 ttl=61 time=17.856 ms因為需求要求全網路由可達;如果這個時候在R1上Ping PC2,能不能通呢?不能!在R1上Ping PC2,數據包源地址是192.168.12.1,數據包能到達PC2,但是回不來,因為R3上沒有到達192.168.12.0/24的路由;同理,R3上Ping PC1也不通,因為R1沒有到達192.168.23.0/24的路由。

?

檢查R3的路由表:

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
R3#show ip routeCodes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfRGateway of last resort is not setS 192.168.1.0/24 is directly connected, Serial1/0 192.168.2.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.2.0/24 is directly connected, Ethernet0/0L 192.168.2.254/32 is directly connected, Ethernet0/0 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.23.0/24 is directly connected, Serial1/0L 192.168.23.3/32 is directly connected, Serial1/0R3沒有到達網絡192.168.12.0/24的路由。

?

配置R3

  • ?
  • ?
R3(config)#ip route 192.168.12.0 255.255.255.0 192.168.23.2//當然也可以跟出接口

同理,配置R1

  • ?
  • ?
R1(config)#ip route 192.168.23.0 255.255.255.0 serial 1/0//當然也可以跟下一跳

?

檢查R1的路由表:

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
R1#show ip routeCodes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfRGateway of last resort is not set 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.1.0/24 is directly connected, Ethernet0/0L 192.168.1.254/32 is directly connected, Ethernet0/0S 192.168.2.0/24 [1/0] via 192.168.12.2 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.12.0/24 is directly connected, Serial1/0L 192.168.12.1/32 is directly connected, Serial1/0S 192.168.23.0/24 is directly connected, Serial1/0R1有到達192.168.2.0/24和192.168.23.0/24的路由。

?

檢查R3的路由表:

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
R3#show ip routeCodes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfRGateway of last resort is not setS 192.168.1.0/24 is directly connected, Serial1/0 192.168.2.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.2.0/24 is directly connected, Ethernet0/0L 192.168.2.254/32 is directly connected, Ethernet0/0S 192.168.12.0/24 [1/0] via 192.168.23.2 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.23.0/24 is directly connected, Serial1/0L 192.168.23.3/32 is directly connected, Serial1/0R3有到達192.168.1.0/24和192.168.12.0/24的路由。

?

步驟6:測試網絡連通性

在PC1上測試:

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
PC1> ping 192.168.2.184 bytes from 192.168.2.1 icmp_seq=1 ttl=61 time=21.429 ms84 bytes from 192.168.2.1 icmp_seq=2 ttl=61 time=18.079 ms84 bytes from 192.168.2.1 icmp_seq=3 ttl=61 time=19.108 ms84 bytes from 192.168.2.1 icmp_seq=4 ttl=61 time=19.006 ms84 bytes from 192.168.2.1 icmp_seq=5 ttl=61 time=18.163 msPC1> ping 192.168.23.384 bytes from 192.168.23.3 icmp_seq=1 ttl=253 time=18.265 ms84 bytes from 192.168.23.3 icmp_seq=2 ttl=253 time=18.186 ms84 bytes from 192.168.23.3 icmp_seq=3 ttl=253 time=18.184 ms84 bytes from 192.168.23.3 icmp_seq=4 ttl=253 time=18.257 ms84 bytes from 192.168.23.3 icmp_seq=5 ttl=253 time=18.240 msPC1> ping 192.168.12.284 bytes from 192.168.12.2 icmp_seq=1 ttl=254 time=9.899 ms84 bytes from 192.168.12.2 icmp_seq=2 ttl=254 time=9.380 ms84 bytes from 192.168.12.2 icmp_seq=3 ttl=254 time=9.159 ms84 bytes from 192.168.12.2 icmp_seq=4 ttl=254 time=9.300 ms84 bytes from 192.168.12.2 icmp_seq=5 ttl=254 time=9.268 ms

任務2:實驗拓撲?

?

任務2:實驗需求

1.?在R1和R3上刪除任務1的靜態路由;

2.?在路由器R1、R3上配置默認路由,使得全網路由可達。

?

任務2:實驗步驟

步驟1:刪除R1和R3上的靜態路由并配置默認路由

配置R1

  • ?
  • ?
  • ?
R1(config)#no ip route 192.168.2.0 255.255.255.0 192.168.12.2R1(config)#no ip route 192.168.23.0 255.255.255.0 Serial1/0R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2

?

配置R3:

  • ?
  • ?
  • ?
R3(config)#no ip route 192.168.1.0 255.255.255.0 Serial1/0R3(config)#no ip route 192.168.12.0 255.255.255.0 192.168.23.2R3(config)#ip route 0.0.0.0 0.0.0.0 192.168.23.2

?

步驟2:檢查默認路由

檢查R1

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
R1#show ip routeCodes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfRGateway of last resort is 192.168.12.2 to network 0.0.0.0S* 0.0.0.0/0 [1/0] via 192.168.12.2 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.1.0/24 is directly connected, Ethernet0/0L 192.168.1.254/32 is directly connected, Ethernet0/0 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.12.0/24 is directly connected, Serial1/0L 192.168.12.1/32 is directly connected, Serial1/0檢查R3:R3#show ip routeCodes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfRGateway of last resort is 192.168.23.2 to network 0.0.0.0S* 0.0.0.0/0 [1/0] via 192.168.23.2 192.168.2.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.2.0/24 is directly connected, Ethernet0/0L 192.168.2.254/32 is directly connected, Ethernet0/0 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masksC 192.168.23.0/24 is directly connected, Serial1/0L 192.168.23.3/32 is directly connected, Serial1/0

?

步驟3:網絡連通性測試

  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
  • ?
PC1> ping 192.168.2.184 bytes from 192.168.2.1 icmp_seq=1 ttl=61 time=20.698 ms84 bytes from 192.168.2.1 icmp_seq=2 ttl=61 time=19.478 ms84 bytes from 192.168.2.1 icmp_seq=3 ttl=61 time=18.593 ms84 bytes from 192.168.2.1 icmp_seq=4 ttl=61 time=19.404 ms84 bytes from 192.168.2.1 icmp_seq=5 ttl=61 time=19.616 msPC1> ping 192.168.23.384 bytes from 192.168.23.3 icmp_seq=1 ttl=253 time=22.048 ms84 bytes from 192.168.23.3 icmp_seq=2 ttl=253 time=20.271 ms84 bytes from 192.168.23.3 icmp_seq=3 ttl=253 time=19.362 ms84 bytes from 192.168.23.3 icmp_seq=4 ttl=253 time=20.110 ms84 bytes from 192.168.23.3 icmp_seq=5 ttl=253 time=21.321 msPC1> ping 192.168.12.284 bytes from 192.168.12.2 icmp_seq=1 ttl=254 time=10.201 ms84 bytes from 192.168.12.2 icmp_seq=2 ttl=254 time=10.220 ms84 bytes from 192.168.12.2 icmp_seq=3 ttl=254 time=8.304 ms84 bytes from 192.168.12.2 icmp_seq=4 ttl=254 time=9.170 ms84 bytes from 192.168.12.2 icmp_seq=5 ttl=254 time=10.084 ms

?

總結

以上是生活随笔為你收集整理的3分钟配置好静态路由的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。