免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1240 | 回复: 0
打印 上一主题 下一主题

Default route and its propagation [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-09-02 23:38 |只看该作者 |倒序浏览

                                                                                                               

  •          
    ip default-gateway

  •          
    ip default-network

  •          
    and ip route 0.0.0.0
                    0.0.0.0


可通过以上三个命令来设置默认路由,那区别呢?
1. ip default-gateway
当router禁止了ip routing时,此时router就类似一个主机,使用ip default-gateway来指定默认路由。
或者当boot mode的时候,router使用tftp来下载IOS,此时ip routing也是被disabled。
2. ip default-network
这个命令只能使用classful network作为参数,并且在使用这个命令时,路由表总必须存在其相应的路由。
当路由表总存在某个major net的subnet时,例如:
==========================================================
     5.0.0.0/24 is subnetted, 1 subnets, 1 masks
S       5.5.5.0 is directly connected, Serial1/1
==========================================================
此时如果使用
ip default-network 5.5.5.0
那么就会自动添加一条
ip route 5.0.0.0 255.0.0.0 5.5.5.0
最终导致路由表变为
===========================================================
     5.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
S       5.0.0.0/8 [1/0] via 5.5.5.0
S       5.5.5.0/24 is directly connected, Serial1/1
===========================================================
Note: 路由表总必须存在这个被ip default-network声明的子网,否则即使加了一条规则,但由于下一跳地址不存在(如此例总的5.5.5.0),路由表将不添加这条记录。
此时,必须在使用ip default-network 5.0.0.0来重新标识一下,定义默认路由。
===========================================================
*   5.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
S*      5.0.0.0/8 [1/0] via 5.5.5.0
S       5.5.5.0/24 is directly connected, Serial1/1
===========================================================
也就是需要定义两次,个人觉得挺滑稽的,funny^_^!
Note: 使用ip default-network对AD=0的路由进行标记并不会设置默认路由。
在不同路由协议中的传播
RIPv1:
注意:RIP是基于路由表来传播路由信息的。
传播默认路由:
==============================
ad=0 (connected or static),并且此条路由为当前默认路由,也就是没有其他优先级高的默认路由
不受split-horizon限制,rip 将自动advertise此类candidate route
不传播默认路由:
==============================
R路由被设定
对 R 路由,也就是由RIP协议获得的路由使用ip network-default是不会传递默认路由的。
静态ad=1的路由被设定
IGRP:
必须使用network命令通知igrp来广播这个网段为exterior route,也就是default route。所以IGRP并不象rip那样广播为0.0.0.0默认网段。原因很简单,因为rip包中没有办法辨别是否为default route,所以只能广播为0.0.0.0。但是igrp包括三种包:
  • Number of Interior routes - indicates how many of the routing entries in this update are subnets of a directly connected
    network.
  • Number of System routes - indicates how many of the routing entries in this update are not from a directly connected
    network.
  • Number of Exterior routes - indicates how many of the routing entries in this update are default networks.
所以可以辨别出某个route是否为默认路由。
注意: IGRP也是没有mask字段的。
EIGRP:
需要network来通知eigrp传播这条路由。
3. ip route 0.0.0.0 0.0.0.0
ip route 0.0.0.0 0.0.0.0
ip route 0.0.0.0 0.0.0.0
这两个形式都产生默认路由,并被router选取,这两个命令的效果是一样的。
RIPv1:
redistribute
IGRP:
不识别这种默认路由。(因为IGRP包的结构)
EIGRP:
需要redistribute来传播,在EIGRP中,静态路由的传播是不受split horizon的控制的,也就是说,会在所有打开eigrp功能的端口上传播出去。
Note: RIP和IGRP对静态路由的再分配传播是遵循split horizon的,但是eigrp不遵循。
4. 默认路由的优先级
当出现多个ip default-network指定的网络时(AD=0除外)
======================================
AD -> first listed in routing table
当出现ip default-network和ip 0.0.0.0 0.0.0.0的网络时(AD=0除外)
======================================
如果ip default-network为静态路由 -> (y) 这条静态路由为默认路由
        |
        |
        V
      (n)
0.0.0.0 路由take precedence
        |
        |
        V
根据AD来进行判断
       |
        |
        V
AD相同,根据metric来判断
多条0.0.0.0路由
==============
load balancing
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/42903/showart_373031.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP