您现在的位置: 天下网吧 >> 网吧焦点 >> 网吧技术 >> 网吧路由 >> 正文

ip route 0.0.0.0 0.0.0.0和ip defult-network区别

[作者:中国IT实验室收集整… 来源:不详 时间:2012-11-15我来说两句

  哪位能说说ip route 0.0.0.0 0.0.0.0和ip default-network命令的区别吗?
  我所知道的ip route 命令会向路由表里加一条静态路由,ip default-network命令不会
  ip route 命令按接口和地址指定缺省路由ip default-network命令按网络指定
  谁能说说还有什么区别?以及在什么情况下使用哪条吗?还有他们在再发布时的区别!
  FW:发信人: canway()
  整理人: sanjose(2000-09-26 10:54:44), 站内信件
  Q:
  听了各位解释,有些明白,可是路由器没有路由还叫路由器吗,那样两个命令
  
  功能似乎是一样的,都是把不知道到的包发给下一个站点,可是我在做一个项目
  时,
  设置ip default-gateway就不行。用ip route 0.0.0.0 0.0.0.0 xxxxxxxx
  就通了。 是不是这样,对于ip default-gateway来说,只有对这个网段才有效,
  而从其他
  网段路由过来的其他网段的信息到了用ip default-gateway的网段就不能利用这
  
  个 命令传送,而是要用ip route 0.0.0.0 0.0.0.0.了。也就是ip route 0.0.0
  .0
  0.0.0.0才能完成路由功能,不知道理解的对吗
  
  Answer:
  1。 ip default-gateway用与路由器不作路由时使用,这时路由器就只是一台主
  机好象Win95PC一样需要配一个网关才能与外界通信。
  如果 “no ip routing"则路由器就不作路由。这时你可以配bridge-group,把路
  由表及里器当switch使。
  
  2。 ip route 0.0.0.0 0.0.0.0 用于履行路由功能。如果ip routin
  g是enable的则ip default-gateway不起作用.
  
  FW:区别在于,ip route本机生效,ip default-network可以影响整个路由协议域
  http://www.ciSCo.com/en/US/customer...shtml#ipnetwork
  FW:Introduction
  This Tech Note explains how to configure a default route, or gateway of last resort, using the following IP commands: ip default-gateway, ip default-network, and ip route 0.0.0.0 0.0.0.0. Let's look at each of these commands in more detail.
  Before You Begin
  Conventions
  For more information on document conventions, see the CiSCo Technical Tips Conventions.
  
  Prerequisites
  There are no specific prerequisites for this document.
  
  Components Used
  This document is not restricted to specific software and hardware versions.
  
  The information presented in this document was created from devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If you are working in a live network, ensure that you understand the potential impact of any command before using it.
  
  ip default-gateway
  The ip 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 gateway 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 doesn't have ip routing enabled.
  
  ip default-network
  Unlike 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 the gateway of last resort on the router.
  
  For EVEry network configured with ip default-network, if a router has a route to that network, that route is flagged as a candidate default route. Let's look at the following routing table taken from a CiSCo router:
  
  2513#show ip route
  Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
  D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
  E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
  i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS lEVEl-2, * - candidate default
  Gateway of last resort is not set
  161.44.0.0 255.255.255.0 is subnetted, 1 subnets
  C 161.44.192.0 is directly connected, Ethernet0
  S 198.10.1.0 [1/0] via 161.44.192.2
  131.108.0.0 255.255.255.0 is subnetted, 1 subnets
  C 131.108.99.0 is directly connected, TokenRing0
  
  
  Note the static route to 198.10.1.0 via 161.44.192.2 and that the gateway of last resort isn't set. If we configure ip default-network 198.10.1.0, the routing table changes to the following:
  
  2513#show ip route
  Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
  D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
  E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
  i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS lEVEl-2, * - candidate default
  
  Gateway of last resort is 161.44.192.2 to network 198.10.1.0
  
  161.44.0.0 255.255.255.0 is subnetted, 1 subnets
  C 161.44.192.0 is directly connected, Ethernet0
  S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
  S* 198.10.1.0 [1/0] via 161.44.192.2
  131.108.0.0 255.255.255.0 is subnetted, 1 subnets
  C 131.108.99.0 is directly connected, TokenRing0
  2513#show ip protocols
  2513#
  
  
  We can see the gateway of last resort has now been set as 161.44.192.2. This result is independent of any routing protocol, as shown by the show ip protocols command at the bottom of the output.
  
  We can add another candidate default route simply by configuring another instance of ip default-network:
  
  2513#config terminal
  Enter configuration commands, one per line. End with CNTL/Z.
  2513(config)#ip route 171.70.24.0 255.255.255.0 131.108.99.2
  2513(config)#ip default-network 171.70.24.0
  2513(config)#^Z
  
  2513#show ip route
  Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
  D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
  E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
  i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS lEVEl-2, * - candidate default
  
  Gateway of last resort is 161.44.192.2 to network 198.10.1.0
  
  161.44.0.0 255.255.255.0 is subnetted, 1 subnets
  C 161.44.192.0 is directly connected, Ethernet0
  S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
  S* 198.10.1.0 [1/0] via 161.44.192.2
  171.70.0.0 is variably subnetted, 2 subnets, 2 masks
  S 171.70.0.0 255.255.0.0 [1/0] via 171.70.24.0
  S 171.70.24.0 255.255.255.0 [1/0] via 131.108.99.2
  131.108.0.0 255.255.255.0 is subnetted, 1 subnets
  C 131.108.99.0 is directly connected, TokenRing0
  
  
  Flagging a Default Network
  Note: The ip default-network command is classful, which means if the router has a route to the subnet indicated by this command, it installs the route to the major net. At this point neither network has been flagged as the default network. The ip default-network command must be issued again, using the major net, in order to flag the candidate default route.
  
  2513#config terminal
  Enter configuration commands, one per line. End with CNTL/Z.
  2513(config)#ip default-network 171.70.0.0
  2513(config)#^Z
  
  2513#show ip route
  Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
  D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
  E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
  i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS lEVEl-2, * - candidate default
  
  Gateway of last resort is 161.44.192.2 to network 198.10.1.0
  
  161.44.0.0 255.255.255.0 is subnetted, 1 subnets
  C 161.44.192.0 is directly connected, Ethernet0
  S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
  S* 198.10.1.0 [1/0] via 161.44.192.2
  171.70.0.0 is variab
我来说两句(请遵守法律法规)
 网吧精品   网络布线   热门专题   推荐配置   网络安全   路由专题   网吧游戏更新   网吧QQ关   网吧注册表   网管初学   网吧优化   网吧无盘优化   网吧系统优化   迅闪2008   网吧三层更新   无盘服务器   MaxDos   Win2008   网吧虚拟磁盘   星际争霸II   锐起无盘   网维大师   网吧游戏菜单   网吧活动   迅闪2009   网吧母盘   万象   网吧真实生活   迅闪2010   信佑2010   Windows8   信佑   迅闪   易游   顺网无盘   连锁网吧   黑网吧   2011网吧新闻   网吧闲聊   网吧游戏   互联网类软件   增值联盟   网吧广告联盟   有道搜索联盟   淘123联盟   网吧广告   深度无盘   信佑无盘   网众无盘   MZD无盘   网吧软件故障解决   网吧硬件故障大全   海蜘蛛   ROS   磁盘缓存   网吧GHOST   快吧无盘   快吧教程   网吧防盗   2011网吧政策   绿色网吧   网吧禁烟   万象2004   雪花病毒   网吧电影   网吧达人   QQ网吧   SuperCache|SuperSpeed   CCDISK   网吧远程控制   2011网吧配置   万象密码   迅闪无盘   网吧系统下载   网吧管理系统   网吧键盘   网吧鼠标   win8,Windows 8教程,Windows 8下载   网吧最新新闻   网吧路由   锐起无盘补丁   WayOs   网吧显示器   液晶   万能包   网吧消防   显卡   SSD   网卡   网吧源码   主板   云海   I8无盘   网卡汇聚   网吧DDOS

更多专题

声明
本文来源地址:http://cisco.chinaitlab.com/List_137.html
声明:本站所发表的文章、评论及图片仅代表作者本人观点,与本站立场无关。若文章侵犯了您的相关权益,请及时与我们联系,我们会及时处理,感谢您对本站的支持!联系邮箱:support@txwb.com.
天下网吧·网吧天下
  • 本周热门
  • 本月热门
  • 阅读排行
网吧,网吧系统,网吧资讯,网吧软件,网吧技术,网吧无盘,网吧经营,网吧管理,网吧联盟。