课题内容:分发列表在重分布中的应用
拓扑
首先完成基本的IP地址配置; 步骤省略
验证:
Ping 命令
Show ip route connected
以上两个命令是很好的验证基本IP地址部署的命令
按图配置动态路由协议
R2(config)#int l0
R2(config-if)#ip ospf 110 a 0
R2(config-if)#int s1/0
R2(config-if)#ip ospf 110 a 0
R2(config-if)#int s1/1
R2(config-if)#ip ospf 110 a 0
R2(config-if)#end
R1(config)#interface s1/0
R1(config-if)#ip ospf 110 a 0
R4(config)#interface s1/1
R4(config-if)#ip ospf 110 a 0
验证OSPF 邻居
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
10.1.1.4 0 FULL/ - 00:00:31 24.1.1.4 Serial1/1
10.1.1.1 0 FULL/ - 00:00:34 12.1.1.1 Serial1/0
配置EIGRP
R1、R3、R4
router eigrp 90
network 134.1.1.0 0.0.0.255
R3(config-router)#network 33.1.1.1 0.0.0.0
验证邻居:
R3#show ip eigrp neighbors
EIGRP-IPv4 Neighbors for AS(90)
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
1 134.1.1.4 Et0/2 14 00:00:40 9 100 0 5
0 134.1.1.1 Et0/2 13 00:00:40 10 100 0 5
观察两台ASBR的路由表: (R1和R4)
R1#show ip route | begin Gateway
Gateway of last resort is not set
10.0.0.0/32 is subnetted, 1 subnets
C 10.1.1.1 is directly connected, Loopback0
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1.0/24 is directly connected, Serial1/0
L 12.1.1.1/32 is directly connected, Serial1/0
22.0.0.0/32 is subnetted, 1 subnets
O 22.1.1.1 [110/65] via 12.1.1.2, 00:03:13, Serial1/0
24.0.0.0/24 is subnetted, 1 subnets
O 24.1.1.0 [110/128] via 12.1.1.2, 00:03:13, Serial1/0
33.0.0.0/32 is subnetted, 1 subnets
D 33.1.1.1 [90/409600] via 134.1.1.3, 00:01:27, Ethernet0/2
134.1.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 134.1.1.0/24 is directly connected, Ethernet0/2
L 134.1.1.1/32 is directly connected, Ethernet0/2
R4#show ip route | begin Gateway
Gateway of last resort is not set
10.0.0.0/32 is subnetted, 1 subnets
C 10.1.1.4 is directly connected, Loopback0
12.0.0.0/24 is subnetted, 1 subnets
O 12.1.1.0 [110/128] via 24.1.1.2, 00:03:52, Serial1/1
22.0.0.0/32 is subnetted, 1 subnets
O 22.1.1.1 [110/65] via 24.1.1.2, 00:03:52, Serial1/1
24.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 24.1.1.0/24 is directly connected, Serial1/1
L 24.1.1.4/32 is directly connected, Serial1/1
33.0.0.0/32 is subnetted, 1 subnets
D 33.1.1.1 [90/409600] via 134.1.1.3, 00:02:22, Ethernet0/2
134.1.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 134.1.1.0/24 is directly connected, Ethernet0/2
L 134.1.1.4/32 is directly connected, Ethernet0/2
观察分发列表在重分布的过程中产生了什么作用:
使用 ACL 对路由做匹配
R1(config)#access-list 2 permit 22.1.1.1 0.0.0.0
R1(config)#access-list 3 permit host 33.1.1.1
在重分布的同时应用分发列表
在R1和R4上做双向重分布
R1、R4
router eigrp 90
network 134.1.1.0 0.0.0.255
redistribute ospf 110 metric 1544 2000 255 1 1500
R1#show run | s r o
router ospf 110
redistribute eigrp 90 subnets
观察R2和R3的协议路由表:
R2#show ip route ospf | begin Gateway
Gateway of last resort is not set
33.0.0.0/32 is subnetted, 1 subnets
O E2 33.1.1.1 [110/20] via 24.1.1.4, 00:00:55, Serial1/1
[110/20] via 12.1.1.1, 00:01:10, Serial1/0
134.1.0.0/24 is subnetted, 1 subnets
O E2 134.1.1.0 [110/20] via 24.1.1.4, 00:00:55, Serial1/1
[110/20] via 12.1.1.1, 00:01:10, Serial1/0
R3#show ip route eigrp | begin Gateway
Gateway of last resort is not set
12.0.0.0/24 is subnetted, 1 subnets
D EX 12.1.1.0 [170/2195456] via 134.1.1.4, 00:01:46, Ethernet0/2
[170/2195456] via 134.1.1.1, 00:01:46, Ethernet0/2
22.0.0.0/32 is subnetted, 1 subnets
D EX 22.1.1.1 [170/2195456] via 134.1.1.4, 00:01:46, Ethernet0/2
[170/2195456] via 134.1.1.1, 00:01:46, Ethernet0/2
24.0.0.0/24 is subnetted, 1 subnets
D EX 24.1.1.0 [170/2195456] via 134.1.1.4, 00:01:46, Ethernet0/2
[170/2195456] via 134.1.1.1, 00:01:46, Ethernet0/2
应用分发列表:
在R1的OSPF进程下控制从EIGRP重分布到OSPF的路由
R1(config-router)#distribute-list 3 out eigrp 90
观察效果:
R2#show ip route ospf | begin Gateway
Gateway of last resort is not set
33.0.0.0/32 is subnetted, 1 subnets
O E2 33.1.1.1 [110/20] via 24.1.1.4, 00:06:12, Serial1/1
[110/20] via 12.1.1.1, 00:06:27, Serial1/0
134.1.0.0/24 is subnetted, 1 subnets
O E2 134.1.1.0 [110/20] via 24.1.1.4, 00:06:12, Serial1/1
// 134.1.1.0/24的路由现在仅从R4方向学习到了 //
重分布是从路由表到数据库的过程,R1、R2、R4应该具有相同的链路状态数据库;
验证数据库:
R2#show ip ospf database | begin Type-5
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
33.1.1.1 10.1.1.1 475 0x80000001 0x00A8C6 0
33.1.1.1 10.1.1.4 456 0x80000001 0x0096D5 0
134.1.1.0 10.1.1.4 456 0x80000001 0x007A8D 0
那么,看起来R1并没有产生关于 134.1.1.0/24的外部LSA
这种应用方法,阻止了ACL中未放行的前缀从EIGRP被重分布进入OSPF的LSDB;
现在再观察从OSPF重分布进入EIGRP的路由,可以如何收到分发列表的影响:
R1(config-router)#distribute-list 2 out ospf 110
观察效果:
R3#show ip route eigrp | begin Gateway
Gateway of last resort is not set
12.0.0.0/24 is subnetted, 1 subnets
D EX 12.1.1.0 [170/2195456] via 134.1.1.4, 00:00:17, Ethernet0/2
22.0.0.0/32 is subnetted, 1 subnets
D EX 22.1.1.1 [170/2195456] via 134.1.1.4, 00:03:08, Ethernet0/2
[170/2195456] via 134.1.1.1, 00:03:08, Ethernet0/2
24.0.0.0/24 is subnetted, 1 subnets
D EX 24.1.1.0 [170/2195456] via 134.1.1.4, 00:00:17, Ethernet0/2
看起来呢,该应用方法同样适用于OSPF到EIGRP的重分布;
分发列表结合重分布的应用,调用方法:
router eigrp 90
distribute-list 2 out ospf 110
意义为:影响从OSPF重分布进入 EIGRP的路由,受到 ACL 2 的影响