R1
R1(config-if)#do show run | s interface
interface Loopback0
ip address 1.1.1.1 255.255.255.255
interface Ethernet0/2
ip address 172.8.123.1 255.255.255.0
duplex auto
R2
R2(config-if)#do show run | s interface
interface Loopback0
ip address 2.2.2.2 255.255.255.255
interface Ethernet0/1
ip address 172.8.123.2 255.255.255.0
duplex auto
interface Ethernet0/2
ip address 172.8.23.2 255.255.255.0
duplex auto
R3
R3(config-if)#do show run | s interface
interface Loopback0
ip address 3.3.3.3 255.255.255.255
interface Ethernet0/0
ip address 172.8.36.3 255.255.255.0
interface Ethernet0/2
ip address 172.8.23.3 255.255.255.0
R4
R4(config-if)#do show run | s interface
interface Loopback0
ip address 4.4.4.4 255.255.255.255
interface Ethernet0/0
ip address 172.8.100.4 255.255.255.0
R5
R5(config-if)#do show run | s interface
interface Loopback0
ip address 5.5.5.5 255.255.255.255
interface Ethernet0/0
ip address 172.8.123.5 255.255.255.0
interface Ethernet0/2
ip address 172.8.100.5 255.255.255.0
R6
R6(config-if)#do show run | s interface
interface Loopback0
ip address 6.6.6.6 255.255.255.255
interface Ethernet0/0
ip address 172.8.36.6 255.255.255.0
interface Ethernet0/1
ip address 172.8.100.6 255.255.255.0
R1
router eigrp 100
network 1.1.1.1 0.0.0.0
network 172.8.123.1 0.0.0.0
eigrp router-id 1.1.1.1
no auto-summary // 默认关闭自动汇总
R2
router eigrp 100
network 2.2.2.2 0.0.0.0
network 172.8.123.2 0.0.0.0
eigrp router-id 2.2.2.2
router eigrp 8
network 172.8.23.2 0.0.0.0
eigrp router-id 2.2.2.2
R3
router eigrp 8
network 3.3.3.3 0.0.0.0
network 172.8.23.3 0.0.0.0
network 172.8.36.3 0.0.0.0
eigrp router-id 3.3.3.3
R4
router eigrp 8
network 4.4.4.4 0.0.0.0
network 172.8.100.4 0.0.0.0
eigrp router-id 4.4.4.4
R5
router eigrp 8
network 5.5.5.5 0.0.0.0
network 172.8.100.5 0.0.0.0
eigrp router-id 5.5.5.5
router eigrp 100
network 172.8.123.5 0.0.0.0
eigrp router-id 5.5.5.5
R6
router eigrp 8
network 172.8.36.6 0.0.0.0
network 172.8.100.6 0.0.0.0
eigrp router-id 6.6.6.6
R2
R2(config)#key chain R2R3
R2(config-keychain)#key 1
R2(config-keychain-key)#key
R2(config-keychain-key)#key-string SPOTO
R2(config)#int e0/2
R2(config-if)#ip authentication mode eigrp 8 md5
R2(config-if)#ip authentication key-chain eigrp 8 R2R3
R3
R3(config)#key chain R2R3
R3(config-keychain)#key 1
R3(config-keychain-key)#key
R3(config-keychain-key)#key-string SPOTO
R3(config)#int e0/2
R3(config-if)#ip authentication mode eigrp 8 md5
R3(config-if)#ip authentication key-chain eigrp 8 R2R3
结果显示
R2(config)#do show ip eigrp neighbor
EIGRP-IPv4 Neighbors for AS(100)
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
1 172.8.123.5 Et0/1 10 00:19:57 1 100 0 5
0 172.8.123.1 Et0/1 11 00:24:48 1597 5000 0 3
EIGRP-IPv4 Neighbors for AS(8)
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 172.8.23.3 Et0/2 11 00:05:32 10 100 0 15
R2(config)#
R1
interface Loopback1
ip address 199.172.1.254 255.255.255.0
ip address 199.172.2.254 255.255.255.0 secondary
ip address 199.172.3.254 255.255.255.0 secondary
router eigrp 100
network 199.172.1.254 0.0.0.0
network 199.172.2.254 0.0.0.0
network 199.172.3.254 0.0.0.0
// RIP和EIGRP的路由汇总方式
interface Ethernet0/2
ip summary-address eigrp 100 199.172.0.0 255.255.252.0
R2
R2(config)#do show ip route eigrp | section 199.172.0.0/22
D 199.172.0.0/22 [90/409600] via 172.8.123.1, 00:06:16, Ethernet0/1
R2(config)#
R1路由信息
R1(config-if)#do show ip route 199.172.0.0
Routing entry for 199.172.0.0/22, supernet
Known via "eigrp 100", distance 5, metric 128256, type internal
Redistributing via eigrp 100
Routing Descriptor Blocks:
* directly connected, via Null0
Route metric is 128256, traffic share count is 1
Total delay is 5000 microseconds, minimum bandwidth is 8000000 Kbit
Reliability 255/255, minimum MTU 1514 bytes
Loading 1/255, Hops 0
R1(config-if)#
将AS100的路由重分布进AS8
R2
router eigrp 8
redistribute eigrp 100
R5
router eigrp 8
redistribute eigrp 100
R6
R6(config-router)#do show ip route eigrp | section 199.172.0.0/22
D EX 199.172.0.0/22 [170/435200] via 172.8.100.5, 01:08:55, Ethernet0/1
R6(config-router)#
// 路由表中只有一条该路由信息。
查询EIGRP所有的路由信息
R6(config-router)#do show ip eigrp topology 199.172.0.0/22
EIGRP-IPv4 Topology Entry for AS(8)/ID(6.6.6.6) for 199.172.0.0/22
State is Passive, Query origin flag is 1, 1 Successor(s), FD is 435200
Descriptor Blocks:
172.8.100.5 (Ethernet0/1), from 172.8.100.5, Send flag is 0x0
Composite metric is (435200/409600), route is External
Vector metric:
Minimum bandwidth is 10000 Kbit
Total delay is 7000 microseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 2
Originating router is 5.5.5.5
External data:
AS number of route is 100
External protocol is EIGRP, external metric is 409600
Administrator tag is 0 (0x00000000)
172.8.36.3 (Ethernet0/0), from 172.8.36.3, Send flag is 0x0
Composite metric is (460800/435200), route is External
Vector metric:
Minimum bandwidth is 10000 Kbit
Total delay is 8000 microseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 3
Originating router is 2.2.2.2
External data:
AS number of route is 100
External protocol is EIGRP, external metric is 409600
Administrator tag is 0 (0x00000000)
R6(config-router)#do show ip eigrp topology all-link | section 199.172.0.0
P 199.172.0.0/22, 1 successors, FD is 435200, serno 14
via 172.8.100.5 (435200/409600), Ethernet0/1
via 172.8.36.3 (460800/435200), Ethernet0/0
R6(config-router)#
EIGRP拓扑表中有路由信息
via 172.8.100.5这条路由的FD值比较via 172.8.36.3的AD值,并不满足FD
R5路由传递方向入接口e0/0
R5(config-if)#do show run | s interface
interface Ethernet0/0
delay 101
结果,满足条件1.FD>2.AD达到条件
R6(config-router)#do show ip eigrp topology all-link | section 199.172.0.0
P 199.172.0.0/22, 1 successors, FD is 435200, serno 42
via 172.8.100.5 (435456/409856), Ethernet0/1, serno 28
via 172.8.36.3 (460800/435200), Ethernet0/0
或者修改R6路由传递方向入接口e0/1
R6(config-if)#do show run | s interface
interface Ethernet0/1
delay 101
结果,满足条件1.FD>2.AD达到条件
R6(config-if)#do show ip eigrp topology all-link | section 199.172.0.0
P 199.172.0.0/22, 2 successors, FD is 435200, serno 54
via 172.8.100.5 (435456/409600), Ethernet0/1, serno 28
via 172.8.36.3 (460800/435200), Ethernet0/0
R6(config-if)#
或者修改R3路由传递方向入接口e0/2
R3(config-if)#do show run | s interface
interface Ethernet0/2
delay 10
结果,满足条件1.FD>2.AD达到条件
R6(config-if)#do show ip eigrp topology all-link | section 199.172.0.0
P 199.172.0.0/22, 2 successors, FD is 435200, serno 62
via 172.8.100.5 (435200/409600), Ethernet0/1, serno 28
via 172.8.36.3 (437760/412160), Ethernet0/0
R6(config-if)#
R2上也可以进行修改。这里不再试验
查看R6路由表
D EX 199.172.0.0/22 [170/435456] via 172.8.100.5, 00:08:20, Ethernet0/1
发现结果路由表中只有一条记录。
需要在EIGRP协议中配置不等价负载均衡
router eigrp 8
variance 2
再次查看R6路由表
D EX 199.172.0.0/22 [170/435200] via 172.8.100.5, 00:05:08, Ethernet0/1
[170/437760] via 172.8.36.3, 00:05:08, Ethernet0/0
目标达到。
命令
Router(config-router)#eigrp stub [receive-only | connected | static | summary]
receive-only
: 不能和其他3 个参数(connected,static 和summary)一起使用.只接收从邻居路由器发送来的信息.
connected
: 指定该路由器可以把和它直接相连的网络信息传递给它的邻居.这个选项默认是开启的.
static
: 把静态路由信息传递给它的邻居.
summary
: 把汇总路由信息传递给它的邻居.这个选项默认也是开启的
R2
router eigrp 100
eigrp stub receive-only
R5
router eigrp 100
eigrp stub receive-only
R1
ip route 0.0.0.0 0.0.0.0 172.8.123.2
ip route 0.0.0.0 0.0.0.0 172.8.123.5
一条就可以实现目的,两条就可以实现负载均衡。