<b>EIGRP区域注入静态路由的三种方法</b>
拓扑图
<a href="http://blog.51cto.com/attachment/201202/160519185.png" target="_blank"></a>
R2为外网,R1为边界路由器。R3,R4为内部路由器
基本配置
R2配置:
R2#sh run
Building configuration...
Current configuration : 794 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
hostname R2
boot-start-marker
boot-end-marker
enable password cisco
no aaa new-model
memory-size iomem 5
ip cef
no ip domain lookup
interface Loopback0
ip address 2.2.2.2 255.255.255.0
interface Serial0/0
ip address 12.1.1.2 255.255.255.0
serial restart-delay 0
interface Serial0/1
no ip address
shutdown
interface Serial0/2
interface Serial0/3
ip http server
control-plane
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
end
R1配置:
R1#sh ru
*Mar 1 00:21:11.123: %SYS-5-CONFIG_I: Configured from console by console
R1#sh run
Current configuration : 1011 bytes
hostname R1
ip address 1.1.1.1 255.255.255.0
ip address 12.1.1.1 255.255.255.0
ip address 13.1.1.1 255.255.255.0
router eigrp 90
redistribute static
network 1.1.1.0 0.0.0.255
network 13.1.1.0 0.0.0.255
no auto-summary
ip route 0.0.0.0 0.0.0.0 Serial0/0
R3配置
R3#sh running-config
Current configuration : 922 bytes
hostname R3
ip address 3.3.3.3 255.255.255.0
ip address 35.1.1.3 255.255.255.0
ip address 13.1.1.3 255.255.255.0
network 3.3.3.0 0.0.0.255
network 35.1.1.0 0.0.0.255
方法一:
重分布
边界路由上做静态路由,然后重分布到内部路由器和三层交换机
在EIGRP进程中redistribute static
R3上路由表
<a href="http://blog.51cto.com/attachment/201202/160602302.png" target="_blank"></a>
方法二:
network 0.0.0.0
R1上做默认路由,再宣告network0.0.0.0
与重分布静态路由明显区别在于管理距离,重分布为170,而此方法还是为EIGRP的90
R3的路由表
<a href="http://blog.51cto.com/attachment/201202/160627463.png" target="_blank"></a>
方法三:
ip default-network
边界路由器上:
全局配置模式下
ip default-network [外网主类地址]
这里是ip default-network 12.0.0.0
进入EIGRP进程配置
network [外网主类地址]
这里是network 12.0.0.0
本地有外网主类路由
配置一条静态路由或者关闭EIGRP的自动汇总
在这里是配置 ip route 12.0.0.0 255.0.0.0 null 0
此方法不需要默认路由
R1的路由表
<a href="http://blog.51cto.com/attachment/201202/160646154.png" target="_blank"></a>
<a href="http://blog.51cto.com/attachment/201202/160705664.png" target="_blank"></a>
注意点:带星号的就是默认路由
本文转自lustlost 51CTO博客,原文链接:http://blog.51cto.com/lustlost/770553,如需转载请自行联系原作者