A-A+

使用4条静态路由实现全网互通的实验

2015年11月20日 站长资讯 暂无评论

这是一个采用4台路由器组成一个环形网络的默认路由实验,目的是为了实现4条静态路由器,并且全网实现互联互通。下面是拓扑图、简单说明和全部配置:

1:网络拓扑如下

实验要求:使用4条静态路由使得全网互通。

具体配置如下:

R0路由器

  1. r0#show running-config  
  2. hostname r0  
  3. interface Loopback0  
  4.  ip address 5.5.5.5 255.255.255.0  
  5. !  
  6. interface FastEthernet0/0  
  7.  no ip address  
  8.  duplex auto  
  9.  speed auto  
  10.  shutdown  
  11. !  
  12. interface FastEthernet0/1  
  13.  no ip address  
  14.  duplex auto  
  15.  speed auto  
  16.  shutdown  
  17. !  
  18. interface Serial0/0/0  
  19.  ip address 1.1.1.1 255.255.255.252  
  20.  clock rate 9600  
  21. !  
  22. interface Serial0/0/1  
  23.  ip address 4.4.4.2 255.255.255.252  
  24.  clock rate 9600  
  25. !  
  26. interface Vlan1  
  27.  no ip address  
  28.  shutdown  
  29. !  
  30. ip classless  
  31. ip route 0.0.0.0 0.0.0.0 1.1.1.2  
  32. line con 0  
  33. line vty 0 4  
  34.  login  
  35. r0#show ip route  
  36. Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP  
  37.        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area  
  38.        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2  
  39.        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP  
  40.        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area  
  41.        * - candidate default, U - per-user static route, o - ODR  
  42.        P - periodic downloaded static route  
  43.    
  44. Gateway of last resort is 1.1.1.2 to network 0.0.0.0  
  45.    
  46.      1.0.0.0/30 is subnetted, 1 subnets  
  47. C       1.1.1.0 is directly connected, Serial0/0/0  
  48.      4.0.0.0/30 is subnetted, 1 subnets  
  49. C       4.4.4.0 is directly connected, Serial0/0/1  
  50.      5.0.0.0/24 is subnetted, 1 subnets  
  51. C       5.5.5.0 is directly connected, Loopback0  
  52. S*   0.0.0.0/0 [1/0] via 1.1.1.2  
  53. r0#  

R1路由器

  1. r1#show running-config  
  2. hostname r1  
  3. interface Loopback0  
  4.  ip address 6.6.6.6 255.255.255.0  
  5. !  
  6. interface FastEthernet0/0  
  7.  no ip address  
  8.  duplex auto  
  9.  speed auto  
  10.  shutdown  
  11. !  
  12. interface FastEthernet0/1  
  13.  no ip address  
  14.  duplex auto  
  15.  speed auto  
  16.  shutdown  
  17. !  
  18. interface Serial0/0/0  
  19.  ip address 1.1.1.2 255.255.255.252  
  20. !  
  21. interface Serial0/0/1  
  22.  ip address 2.2.2.1 255.255.255.252  
  23.  clock rate 9600  
  24. !  
  25. interface Vlan1  
  26.  no ip address  
  27.  shutdown  
  28. !  
  29. ip classless  
  30. ip route 0.0.0.0 0.0.0.0 2.2.2.2  
  31. line con 0  
  32. line vty 0 4  
  33.  login  
  34. !  
  35. r1#show ip route  
  36. Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP  
  37.        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area  
  38.        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2  
  39.        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP  
  40.        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area  
  41.        * - candidate default, U - per-user static route, o - ODR  
  42.        P - periodic downloaded static route  
  43.    
  44. Gateway of last resort is 2.2.2.2 to network 0.0.0.0  
  45.    
  46.      1.0.0.0/30 is subnetted, 1 subnets  
  47. C       1.1.1.0 is directly connected, Serial0/0/0  
  48.      2.0.0.0/30 is subnetted, 1 subnets  
  49. C       2.2.2.0 is directly connected, Serial0/0/1  
  50.      6.0.0.0/24 is subnetted, 1 subnets  
  51. C       6.6.6.0 is directly connected, Loopback0   
  52. http://www.xiaoxiongboke.com   
  53. S*   0.0.0.0/0 [1/0] via 2.2.2.2  
  54. r1#  

