手机
当前位置:查字典教程网 >软件教程 >网络通讯 >IP default-network和静态路由区别
IP default-network和静态路由区别
摘要:对于一些准备考CCNA和CCNP的人来说,配置一条静态路由和使用思科的命令IPdefault-network的区别是一个令人迷惑的地方。初一...

对于一些准备考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命令,否则使用缺省路由就可以了。

【IP default-network和静态路由区别】相关文章:

BGP路由的优化

路由器 简单设置图解教程

上网时经常遇到的35例故障排查

六大步骤顺利排除计算机网络连接故障

路由器和交换机的区别

总结:路由器配置错误五则

无线生活常识:无线局域网设备疑惑解答

netcore(磊科)宽带路由器设置图解

解决Win XP网络邻居共享的问题

别让局域网成为密码葬身之地

精品推荐
分类导航