本帖最后由 易逝的信仰 于 2020-8-25 10:19 编辑
配置
在 R1 路由器上增加多个网络,开启汇总:
自动汇总
# R1 增加四个网络,并宣告
Router#show ip route
10.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
C 10.1.0.0/24 is directly connected, Loopback0
L 10.1.0.1/32 is directly connected, Loopback0
C 10.2.0.0/24 is directly connected, Loopback1
L 10.2.0.1/32 is directly connected, Loopback1
C 10.3.0.0/24 is directly connected, Loopback2
L 10.3.0.1/32 is directly connected, Loopback2
C 10.4.0.0/24 is directly connected, Loopback3
L 10.4.0.1/32 is directly connected, Loopback3
Router(config)#router eigrp 100
Router(config-router)#network 10.0.0.0 0.255.255.255
# 在 R5 查看,增加对应的网段
Router5#show ip route
10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
D 10.0.0.0/8 is a summary, 00:03:30, Null0
C 10.1.0.0/24 is directly connected, Loopback0
L 10.1.0.1/32 is directly connected, Loopback0
C 10.2.0.0/24 is directly connected, Loopback1
L 10.2.0.1/32 is directly connected, Loopback1
C 10.3.0.0/24 is directly connected, Loopback2
L 10.3.0.1/32 is directly connected, Loopback2
C 10.4.0.0/24 is directly connected, Loopback3
L 10.4.0.1/32 is directly connected, Loopback3
12.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
D 12.0.0.0/8 is a summary, 00:03:30, Null0
C 12.1.1.0/24 is directly connected, Ethernet0/0
L 12.1.1.1/32 is directly connected, Ethernet0/0
13.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
D 13.0.0.0/8 is a summary, 00:03:30, Null0
C 13.1.1.0/24 is directly connected, Ethernet0/1
L 13.1.1.1/32 is directly connected, Ethernet0/1
14.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
D 14.0.0.0/8 is a summary, 00:03:30, Null0
C 14.1.1.0/24 is directly connected, Serial1/0
L 14.1.1.1/32 is directly connected, Serial1/0
25.0.0.0/24 is subnetted, 1 subnets
D 25.1.1.0 [90/307200] via 12.1.1.2, 03:46:59, Ethernet0/0
35.0.0.0/24 is subnetted, 1 subnets
D 35.1.1.0 [90/307200] via 13.1.1.2, 03:46:59, Ethernet0/1
45.0.0.0/24 is subnetted, 1 subnets
D 45.1.1.0 [90/2221056] via 13.1.1.2, 03:46:59, Ethernet0/1
[90/2221056] via 12.1.1.2, 03:46:59, Ethernet0/0
# 在 R1 打开自动汇总
R1(config)#router eigrp 100
R1(config-router)# auto-summary
# 在 R5 上再次查看,可以看到汇总成 10.0.0.0/8 的大网络
Router#show ip route
10.0.0.0/8 is subnetted, 1 subnets
D 10.0.0.0 [90/435200] via 35.1.1.1, 00:00:25, Ethernet0/1
[90/435200] via 25.1.1.1, 00:00:25, Ethernet0/0
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
手动汇总:
Router(config-router)#no auto-summary
# 手动汇总支持本地和邻居的路由
# 在 R2 上手动汇总
Router(config-if)#ip summary-address eigrp 1 10.1.0.0 255.252.0.0
# 在 R5 上查看
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
D 10.0.0.0/14 [90/486400] via 35.1.1.1, 00:00:34, Ethernet0/1
D 10.1.0.0/24 [90/435200] via 35.1.1.1, 00:06:32, Ethernet0/1
[90/435200] via 25.1.1.1, 00:06:32, Ethernet0/0
D 10.2.0.0/24 [90/435200] via 35.1.1.1, 00:06:32, Ethernet0/1
[90/435200] via 25.1.1.1, 00:06:32, Ethernet0/0
D 10.3.0.0/24 [90/435200] via 35.1.1.1, 00:06:32, Ethernet0/1
[90/435200] via 25.1.1.1, 00:06:32, Ethernet0/0
D 10.4.0.0/24 [90/435200] via 35.1.1.1, 00:06:32, Ethernet0/1
[90/435200] via 25.1.1.1, 00:06:32, Ethernet0/0
Top
被动接口
路由器的某个接口会与交换机建立连接,而交换机通过会下挂多台 PC. 由于在路由器上运行如 EIGRP 类似的协议,会周期性的发送 Hello 报文,这些报文会通过交换机发送给 PC,但这些报文对于交换机和 PC 来说,并没有意义,反而会占用带宽,所以可将和交换机连接的端口设置成被动接口。
当不希望从某个接⼝向外发送路由更新时,可以将该接⼝配置为被动接⼝,配置以后,被动接⼝将不接收、不发送任何EIGRP报⽂。
R1(config)#router eigrp 100
R1(config-router)#passive-interface e0/0
Top
缺省路由注入
如之前的 R5 所示,通常和 ISP 相连,用于将自己不知道的网段发送给 ISP 在外网上传输。所以就需要将 R5 配置的默认路由引入到其他路由器中。
路由重分布
# 在AS的边界路由器上配置缺省路由,再将此缺省路由重分布到EIGRP域内。
R5(config)#ip route 0.0.0.0 0.0.0.0 56.1.1.6
R5(config)#router eigrp 100
R5(config-router)#redistribute static
手动汇总进行下发
在AS的边界路由器连接内⽹的接⼝,通过⼿⼯路由汇总实现缺省路由下放。
R5(config)#interface e0/0
R5(config-if)#ip summary-address eigrp 100 0.0.0.0 0.0.0.0
Top
认证
EIGRP协议能够配置认证来验证邻居/消息的合法性,EIGRP 仅⽀持 MD5 加密认证,也是 EIGRP 协议唯⼀⽀持的认证⽅式。
区分加密和认证:
加密:通过如 DES,3DES 等算法加密后生成一段密文
认证:对数据完整性进行检查有没有被篡改
配置:
# 创建钥匙链
R1(config)#key chain test
R1(config-keychain)#key 1
R1(config-keychain-key)#key-string cisco
# 接⼝下开启认证并调⽤钥匙链
R1(config)#interface e0/0
R1(config-if)#ip authentication mode eigrp 100 md5
R1(config-if)#ip authentication key-chain eigrp 100 test |