A-A+

EIGRP默认路由的下放的实验和基础配置

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

实验拓扑如下,路由器R1、R2、R3为内部路由器,而R4为外部路由,实验目的为AS内部路由器发放默认路由。

基础配置如下:

  1. R1:  
  2. interface Loopback0  
  3.  ip address 1.1.1.1 255.255.255.0  
  4. !  
  5. interface FastEthernet0/0  
  6.  ip address 12.1.1.1 255.255.255.0  
  7. !  
  8. router eigrp 90  
  9.  network 0.0.0.0  
  10.  no auto-summary  
  11. !  
  12. =============================  
  13. R2:  
  14. interface Loopback0  
  15.  ip address 2.2.2.2 255.255.255.0  
  16. !  
  17. interface FastEthernet0/0  
  18.  ip address 23.1.1.2 255.255.255.0  
  19. !  
  20. interface FastEthernet0/1  
  21.  ip address 12.1.1.2 255.255.255.0  
  22. !  
  23. router eigrp 90  
  24.  network 0.0.0.0  
  25.  no auto-summary  
  26. =============================  
  27. R3:  
  28. interface Loopback0  
  29.  ip address 3.3.3.3 255.255.255.0  
  30. !  
  31. interface FastEthernet0/1  
  32.  ip address 23.1.1.3 255.255.255.0  
  33. !  
  34. interface Serial1/0  
  35.  ip address 34.1.1.3 255.255.255.0  
  36. !  
  37. router eigrp 90  
  38.  network 23.1.1.3 0.0.0.0   
  39.  no auto-summary  
  40. ===========================  
  41. R4:  
  42. interface Loopback0  
  43.  ip address 4.4.4.4 255.255.255.0  
  44. !  
  45. interface Serial1/1  
  46.  ip address 34.1.1.4 255.255.255.0  
  47. !  
  48. ip route 0.0.0.0 0.0.0.0 Serial1/1 34.1.1.3  
  49. =====================  

方法1:通过在AS边界路由器R3上重分发静态的方式引入默认路由

在R3配置如下:

  1. R3:  
  2. ip route 0.0.0.0 0.0.0.0 Serial1/0 34.1.1.4  
  3. Router eigrp 90  
  4.  Redistribute static  
  5. R1:  
  6. R1#show ip rou  
  7. <ommit output>  
  8. Gateway of last resort is 12.1.1.2 to network 0.0.0.0  
  9.    
  10.      1.0.0.0/24 is subnetted, 1 subnets  
  11. C       1.1.1.0 is directly connected, Loopback0  
  12.      2.0.0.0/24 is subnetted, 1 subnets  
  13. D       2.2.2.0 [90/409600] via 12.1.1.2, 00:15:47, FastEthernet0/0  
  14.      23.0.0.0/24 is subnetted, 1 subnets   
  15. D       23.1.1.0 [90/307200] via 12.1.1.2, 00:14:57, FastEthernet0/0  
  16.      12.0.0.0/24 is subnetted, 1 subnets  
  17. C       12.1.1.0 is directly connected, FastEthernet0/0  
  18. D*EX 0.0.0.0/0 [170/2221056] via 12.1.1.2, 00:03:44, FastEthernet0/0  

方法2:通过手工宣告默认静态路由,只是该路由不能指定下一跳

  1. R3:  
  2. Ip route 0.0.0.0 0.0.0.0 serial 1/0  
  3. Router eigrp 90  
  4.  Network 0.0.0.0  
  5. R1:  
  6. R1#show ip rou  
  7. <ommit output>  
  8. Gateway of last resort is 12.1.1.2 to network 0.0.0.0  
  9.    
  10.      34.0.0.0/24 is subnetted, 1 subnets  
  11. D       34.1.1.0 [90/2221056] via 12.1.1.2, 00:02:57, FastEthernet0/0  
  12.      1.0.0.0/24 is subnetted, 1 subnets  
  13. C       1.1.1.0 is directly connected, Loopback0  
  14.      2.0.0.0/24 is subnetted, 1 subnets   
  15. D       2.2.2.0 [90/409600] via 12.1.1.2, 00:23:44, FastEthernet0/0  
  16.      3.0.0.0/24 is subnetted, 1 subnets  
  17. D       3.3.3.0 [90/435200] via 12.1.1.2, 00:02:57, FastEthernet0/0  
  18.      23.0.0.0/24 is subnetted, 1 subnets  
  19. D       23.1.1.0 [90/307200] via 12.1.1.2, 00:22:55, FastEthernet0/0  
  20.      12.0.0.0/24 is subnetted, 1 subnets  
  21. C       12.1.1.0 is directly connected, FastEthernet0/0  
  22. D*   0.0.0.0/0 [90/2221056] via 12.1.1.2, 00:00:03, FastEthernet0/0  

