對(duì)于一些準(zhǔn)備考CCNA和CCNP的人來說,配置一條靜態(tài)路由和使用思科的命令I(lǐng)P default-network的區(qū)別是一個(gè)令人迷惑的地方。
初一看,他們都是一樣的。結(jié)果都是配置一個(gè)目的地,使得路由器知道如果一個(gè)包在路由表中沒有指定的路由的話,這個(gè)包將會(huì)被發(fā)往何地。
他們之間的主要區(qū)別是:配置一條靜態(tài)缺省路由僅是為你在配置的路由器定義一條路由,而ip default-network將通過使用的路由協(xié)議進(jìn)行傳播。
下面,我們?cè)谝粋€(gè)星形網(wǎng)絡(luò)(hub-and-spoke network)中來試驗(yàn)ip default-network命令。R1為中心,R2和R3葉子。他們通過網(wǎng)絡(luò)172.12.123.0/24連接起來,而且每臺(tái)路由器都根據(jù)它的路由器號(hào)碼被配置了32位掩碼的LOOPBACK地址(1.1.1.1/32,等等)。路由協(xié)議使用RIP協(xié)議,LOOPBACK地址在網(wǎng)絡(luò)中被廣播。
R1路由器配置有一個(gè)串口,地址為10.1.1.1/24,這個(gè)網(wǎng)絡(luò)被通過使用命令ip default-network 10.0.0.0命令,配置為一條缺省網(wǎng)絡(luò)。它還沒有被RIP廣播。
接下來,路由協(xié)議廣播了這條路由。使用RIP,缺省網(wǎng)絡(luò)被廣播為0.0.0.0(如果使用了IGRP,它會(huì)顯示網(wǎng)絡(luò)號(hào),但是被標(biāo)識(shí)成IGRP的外部路由)。這個(gè)路由被指定為R1的一條缺省的路由,正如我們?cè)谙旅婵吹降摹?br />
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路由也將出現(xiàn):
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
新聞熱點(diǎn)
疑難解答
圖片精選