<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /> 

1.   EIGRP默认路由发布

1.1.  EIGRP默认路由概述

EIGRP默认路由用于通过EIGRP协议向运行EIGRP的路由器发布通往未知网络的默认路由。我们只需要在一台EIGRP网络的路由器上配置默认路由,然后通过EIGRP让其他路由器学习到默认路由信息,从而极大减少了网络搭建的工作量。

1.2.  EIGRP默认路由发布拓扑

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

1.3.  EIGRP发布默认路由配置

1.3.1.   R1

R1#sh run
Building configuration...

 

Current configuration : 976 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip cef
!
!
multilink bundle-name authenticated
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet1/0
 no ip address
 shutdown
 duplex half
!
interface FastEthernet2/0
 no ip address
 shutdown
 duplex half
!
interface FastEthernet3/0
 ip address 172.16.1.1 255.255.255.252
 duplex half
!
interface FastEthernet4/0
 no ip address
 shutdown
 duplex half
!
router eigrp 1
 network 172.16.1.1 0.0.0.0
 auto-summary
!
no ip http server
no ip http secure-server
!
logging alarm informational
control-plane
!
!
gatekeeper
 shutdown
!
!
line con 0
 stopbits 1
line aux 0
line vty 0 4
!
!
end

 

1.3.2.   R5

R5#sh run
Building configuration...

 

Current configuration : 906 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R5
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip cef
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!        
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex half
!
interface FastEthernet1/0
 no ip address
 shutdown
 duplex half
!
interface FastEthernet2/0
 no ip address
 shutdown
 duplex half
!
interface FastEthernet3/0
 no ip address
 shutdown
 duplex half
!
interface FastEthernet4/0
 ip address 172.16.1.6 255.255.255.252
 duplex half
!
router eigrp 1
 network 172.16.1.6 0.0.0.0 //宣告直连网络,指定172.16.1.6接口启动EIGRP
 auto-summary
!
no ip http server
no ip http secure-server
     
!
logging alarm informational
!
control-plane
!
gatekeeper
 shutdown

 

line con 0
 stopbits 1
line aux 0
line vty 0 4
!        
!
end

 

 

 

1.3.3.   R2

 

R2#sh run
Building configuration...

 

Current configuration : 1156 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip cef
!
no ip domain lookup
!
multilink bundle-name authenticated
!        
!
interface FastEthernet0/0
 ip address 192.168.10.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet1/0
 no ip address
 shutdown
 duplex half
!
interface FastEthernet2/0
 no ip address
 shutdown
 duplex half
!
interface FastEthernet3/0
 ip address 172.16.1.2 255.255.255.252
 duplex half
!
interface FastEthernet4/0
 ip address 172.16.1.5 255.255.255.252
 duplex half
!
router eigrp 1
 network 172.16.0.0
 network 192.168.10.0
auto-summary
!
ip default-network 192.168.1.0
ip default-network 192.168.10.0
ip route 0.0.0.0 0.0.0.0 192.168.10.2 //在网络边界做默认路由指定下一跳
no ip http server
no ip http secure-server
!
logging alarm informational
!
control-plane
!
gatekeeper
 shutdown
!
!
line con 0
 stopbits 1
line aux 0
line vty 0 4
!
End

 

1.3.4.   R3

R3#sh run
Building configuration...

 

Current configuration : 1095 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip cef
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
interface Loopback0
 ip address 192.168.3.1 255.255.255.0
!
interface Loopback1
 ip address 192.168.2.1 255.255.255.0
!
interface FastEthernet0/0  //连到R2 f0/0
 ip address 192.168.10.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet1/0
 no ip address
 shutdown
 duplex half
!
interface FastEthernet2/0
 no ip address
 shutdown
 duplex half
!
interface FastEthernet3/0
 no ip address
 shutdown
 duplex half
!        
interface FastEthernet4/0
 no ip address
 shutdown
 duplex half
!
ip route 0.0.0.0 0.0.0.0 192.168.10.1 // 默认路由指向R2
no ip http server
no ip http secure-server
!
logging alarm informational
!
!
control-plane
!
gatekeeper
 shutdown
!
!
line con 0
 stopbits 1
line aux 0
line vty 0 4
!
End

 

1.4.  查看路由表

1.4.1.   R1

R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

 

Gateway of last resort is 172.16.1.2 to network 192.168.10.0

 

D*   192.168.10.0/24 [90/30720] via 172.16.1.2, 01:09:27, FastEthernet3/0 //EIGRP传递的默认路由
     172.16.0.0/30 is subnetted, 2 subnets
D       172.16.1.4 [90/30720] via 172.16.1.2, 01:13:59, FastEthernet3/0
C       172.16.1.0 is directly connected, FastEthernet3/0

 

1.4.2.   R5

R5#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

 

Gateway of last resort is 172.16.1.5 to network 192.168.10.0

 

D*   192.168.10.0/24 [90/30720] via 172.16.1.5, 01:10:08, FastEthernet4/0//EIGRP传递的默认路由
     172.16.0.0/30 is subnetted, 2 subnets
C       172.16.1.4 is directly connected, FastEthernet4/0
D       172.16.1.0 [90/30720] via 172.16.1.5, 01:14:39, FastEthernet4/0

 

1.4.3.   R2

R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

 

Gateway of last resort is 192.168.10.2 to network 0.0.0.0

 

C*   192.168.10.0/24 is directly connected, FastEthernet0/0
     172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C       172.16.1.4/30 is directly connected, FastEthernet4/0
D       172.16.0.0/16 is a summary, 01:19:58, Null0
C       172.16.1.0/30 is directly connected, FastEthernet3/0
S*   0.0.0.0/0 [1/0] via 192.168.10.2

1.5.  测试

R1#ping 192.168.2.1

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/32/80 ms

 

 

1.6.  结言

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