EIGRP的自动汇总及手动汇总

EIGRP的自动汇总及手动汇总
clip_image002
我们先来试一下默认的自动汇总
我的拓扑中是有不连续子网的
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
ru1(config-if)#no shut
 
%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-if)#exit
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>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
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
ru2(config-if)#no shut
 
%LINK-5-CHANGED: Interface Serial0/1, changed state to down
ru2(config-if)#exit
ru2(config)#int f0/0
ru2(config-if)#ip add 172.16.2.1 255.255.255.0
ru2(config-if)#no shut
 
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
ru2(config-if)#exit
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>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
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
 
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
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)#no shut
 
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
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)
 
ru3#
我们来关闭自动汇总看看效果会怎样
ru1(config)#route eigrp 100
ru1(config-router)#no au
ru1(config-router)#no auto-summary
ru1(config-router)#exit
ru1(config)#
%DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 192.168.1.2 (Serial0/0) is up: new adjacency
ru2(config)#
ru2(config)#route eigrp 100
ru2(config-router)#no au
ru2(config-router)#no auto-summary
ru2(config-router)#exit
ru2(config)#
%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
ru2(config)#
ru2(config)#
 
ru3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
ru3(config)#route eigrp 100
ru3(config-router)#no au
ru3(config-router)#no auto-summary
ru3(config-router)#exit
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
ru3#
在查看一下路由表
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, 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
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:19, Serial0/0
C    192.168.2.0/24 is directly connected, Serial0/0
ru3#
我们这个时候就可以学到其他两个内外的地址了
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 100 percent (5/5), round-trip min/avg/max = 49/66/94 ms
 
ru3#
 
我们说的 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-if)#exit
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-if)#exit
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-if)#exit
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-if)#exit
ru3(config)#
 
通告并查看
ru3(config)#route eigrp 100
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-router)#exit
ru3(config)#ex
%SYS-5-CONFIG_I: Configured from console by console
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
 
     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
     172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
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
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:09:15, Serial0/0
C    192.168.2.0/24 is directly connected, Serial0/0
ru3#
显示为直连网段
我们在接口下手动汇总一下
ru3(config)#int s0/0
ru3(config-if)#ip su
ru3(config-if)#ip summary-address eigrp 100 4.4.0.0 255.255.252.0
ru3(config-if)#exit
ru3(config)#
%DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 192.168.2.1 (Serial0/0) is up: new adjacency
ru3(config)#
 
 
以下是 ru3 上汇总后的路由表信息
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
 
     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
     172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
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
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:30, Serial0/0
C    192.168.2.0/24 is directly connected, Serial0/0
ru3#
 
 
以下是 ru2 上汇总之前的路由表信息
ru2#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
 
     4.0.0.0/24 is subnetted, 4 subnets
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
     172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
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
ru2#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
 
     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
     172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
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
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:03:08, 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 上手动汇总前和手动汇总后路由表条目数的变化情况
不必担心汇总后的网络连通状况
Ping 一下试试
ru2#ping 4.4.3.4
 
Type escape sequence to abort.
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
 
ru2#

你可能感兴趣的:(职场,自动,汇总,休闲,EIGRP)