分發列表在重分佈中的應用

課題內容:分發列表在重分佈中的應用redis

拓撲數據庫

clip_image002


首先完成基本的IP地址配置;  步驟省略ide


驗證:oop

Ping 命令學習

Show ip route connectedspa

以上兩個命令是很好的驗證基本IP地址部署的命令router


按圖配置動態路由協議blog

R2(config)#int l0進程

R2(config-if)#ip ospf 110 a 0ip

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

R一、R三、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上作雙向重分佈

R一、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方向學習到了 //


重分佈是從路由表到數據庫的過程,R一、R二、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 的影響

相關文章
相關標籤/搜索