天下网吧 >> 网吧天地 >> 网吧技术 >> 网吧网络 >> 正文

IP default-network和静态路由区别

2008-3-6赛迪网佚名

  对于一些准备考CCNA和CCNP的人来说,配置一条静态路由和使用思科的命令IP default-network的区别是一个令人迷惑的地方。

  初一看,他们都是一样的。结果都是配置一个目的地,使得路由器知道如果一个包在路由表中没有指定的路由的话,这个包将会被发往何地。

  他们之间的主要区别是:配置一条静态缺省路由仅是为你在配置的路由器定义一条路由,而ip default-network将通过使用的路由协议进行传播。

  下面,我们在一个星形网络(hub-and-spoke network)中来试验ip default-network命令。R1为中心,R2和R3叶子。他们通过网络172.12.123.0/24连接起来,而且每台路由器都根据它的路由器号码被配置了32位掩码的LOOPBACK地址(1.1.1.1/32,等等)。路由协议使用RIP协议,LOOPBACK地址在网络中被广播。

  R1路由器配置有一个串口,地址为10.1.1.1/24,这个网络被通过使用命令ip default-network 10.0.0.0命令,配置为一条缺省网络。它还没有被RIP广播。

  接下来,路由协议广播了这条路由。使用RIP,缺省网络被广播为0.0.0.0(如果使用了IGRP,它会显示网络号,但是被标识成IGRP的外部路由)。这个路由被指定为R1的一条缺省的路由,正如我们在下面看到的。

R1#show ip route

Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
R 2.0.0.0/8 [120/1] via 172.12.123.2, 00:00:11, Serial0
R 3.0.0.0/8 [120/1] via 172.12.123.3, 00:00:11, Serial0
172.12.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.12.21.0/30 is directly connected, BRI0
C 172.12.123.0/24 is directly connected, Serial0
* 10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Serial1


  在R2和R3上,缺省的RIP路由也将出现:

R2#show ip route
Gateway of last resort is 172.12.123.1 to network 0.0.0.0

R 1.0.0.0/8 [120/1] via 172.12.123.1, 00:00:00, Serial0.213
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
R 3.0.0.0/8 [120/2] via 172.12.123.1, 00:00:00, Serial0.213
172.12.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.12.21.0/30 is directly connected, BRI0
C 172.12.123.0/24 is directly connected, Serial0.213
R* 0.0.0.0/0 [120/1] via 172.12.123.1, 00:00:00, Serial0.213


R3#show ip route
Gateway of last resort is 172.12.123.1 to network 0.0.0.0

R 1.0.0.0/8 [120/1] via 172.12.123.1, 00:00:27, Serial0.31
R 2.0.0.0/8 [120/2] via 172.12.123.1, 00:00:28, Serial0.31
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
172.12.0.0/24 is subnetted, 1 subnets
C 172.12.123.0 is directly connected, Serial0.31
R* 0.0.0.0/0 [120/1] via 172.12.123.1, 00:00:28, Serial0.31


  所以缺省路由起了使用:如果我们在R2和R3上PING10.1.1.1,即使他们在路由表中没有配置的路由,他们会使用缺省路由。

R2#ping 10.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 68/68/68 ms

R3#ping 10.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 68/68/68 ms


  当决定是使用缺省路由还是使用default network时,要记信:如果想路由协议广播这条路由,那么使用default-network命令,否则使用缺省路由就可以了。

欢迎访问最专业的网吧论坛,无盘论坛,网吧经营,网咖管理,网吧专业论坛https://bbs.txwb.com

关注天下网吧微信,了解网吧网咖经营管理,安装维护:


本文来源:赛迪网 作者:佚名

声明
本文来源地址:0
声明:本站所发表的文章、评论及图片仅代表作者本人观点,与本站立场无关。若文章侵犯了您的相关权益,请及时与我们联系,我们会及时处理,感谢您对本站的支持!联系Email:support@txwb.com.,本站所有有注明来源为天下网吧或天下网吧论坛的原创作品,各位转载时请注明来源链接!
天下网吧·网吧天下
  • 本周热门
  • 本月热门
  • 阅读排行