拓扑图

 

 

R1

int s0/0

ip add 12.1.1.1 255.255.255.0

no shut

int lo0

ip add 172.16.0.1 255.255.255.0

int lo1

ip add 172.16.1.1 255.255.255.0

int lo2

ip add 172.16.2.1 255.255.255.0

int lo3

ip add 172.16.3.1 255.255.255.0

router eigrp 100

no auto-summary

network 172.16.0.0 0.0.3.255

network 12.1.1.1 0.0.0.0

R2:

int s0/0

ip add 12.1.1.2 255.255.255.0

no shut

int s0/1

ip add 23.1.1.2 255.255.255.0

no shut

router eigrp 100

no auto-summary

network 12.1.1.2 0.0.0.0

network 23.1.1.2 0.0.0.0

R3:

int s0/1

ip add 23.1.1.3 255.255.255.0

no shut

int lo0

ip add 192.168.4.1 255.255.255.0

int lo1

ip add 192.168.5.1 255.255.255.0

int lo2

ip add 192.168.6.1 255.255.255.0

int lo3

ip add 192.168.7.1 255.255.255.0

router eigrp 100

no auto-summary

network 23.1.1.3 0.0.0.0

redistribute eigrp 300

router eigrp 300

no auto-summary

network 192.168.4.0 0.0.3.255

在接口下手动汇总

R1:s0/0

int s0/0

ip summary-address eigrp 100 172.16.0.0 255.255.252.0

手动汇总后在本地路由器会产生一条汇总后指向null0 的接口,主要是防止环路

例如:手动汇总发生在R2的s0/1接口,同时该路由器存在一条默认路由,如果没有这条指向null0接口的路由,就可能产生环路

可以让这条路由消失,通过设置distance 为255(即不可达)如图

 

 

此时R1路由表没有出现null0的路由(需要用clear ip route * 来刷新路由表,因为该协议不会老化自身的路由条目)

 

R3:s0/1

ip summary-address eigrp 300 192.168.4.0 255.255.252.0错误(特别注意手动汇总时该接口属于哪个AS就用那个AS号,否则不起作用)

ip summary-address eigrp 100 192.168.4.0 255.255.252.0 正确

汇总后各自路由表

R1

R2

 

R3

 

R3的s0/1接口汇总配置的是eigrp 100