Eigrp 缺省路由 ip default networkEIGRP 2010-05-24 08:59:23 阅读83 评论0 字号:大中小 订阅 ![]()
R4模拟一个外网网络,在内网做一个默认路由! 配置好各个端口的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就能通向外网了 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作为边境路由器配置了静态路由,可以直接访问外部,但是内部的R1和R2路由器由于缺少路由,因此无法访问外网。 我们在R1R2上配置静态路由
当然并也要在R4上配置一个静态路由 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
如果内网中路由器很多的话,配置逐个静态路由就太过繁琐 则可以用“ip default network” 命令 R3(config)#router eigrp 100 R3(config-router)#net 11.0.0.0 //在这个AS中通告这个默认出口的网络 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外部网段就可以ping的通了 ip default network 命令可以向全网络通告缺省网络 注意:在工大瑞工的论坛上 ,使用ip default-network其指出默认网络,建议采用主类网络。如果使用无类网络,则可能会出现无法解释的问题。 确实如此 |
|