方法3:使用ip default-network x.x.x.x,注意在使用该方法时边界路由器上要满足三个条件,条件一:路由表中必须要有该主类路由条目(该主类的子网路由不算),条件二:宣告时要同RIP一样宣告该主类网络,条件三:ip default-netwok 后的网络也必须是主类网络

  1. D*   0.0.0.0/0 [90/2221056] via 12.1.1.2, 00:00:03, FastEthernet0/0   
  2. R3:  
  3. Ip default-network 34.0.0.0  
  4. Ip route 34.0.0.0 255.0.0.0 serial 1/0 34.1.1.4   //R3并没有该主类网络路由  
  5. Router eigrp 90  
  6.  Network 34.0.0.0  
  7. R1:  
  8. R1#show ip route   
  9. <ommit output>  
  10. Gateway of last resort is 12.1.1.2 to network 34.0.0.0  
  11.      34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks  
  12. D       34.1.1.0/24 [90/2221056] via 12.1.1.2, 00:02:11, FastEthernet0/0  
  13. D*      34.0.0.0/8 [90/2221056] via 12.1.1.2, 00:00:14, FastEthernet0/0  
  14.      1.0.0.0/24 is subnetted, 1 subnets  
  15. C       1.1.1.0 is directly connected, Loopback0  
  16.      2.0.0.0/24 is subnetted, 1 subnets  
  17. D       2.2.2.0 [90/409600] via 12.1.1.2, 00:02:11, FastEthernet0/0  
  18.      23.0.0.0/24 is subnetted, 1 subnets  
  19. D       23.1.1.0 [90/307200] via 12.1.1.2, 00:02:11, FastEthernet0/0   
  20.      12.0.0.0/24 is subnetted, 1 subnets  
  21. C       12.1.1.0 is directly connected, FastEthernet0/0  

其实我们不一定非要指定外网出接口作为默认网络,可以使用环回接口作默认网络可可控性也很强,只写出简单配置:

  1. C       12.1.1.0 is directly connected, FastEthernet0/0  
  2. R3:  
  3. Ip default-network 192.168.10.0  
  4. Interface loopback 1  
  5.  Ip address 192.168.10.1 255.255.255.0  
  6. Router eigrp 90  
  7.  Network 192.168.10.0  
  8. R1:  
  9. R1#show ip rou  
  10. <ommit output>  
  11. Gateway of last resort is 12.1.1.2 to network 192.168.10.0  
  12.    
  13.      1.0.0.0/24 is subnetted, 1 subnets  
  14. C       1.1.1.0 is directly connected, Loopback0  
  15.      2.0.0.0/24 is subnetted, 1 subnets  
  16. D       2.2.2.0 [90/409600] via 12.1.1.2, 00:08:12, FastEthernet0/0  
  17. D*   192.168.10.0/24 [90/435200] via 12.1.1.2, 00:00:08, FastEthernet0/0   
  18.      23.0.0.0/24 is subnetted, 1 subnets  
  19. D       23.1.1.0 [90/307200] via 12.1.1.2, 00:08:12, FastEthernet0/0  
  20.      12.0.0.0/24 is subnetted, 1 subnets  
  21. C       12.1.1.0 is directly connected, FastEthernet0/0  

和上面做出比较,环回接口更加稳定,此外可以减小一个路由条目,内网不需要公网的参与,编址也有所优化,在网络中只有使用ip defaul-netwok下放的不是全0的默认路由

方法4:由于EIGRP支持CIDR,而CIDR的极限就是0.0.0.0/0

  1. C       12.1.1.0 is directly connected, FastEthernet0/0  
  2. R3:  
  3. Interface fastethernet 0/1  
  4. Ip summary-address eigrp 90 0.0.0.0 0.0.0.0  
  5. R1:  
  6. R1#show ip rou  
  7. <ommit output>  
  8. Gateway of last resort is 12.1.1.2 to network 0.0.0.0  
  9.    
  10.      1.0.0.0/24 is subnetted, 1 subnets  
  11. C       1.1.1.0 is directly connected, Loopback0  
  12.   
  13.   
  14.      2.0.0.0/24 is subnetted, 1 subnets  
  15. D       2.2.2.0 [90/409600] via 12.1.1.2, 00:16:44, FastEthernet0/0  
  16.      23.0.0.0/24 is subnetted, 1 subnets  
  17. D       23.1.1.0 [90/307200] via 12.1.1.2, 00:16:44, FastEthernet0/0  
  18.      12.0.0.0/24 is subnetted, 1 subnets  
  19. C       12.1.1.0 is directly connected, FastEthernet0/0  
  20. D*   0.0.0.0/0 [90/332800] via 12.1.1.2, 00:00:02, FastEthernet0/0  
标签:

给我留言