ip default-network、ip route、ip default-gateway的区别

上传人:灯火****19 文档编号:124913099 上传时间:2020-03-14 格式:DOC 页数:10 大小:21KB
返回 下载 相关 举报
ip default-network、ip route、ip default-gateway的区别_第1页
第1页 / 共10页
ip default-network、ip route、ip default-gateway的区别_第2页
第2页 / 共10页
ip default-network、ip route、ip default-gateway的区别_第3页
第3页 / 共10页
ip default-network、ip route、ip default-gateway的区别_第4页
第4页 / 共10页
ip default-network、ip route、ip default-gateway的区别_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《ip default-network、ip route、ip default-gateway的区别》由会员分享,可在线阅读,更多相关《ip default-network、ip route、ip default-gateway的区别(10页珍藏版)》请在金锄头文库上搜索。

1、ip default-network、ip route、ip default-gateway的区别在cisco的16448文档中详细地讲解了这三条命令的使用条件和区别。一、使用条件ip default-gateway在禁用了ip routing的情况下使用,该路由器被当做默认网关。ip default-network和ip route 0.0.0.0 0.0.0.0 则可以在启用路由选择协议下使用。二、区别ip default-network 与 ip route 0.0.0.0 0.0.0.0 的最大区别在于前者可以被路由选择协议宣告出去。但是由于ip default-network这条命令

2、是有类的,如果宣告的网络不是主类网,将不会被标记成*号。ip default-network产生的默认路由是可以被EIGRP和RIP宣告的,但不被OSPF宣告,至于OSPF怎么产生默认路由,上一边有介绍。值得注意的是,RIP宣告ip default-network的路由条目是,使用0.0.0.0,可以debug ip rip看到。ip route 0.0.0.0 0.0.0.0 也可以被EIRGP传播,但是这条静态路由必须重分发到EIGRP协议中;在12.0T以后的IOS版本中,RIP将不宣告默认路由,除非是通过RIP学习到得,或者重分发到RIP中。同样,在OSPF中也不能传播该命令产生的默认

3、路由,(default-information originate命令)三、负载均衡如果用ip default-network配置了去往同一目的的多条默认路由,路由表会选择管理距离最小,如果管理距离都一样则选择最先配置的那条。同时使用ip default-network和ip route 0.0.0.0 0.0.0.0双方设定默认路由时,如果ip default-network设定的网络是直连(静态、且已知)的,那么它就成为默认路由;如果ip default-network指定的网络是由交换路由信息得来的,则ip route 0.0.0.0 0.0.0.0指定的表项成为默认路由。最后,如果使用

4、多条ip route 0.0.0.0 0.0.0.0指令,则流量会自动在多条链路上负载均衡。ip default-gateway,ip default-network和ip route 默认路由的区别关于这几条命令的区别,网上已经有很多讨论了,也的确是很容易混淆的。下面是整理的一些总结,都一一举例做了比较,应该会有一个全新的认识,以后实际中遇到了也不混淆犯错了。 指定默认路由(last resort gateway)的指令供有3种,可以分成两类:1、ip default-gateway当路由器上的ip routing无效时,使用它指定默认路由,用于RXBoot模式(no ip routing)

5、下安装IOS等。或者关闭ip routing 让路由器当主机用,此时需要启用ip default-gateway配置默认网关。2、ip default-network和ip route 0.0.0.0 0.0.0.0两者都用于ip routing有效的路由器上,区别主要在于路由协议是否传播这条路由信息。比如:IGRP无法识别0.0.0.0,因此传播默认路由时必须用ip default-network。当用ip default-network指令设定多条默认路由时,administrative distance最短的成为最终的默认路由;如果有复数条路由distance值相等,那么在路由表(sho

6、w ip route)中靠上的成为默认路由。同时使用ip default-network和ip route 0.0.0.0 0.0.0.0双方设定默认路由时,如果ip default-network设定的网络是直连(静态、且已知)的,那么它就成为默认路由;如果ip default-network指定的网络是由交换路由信息得来的,则ip route 0.0.0.0 0.0.0.0指定的表项成为默认路由。最后,如果使用多条ip route 0.0.0.0 0.0.0.0指令,则流量会自动在多条链路上负载均衡。 例子:关闭ip routing 举例:mycisco(config)#no ip rou

7、tingmycisco(config)#ip default-gateway 192.168.0.1mycisco(config)#endmycisco#ping Type escape sequence to abort.Sending 5, 100-byte ICMP Echoes to 61.152.167.75, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 60/60/60 msmycisco#show ip routeDefault gateway is 192.

8、168.0.1Host Gateway Last Use Total Uses InterfaceICMP redirect cache is emptymycisco#ip route例子:ip route 0.0.0.0 0.0.0.0 192.168.0.1mycisco#ping Type escape sequence to abort.Sending 5, 100-byte ICMP Echoes to 61.152.167.75, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg

9、/max = 56/56/60 msmycisco#show ip routeCodes: C connected, S static, I IGRP, R RIP, M mobile, B BGPD EIGRP, EX EIGRP external, O OSPF, IA OSPF inter areaE1 OSPF external type 1, E2 OSPF external type 2, E EGPi IS-IS, L1 IS-IS level-1, L2 IS-IS level-2, * candidate defaultU per-user static routeGatew

10、ay of last resort is 192.168.0.1 to network 0.0.0.0C 1.0.0.0/8 is directly connected, Loopback0C 192.168.0.0/24 is directly connected, Ethernet0S* 0.0.0.0/0 1/0 via 192.168.0.1mycisco#ip default-network 必须是在所到网络已经存在路由的情况下,否则执行无效.mycisco(config)#ip route 61.0.0.0 255.0.0.0 192.168.0.1mycisco#show ip

11、routeCodes: C connected, S static, I IGRP, R RIP, M mobile, B BGPD EIGRP, EX EIGRP external, O OSPF, IA OSPF inter areaE1 OSPF external type 1, E2 OSPF external type 2, E EGPi IS-IS, L1 IS-IS level-1, L2 IS-IS level-2, * candidate defaultU per-user static routeGateway of last resort is not setC 1.0.

12、0.0/8 is directly connected, Loopback0S 61.0.0.0/8 1/0 via 192.168.0.1C 192.168.0.0/24 is directly connected, Ethernet0 接着我们执行:mycisco(config)#ip default-network 61.0.0.0再看路由表:mycisco#show ip routeCodes: C connected, S static, I IGRP, R RIP, M mobile, B BGPD EIGRP, EX EIGRP external, O OSPF, IA OSPF

13、 inter areaE1 OSPF external type 1, E2 OSPF external type 2, E EGPi IS-IS, L1 IS-IS level-1, L2 IS-IS level-2, * candidate defaultU per-user static routeGateway of last resort is 192.168.0.1 to network 61.0.0.0C 1.0.0.0/8 is directly connected, Loopback0S* 61.0.0.0/8 1/0 via 192.168.0.1C 192.168.0.0

14、/24 is directly connected, Ethernet0ip default-gatewayip default-gateway command differs from the other two commands in that it should only be used when ip routing is disabled on the Cisco router.For instance, if the router is a host in the IP world, you can use this command to define a default gate

15、way for it. You might also use this command when your low end Cisco router is in boot mode in order to TFTP a Cisco IOS® Software image to the router. In boot mode, the router does not have ip routing enabled.ip default-networkUnlike the ip default-gateway command, you can use ip default-network when ip routing is enabled on the Cisco router. When you configure ip default-network the router considers routes to that network for installation as

展开阅读全文
相关资源
相关搜索

当前位置:首页 > IT计算机/网络 > 其它相关文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号