經典的靜態路由的實驗

 

經典的靜態路由的實驗
1:網絡拓撲
 

實驗要求:使用4條靜態路由使得全網互通。
具體配置如下:
R0路由器
r0#show running-config
hostname r0
interface Loopback0
 ip address 5.5.5.5 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 1.1.1.1 255.255.255.252
 clock rate 9600
!
interface Serial0/0/1
 ip address 4.4.4.2 255.255.255.252
 clock rate 9600
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 1.1.1.2
line con 0
line vty 0 4
 login
r0#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - 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 - ODR
       P - periodic downloaded static route
 
Gateway of last resort is 1.1.1.2 to network 0.0.0.0
 
     1.0.0.0/30 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Serial0/0/0
     4.0.0.0/30 is subnetted, 1 subnets
C       4.4.4.0 is directly connected, Serial0/0/1
     5.0.0.0/24 is subnetted, 1 subnets
C       5.5.5.0 is directly connected, Loopback0
S*   0.0.0.0/0 [1/0] via 1.1.1.2
r0#
R1路由器
r1#show running-config
hostname r1
interface Loopback0
 ip address 6.6.6.6 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 1.1.1.2 255.255.255.252
!
interface Serial0/0/1
 ip address 2.2.2.1 255.255.255.252
 clock rate 9600
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 2.2.2.2
line con 0
line vty 0 4
 login
!
r1#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - 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 - ODR
       P - periodic downloaded static route
 
Gateway of last resort is 2.2.2.2 to network 0.0.0.0
 
     1.0.0.0/30 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Serial0/0/0
     2.0.0.0/30 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Serial0/0/1
     6.0.0.0/24 is subnetted, 1 subnets
C       6.6.6.0 is directly connected, Loopback0
S*   0.0.0.0/0 [1/0] via 2.2.2.2
r1#
R2路由器
r2#show running-config
hostname r2
interface Loopback0
 ip address 7.7.7.7 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 2.2.2.2 255.255.255.252
!
interface Serial0/0/1
 ip address 3.3.3.1 255.255.255.252
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 3.3.3.2
line con 0
line vty 0 4
 login
!
!
!
end
r2#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - 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 - ODR
       P - periodic downloaded static route
 
Gateway of last resort is 3.3.3.2 to network 0.0.0.0
 
     2.0.0.0/30 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Serial0/0/0
     3.0.0.0/30 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Serial0/0/1
     7.0.0.0/24 is subnetted, 1 subnets
C       7.7.7.0 is directly connected, Loopback0
S*   0.0.0.0/0 [1/0] via 3.3.3.2
r2#
R3路由器
r3#show running-config
hostname r3
interface Loopback0
 ip address 8.8.8.8 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 4.4.4.1 255.255.255.252
!
interface Serial0/0/1
 ip address 3.3.3.2 255.255.255.252
 clock rate 9600
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 4.4.4.2
line con 0
line vty 0 4
 login
!
!
!
end
r3#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - 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 - ODR
       P - periodic downloaded static route
 
Gateway of last resort is 4.4.4.2 to network 0.0.0.0
 
     3.0.0.0/30 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Serial0/0/1
     4.0.0.0/30 is subnetted, 1 subnets
     4.4.4.0 is directly connected, Serial0/0/0
     8.0.0.0/24 is subnetted, 1 subnets
C       8.8.8.0 is directly connected, Loopback0
S*   0.0.0.0/0 [1/0] via 4.4.4.2
測試:用r0路由器ping r3路由器上的8.8.8.8
r0#ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 ms
r0#traceroute 8.8.8.8//追蹤數據包的走向
Type escape sequence to abort.
Tracing the route to 8.8.8.8
 1   1.1.1.2         31 msec   31 msec   32 msec  
 2   3.3.3.1         63 msec   47 msec   63 msec  
 3   3.3.3.2         63 msec   62 msec   62 msec  
r0#
實驗總結:默認路由會給我們帶來意想不到的好處。

歡迎加入鄭州陽仔的網絡工程師自由交流羣--132444800(請註明自己的身份,就說是51cto的博友)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章