R2路由器

  1. r2#show running-config  
  2. hostname r2  
  3. interface Loopback0  
  4.  ip address 7.7.7.7 255.255.255.0  
  5. !  
  6. interface FastEthernet0/0  
  7.  no ip address  
  8.  duplex auto  
  9.  speed auto  
  10.  shutdown  
  11. !  
  12. interface FastEthernet0/1  
  13.  no ip address  
  14.  duplex auto  
  15.  speed auto  
  16.  shutdown  
  17. !  
  18. interface Serial0/0/0  
  19.  ip address 2.2.2.2 255.255.255.252  
  20. !  
  21. interface Serial0/0/1  
  22.  ip address 3.3.3.1 255.255.255.252  
  23. !  
  24. interface Vlan1  
  25.  no ip address  
  26.  shutdown  
  27. !  
  28. ip classless  
  29. ip route 0.0.0.0 0.0.0.0 3.3.3.2  
  30. line con 0  
  31. line vty 0 4  
  32.  login  
  33. !  
  34. !  
  35. !  
  36. end  
  37. r2#show ip route  
  38. Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP  
  39.        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area  
  40.        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2  
  41.        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP  
  42.        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area  
  43.        * - candidate default, U - per-user static route, o - ODR  
  44.        P - periodic downloaded static route  
  45.    
  46. Gateway of last resort is 3.3.3.2 to network 0.0.0.0  
  47.    
  48.      2.0.0.0/30 is subnetted, 1 subnets  
  49. C       2.2.2.0 is directly connected, Serial0/0/0  
  50.      3.0.0.0/30 is subnetted, 1 subnets  
  51. C       3.3.3.0 is directly connected, Serial0/0/1  
  52.      7.0.0.0/24 is subnetted, 1 subnets  
  53. C       7.7.7.0 is directly connected, Loopback0  
  54. S*   0.0.0.0/0 [1/0] via 3.3.3.2  
  55. r2#  

R3路由器

  1. r3#show running-config  
  2. hostname r3  
  3. interface Loopback0  
  4.  ip address 8.8.8.8 255.255.255.0  
  5. !  
  6. interface FastEthernet0/0  
  7.  no ip address  
  8.  duplex auto  
  9.  speed auto  
  10.  shutdown  
  11. !  
  12. interface FastEthernet0/1  
  13.  no ip address  
  14.  duplex auto  
  15.  speed auto  
  16.  shutdown  
  17. !  
  18. interface Serial0/0/0  
  19.  ip address 4.4.4.1 255.255.255.252  
  20. !  
  21. interface Serial0/0/1  
  22.  ip address 3.3.3.2 255.255.255.252  
  23.  clock rate 9600  
  24. !  
  25. interface Vlan1  
  26.  no ip address  
  27.  shutdown  
  28. !  
  29. ip classless  
  30. ip route 0.0.0.0 0.0.0.0 4.4.4.2  
  31. line con 0  
  32. line vty 0 4  
  33.  login  
  34. !  
  35. !  
  36. !  
  37. end  
  38. r3#show ip route  
  39. Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP  
  40.        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area  
  41.        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2  
  42.        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP  
  43.        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area  
  44.        * - candidate default, U - per-user static route, o - ODR  
  45.        P - periodic downloaded static route  
  46.    
  47. Gateway of last resort is 4.4.4.2 to network 0.0.0.0  
  48.    
  49.      3.0.0.0/30 is subnetted, 1 subnets  
  50. C       3.3.3.0 is directly connected, Serial0/0/1  
  51.      4.0.0.0/30 is subnetted, 1 subnets  
  52. C      4.4.4.0 is directly connected, Serial0/0/0  
  53.      8.0.0.0/24 is subnetted, 1 subnets  
  54. C       8.8.8.0 is directly connected, Loopback0  
  55. S*   0.0.0.0/0 [1/0] via 4.4.4.2  

测试:用r0路由器ping r3路由器上的8.8.8.8

  1. r0#ping 8.8.8.8  
  2. Type escape sequence to abort.  
  3. Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:  
  4. !!!!!  
  5. Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 ms  
  6. r0#traceroute 8.8.8.8//追踪数据包的走向  
  7. Type escape sequence to abort.  
  8. Tracing the route to 8.8.8.8  
  9.  1   1.1.1.2         31 msec   31 msec   32 msec    
  10.  2   3.3.3.1         63 msec   47 msec   63 msec    
  11.  3   3.3.3.2         63 msec   62 msec   62 msec    
  12. r0#  

实验总结:默认路由会给我们带来意想不到的好处。

标签:

给我留言