设为首页 收藏本站
查看: 1296|回复: 0

[经验分享] Cisco ios ip default-network 补充说明

[复制链接]

尚未签到

发表于 2018-7-19 10:32:24 | 显示全部楼层 |阅读模式
1.标记一个路由条目 为缺省网络                         2.在RIP,EIGRP/IGRP中提供缺省网络的传播  【补充说明】
  1.使用ip  default-network标记静态路由指定的路由为缺省网络,在RIP中不会传播出去;在IGRP、EIGRP中不存在这  个问题,因为它们本来就需要将这个网段通告到路由协议中才能传播出去
  2.使用ip  default-network标记直连网络为缺省不会被使用,因为没有下一跳。
  【案例说明】
  【实验一】

  R1:
  interface Serial1/0
  ip address 192.168.12.1 255.255.255.0
  serial restart-delay 0
  !
  interface Serial2/0
  no ip address
  shutdown
  serial restart-delay 0
  !
  router rip
  network 192.168.12.0
  R2:
  interface Serial1/0
  ip address 192.168.23.2 255.255.255.0
  !
  interface Serial2/0
  ip address 192.168.12.2 255.255.255.0
  router rip
  network 192.168.12.0
  ip default-network 3.0.0.0
  ip route 3.0.0.0 255.0.0.0 192.168.23.3
  R3:
  interface Loopback3
  ip address 6.6.6.6 255.255.255.0 secondary
  ip address 3.3.3.3 255.255.255.0
  !
  interface Serial2/0
  ip address 192.168.23.3 255.255.255.0
  !
  ip route 0.0.0.0 0.0.0.0 192.168.23.2
  查看结果
  R2#sh ip rou
  Gateway of last resort is 192.168.23.3 to network  3.0.0.0
  C 192.168.12.0/24 is directly connected, Serial2/0
  S*     3.0.0.0/8 [1/0] via 192.168.23.3
  C 192.168.23.0/24 is directly connected, Serial1/0
  R1#sh ip rou
  Gateway of last resort is not set
  C 192.168.12.0/24 is directly connected, Serial1/0
  可以看到R1并没有获得这个路由条目。下面更改一下R2的配置:
  R2:
  no ip default-network 3.0.0.0
  no ip route 3.0.0.0 255.0.0.0 192.168.23.3
  ip default-network 192.168.23.0
  R2#sh ip rou
  Gateway of last resort is not set
  C 192.168.12.0/24 is directly connected, Serial2/0
  C* 192.168.23.0/24 is directly connected, Serial1/0
  R2#
  *Oct    3 07:15:26.147: RIP: sending v1 update to 255.255.255.255 via  Serial2/0 (192.168.12.2)
  *Oct    3 07:15:26.147: RIP: build update entries
  *Oct    3 07:15:26.147: subnet 0.0.0.0 metric 1
  R1#sh ip rou
  Gateway of last resort is 192.168.12.2 to network 0.0.0.0
  C 192.168.12.0/24 is directly connected, Serial1/0
  R*     0.0.0.0/0 [120/1] via 192.168.12.2, 00:00:20,  Serial1/0
  此时可以看到192.168.23.0也没有在RIP中通告,但是由于使用了ip  default-network使其变为了默认网络,从而将该网段通告了出去。
  但是此时在R1上ping 6.6.6.6会ping  不通,因就在于R2上现在的缺省网络无下一跳,Gateway of last resort is not set,
  R1#ping 6.6.6.6
  Type escape sequence to abort.
  Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
  U
  *Oct    3 07:21:46.751: IP: tableid=0, s=192.168.12.1 (local), d=6.6.6.6  (Serial1/0), routed via RIB
  *Oct    3 07:21:46.751: IP: s=192.168.12.1 (local), d=6.6.6.6  (Serial1/0), len 100, sending
  *Oct    3 07:21:46.779: IP: tableid=0, s=192.168.12.2 (Serial1/0),  d=192.168.12.1 (Serial1/0), routed via RIB
  R2(config)#
  *Oct    3 07:21:46.711: IP: s=192.168.12.1 (Serial2/0), d=6.6.6.6, len  100, unroutable
  *Oct    3 07:21:46.711: IP: tableid=0, s=192.168.12.2 (local),  d=192.168.12.1 (Serial2/0), routed via RIB
  解决方案:在R2上添加静态缺省
  R2(config)#ip route 0.0.0.0 0.0.0.0 192.168.23.3
  R1#ping 6.6.6.6
  Type escape sequence to abort.
  Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
  !!!!!
  搞定!
  [实验二]ip default-network在EIGRP中应用案例

  R1:
  R1(config)#router eigrp 100
  R1(config-router)#net 192.168.12.0
  R2:
  R2(config)#no router rip
  R2(config)#router eigrp 100
  R2(config-router)#net 192.168.12.0
  R2(config-router)#net 192.168.23.0
  R2(config-router)#pa s1/0
  实验结果
  R2#sh ip rou
  Gateway of last resort is 192.168.23.3 to network 0.0.0.0
  C 192.168.12.0/24 is directly connected, Serial2/0
  C* 192.168.23.0/24 is directly connected, Serial1/0
  S* 0.0.0.0/0 [1/0] via 192.168.23.3
  R1#sh ip rou
  Gateway of last resort is 192.168.12.2 to network 192.168.23.0
  C 192.168.12.0/24 is directly connected, Serial1/0
  D* 192.168.23.0/24 [90/2681856] via 192.168.12.2, 00:00:21,  Serial1/0
  R1#ping 6.6.6.6
  Type escape sequence to abort.
  Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
  !!!!!
  Success rate is 100 percent (5/5), round-trip min/avg/max = 40/41/48 ms
  可以看到配置中和RIP不同的情况,需要将所通告的默认路由网段通告到 EIGRP/IGRP中;而且通告出去不像RIP变为了0 .0.0.0/0,仍旧是缺省网络。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-538660-1-1.html 上篇帖子: CCNA(二)cisco三层模型 下篇帖子: Cisco路由器硬件结构及接口简介
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表