EIGRP的自動彙總及手動彙總
<a href="http://yuzeying.blog.51cto.com/attachment/200907/21/644976_1248175673DqZE.jpg"></a>
我們先來試一下預設的自動彙總
我的拓撲中是有不連續子網的
Router>
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host ru1
ru1(config)#int s0/0
ru1(config-if)#ip add 192.168.1.1 255.255.255.0
ru1(config-if)#clock rate 64000
ru1(config-if)#no shut
%LINK-5-CHANGED: Interface Serial0/0, changed state to down
ru1(config-if)#exit
ru1(config)#int f0/0
ru1(config-if)#ip add 172.16.1.1 255.255.255.0
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
ru1(config)#route eigrp 100
ru1(config-router)#net 172.16.1.0
ru1(config-router)#net 192.168.1.0
ru1(config-router)#ex
ru1(config)#
Router(config)#host ru2
ru2(config)#int s0/0
ru2(config-if)#ip add 192.168.1.2 255.255.255.0
ru2(config-if)#no shut
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
ru2(config-if)#exit
ru2(config)#int f0
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to
% Incomplete command.
ru2(config)#int s0/1
ru2(config-if)#ip add 192.168.2.1 255.255.255.0
ru2(config-if)#clock rate 64000
%LINK-5-CHANGED: Interface Serial0/1, changed state to down
ru2(config)#int f0/0
ru2(config-if)#ip add 172.16.2.1 255.255.255.0
ru2(config)#route eigrp 100
ru2(config-router)#net 172.16.2.0
ru2(config-router)#net 192.168.1.0
ru2(config-router)#net 192.168.2
%DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 192.168.1.1 (Serial0/0) is up: new adjacency.0
ru2(config-router)#exit
ru2(config)#
Router(config)#host ru3
ru3(config)#int s0/0
ru3(config-if)#ip add 192.168.2.2 255.255.255.0
ru3(config-if)#no shut
ru3(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to upexit
ru3(config)#int f0/0
ru3(config-if)#ip add 172.16.3.1 255.255.255.0
ru3(config-if)#exit
ru3(config)#route eigrp 100
ru3(config-router)#net 192.168.2.0
ru3(config-router)#net
%DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 192.168.2.1 (Serial0/0) is up: new adjacency172.16.3.0
ru3(config-router)#exit
ru3(config)#
我們現在産看一下路由表
ru3#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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 not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
D 172.16.0.0/16 is a summary, 00:00:29, Null0
C 172.16.3.0/24 is directly connected, FastEthernet0/0
D 192.168.1.0/24 [90/2681856] via 192.168.2.1, 00:00:35, Serial0/0
C 192.168.2.0/24 is directly connected, Serial0/0
ru3#
你會發現隻學到一條172.16.0.0/16的路由資訊
而這個時候ping ru1上的内網接口是ping不通的
ru3#ping 172.16.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
我們來關閉自動彙總看看效果會怎樣
ru1(config-router)#no au
ru1(config-router)#no auto-summary
ru1(config-router)#exit
%DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 192.168.1.2 (Serial0/0) is up: new adjacency
ru2(config-router)#no au
ru2(config-router)#no auto-summary
%DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 192.168.2.2 (Serial0/1) is up: new adjacency
%DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 192.168.1.1 (Serial0/0) is up: new adjacency
ru3#conf t
ru3(config-router)#no au
ru3(config-router)#no auto-summary
ru3(config)#e
%DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 192.168.2.1 (Serial0/0) is up: new adjacencyxit
%SYS-5-CONFIG_I: Configured from console by console
在檢視一下路由表
172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
D 172.16.0.0/16 is a summary, 00:00:44, Null0
D 172.16.1.0/24 [90/2684416] via 192.168.2.1, 00:00:19, Serial0/0
D 172.16.2.0/24 [90/2172416] via 192.168.2.1, 00:00:19, Serial0/0
D 192.168.1.0/24 [90/2681856] via 192.168.2.1, 00:00:19, Serial0/0
我們這個時候就可以學到其他兩個内外的位址了
Ping一下試試
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 49/66/94 ms
我們說的EIGRP是支援不連續子網的,但是和RIPv2一樣是要關閉自動彙總才可以實作
下面我們給ru3上配幾個環回位址
環回位址隻是一個邏輯位址,類似于我們熟悉的127.0.0.1, 主要用作測試網絡的連通性,與實體接口位址比起來更穩定,且不用no shutdown 打開,而且理論上沒有數量限制
ru3(config)#int loop 0
%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
ru3(config-if)#ip add 4.4.0.4 255.255.255.0
ru3(config)#int loop 1
%LINK-5-CHANGED: Interface Loopback1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
ru3(config-if)#ip add 4.4.1.4 255.255.255.0
ru3(config)#int loop 2
%LINK-5-CHANGED: Interface Loopback2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback2, changed state to up
ru3(config-if)#ip add 4.4.2.4 255.255.255.0
ru3(config)#int loop 3
%LINK-5-CHANGED: Interface Loopback3, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback3, changed state to up
ru3(config-if)#ip add 4.4.3.4 255.255.255.0
通告并檢視
ru3(config-router)#net 4.4.0.0
ru3(config-router)#net 4.4.1.0
ru3(config-router)#net 4.4.2.0
ru3(config-router)#net 4.4.3.0
ru3(config)#ex
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
4.0.0.0/24 is subnetted, 4 subnets
C 4.4.0.0 is directly connected, Loopback0
C 4.4.1.0 is directly connected, Loopback1
C 4.4.2.0 is directly connected, Loopback2
C 4.4.3.0 is directly connected, Loopback3
D 172.16.0.0/16 is a summary, 00:09:56, Null0
D 172.16.1.0/24 [90/2684416] via 192.168.2.1, 00:08:22, Serial0/0
D 172.16.2.0/24 [90/2172416] via 192.168.2.1, 00:05:24, Serial0/0
D 192.168.1.0/24 [90/2681856] via 192.168.2.1, 00:09:15, Serial0/0
顯示為直連網段
我們在接口下手動彙總一下
ru3(config-if)#ip su
ru3(config-if)#ip summary-address eigrp 100 4.4.0.0 255.255.252.0
%DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 192.168.2.1 (Serial0/0) is up: new adjacency
以下是ru3上彙總後的路由表資訊
4.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
D 4.4.0.0/22 is a summary, 00:00:34, Null0
C 4.4.0.0/24 is directly connected, Loopback0
C 4.4.1.0/24 is directly connected, Loopback1
C 4.4.2.0/24 is directly connected, Loopback2
C 4.4.3.0/24 is directly connected, Loopback3
D 172.16.0.0/16 is a summary, 00:13:44, Null0
D 172.16.1.0/24 [90/2684416] via 192.168.2.1, 00:00:30, Serial0/0
D 172.16.2.0/24 [90/2172416] via 192.168.2.1, 00:00:30, Serial0/0
D 192.168.1.0/24 [90/2681856] via 192.168.2.1, 00:00:30, Serial0/0
以下是ru2上彙總之前的路由表資訊
ru2#sh ip route
D 4.4.0.0 [90/2297856] via 192.168.2.2, 00:00:10, Serial0/1
D 4.4.1.0 [90/2297856] via 192.168.2.2, 00:00:10, Serial0/1
D 4.4.2.0 [90/2297856] via 192.168.2.2, 00:00:10, Serial0/1
D 4.4.3.0 [90/2297856] via 192.168.2.2, 00:00:10, Serial0/1
D 172.16.0.0/16 is a summary, 00:18:09, Null0
D 172.16.1.0/24 [90/2172416] via 192.168.1.1, 00:16:40, Serial0/0
C 172.16.2.0/24 is directly connected, FastEthernet0/0
D 172.16.3.0/24 [90/2172416] via 192.168.2.2, 00:00:10, Serial0/1
C 192.168.1.0/24 is directly connected, Serial0/0
C 192.168.2.0/24 is directly connected, Serial0/1
ru2#
這是彙總之後的路由表資訊
ru2>en
4.0.0.0/22 is subnetted, 1 subnets
D 4.4.0.0 [90/2681856] via 192.168.2.2, 00:03:08, Serial0/1
D 172.16.0.0/16 is a summary, 00:16:17, Null0
D 172.16.1.0/24 [90/2172416] via 192.168.1.1, 00:14:48, Serial0/0
D 172.16.3.0/24 [90/2172416] via 192.168.2.2, 00:03:08, Serial0/1
我們可以對比一下ru2上手動彙總前和手動彙總後路由表條目數的變化情況
不必擔心彙總後的網絡連通狀況
ru2#ping 4.4.3.4
Sending 5, 100-byte ICMP Echos to 4.4.3.4, timeout is 2 seconds:
Success rate is 100 percent (5/5), round-trip min/avg/max = 5/7/10 ms
本文轉自 yuzeying1 51CTO部落格,原文連結:http://blog.51cto.com/yuzeying/181367