Lab EIGRP默认路由发布


 
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

这样R1R2就可以通向外网了 
 
牋 如果内网中路由器很多的话,配置逐个静态路由就太过繁琐
则可以用“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
R1R2的路由表出现了一条11.0.0.0 的默认路由通向R3 
 
在ping外部网段就可以ping的通了
ip default network  命令可以向全网络通告缺省网络

通过ip default-network 方式发布默认理由要求ip default-network 主类网络,而且在整个EIGRP网络中的路由器存在到达该主类网络的路由表。为此,我们还应该在直连该主类网络的EIGRP路由器上,向EIGRP宣告(network a.b.c.d)。当配置默认路由后,那么EIGRP将通告到达未知网络的出口为我们配置的主类网络。
 

posted @ 2020-03-31 16:10  cyrusxx  阅读(143)  评论(0)    收藏  举报