Eigrp 缺省路由 ip default networkEIGRP 2010-05-24 08:59:23 閱讀83 評(píng)論0 字號(hào):大中小 訂閱 ![]()
R4模擬一個(gè)外網(wǎng)網(wǎng)絡(luò),在內(nèi)網(wǎng)做一個(gè)默認(rèn)路由! 配置好各個(gè)端口的IP后,通告路由 R1 Router eigrp 100 Net 172.16.0.0 R2 Router eigrp 100 Net 172.16.0.0 R3 Router eigrp 100 Net 172.16.0.0
而后在R3上配置一條通向R4的缺省路由 R3(config)#ip route 0.0.0.0 0.0.0.0 11.1.1.2 這樣在R3就能通向外網(wǎng)了 R3#ping 192.168.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds: !!!!! 但在R1R2是不通的 路由器R3作為邊境路由器配置了靜態(tài)路由,可以直接訪問(wèn)外部,但是內(nèi)部的R1和R2路由器由于缺少路由,因此無(wú)法訪問(wèn)外網(wǎng)。 我們?cè)?/span>R1R2上配置靜態(tài)路由
當(dāng)然并也要在R4上配置一個(gè)靜態(tài)路由 R1(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.2 R2(config)#ip route 0.0.0.0 0.0.0.0 172.16.2.2 R4(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.1 R1#ping 192.168.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 40/60/112 ms R2#ping 192.168.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 16/51/96 ms
如果內(nèi)網(wǎng)中路由器很多的話,配置逐個(gè)靜態(tài)路由就太過(guò)繁瑣 則可以用“ip default network” 命令 R3(config)#router eigrp 100 R3(config-router)#net 11.0.0.0 //在這個(gè)AS中通告這個(gè)默認(rèn)出口的網(wǎng)絡(luò) R3(config)#ip default-network 11.0.0.0 在R1 R2上查看路由表 R1 Gateway of last resort is 172.16.1.2 to network 11.0.0.0 172.16.0.0/24 is subnetted, 2 subnets C 172.16.1.0 is directly connected, Serial1/0 D 172.16.2.0 [90/2681856] via 172.16.1.2, 00:56:58, Serial1/0 D* 11.0.0.0/8 [90/2681856] via 172.16.1.2,
00:00:05, Serial1/0 R2 Gateway of last resort is 172.16.2.2 to network 11.0.0.0 172.16.0.0/24 is subnetted, 2 subnets D 172.16.1.0 [90/2681856] via 172.16.2.2, 00:57:40, Serial1/0 C 172.16.2.0 is directly connected, Serial1/0 D* 11.0.0.0/8 [90/2681856] via 172.16.2.2,
00:01:08, Serial1/0 在ping外部網(wǎng)段就可以ping的通了 ip default network 命令可以向全網(wǎng)絡(luò)通告缺省網(wǎng)絡(luò) 注意:在工大瑞工的論壇上 ,使用ip default-network其指出默認(rèn)網(wǎng)絡(luò),建議采用主類網(wǎng)絡(luò)。如果使用無(wú)類網(wǎng)絡(luò),則可能會(huì)出現(xiàn)無(wú)法解釋的問(wèn)題。 確實(shí)如此 |
|