我是靠谱客的博主 开放香菇,这篇文章主要介绍OSPF 外部路由汇总配置详解,现在分享给大家,希望可以做个参考。

实验目的:1.掌握ospf外部路由汇总配置 

                2.区别外部路由的汇总

                3.掌握ospf的外部路由类型及计算方法

实验拓扑: 

步骤1.接口配置

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
R1(config)#interface f0/0 R1(config-if)#ip address 12.12.12.1 255.255.255.0 R1(config-if)#no shutdown R1(config)#interface loopback 0 R1(config-if)#ip address 10.1.0.1 255.255.255.0 R1(config)#interface loopback 1 R1(config-if)#ip address 10.1.1.1 255.255.255.0 R1(config)#interface loopback 2 R1(config-if)#ip address 10.1.2.1 255.255.255.0 R1(config)#interface loopback 3 R1(config-if)#ip address 10.1.3.1 255.255.255.0 R1(config)#interface loopback 4 R1(config-if)#ip address 10.1.4.1 255.255.255.0 R1(config)#interface loopback 5 R1(config-if)#ip address 10.1.5.1 255.255.255.0 R2(config)#interface f0/0 R2(config-if)#ip address 12.12.12.2 255.255.255.0 R2(config-if)#no shutdown R2(config)#interface f0/1 R2(config-if)#ip address 23.23.23.2 255.255.255.0 R2(config-if)#no shutdown R3(config)#interface f0/1 R3(config-if)#ip address 23.23.23.3 255.255.255.0 R3(config-if)#no shutdown R3(config)#interface f0/0 R3(config-if)#ip address 34.34.34.3 255.255.255.0 R3(config-if)#no shutdown R4(config)#interface f0/0 R4(config-if)#ip address 34.34.34.4 255.255.255.0 R4(config-if)#no shutdown R4(config)#interface loopback 0 R4(config-if)#ip address 40.1.0.1 255.255.255.0 R4(config)#interface loopback 1 R4(config-if)#ip address 40.1.1.1 255.255.255.0 R4(config)#interface loopback 2 R4(config-if)#ip address 40.1.2.1 255.255.255.0 R4(config)#interface loopback 3 R4(config-if)#ip address 40.1.3.1 255.255.255.0 R4(config)#interface loopback 4 R4(config-if)#ip address 40.1.4.1 255.255.255.0 R4(config)#interface loopback 5 R4(config-if)#ip address 40.1.5.1 255.255.255.0

步骤2:路由协议配置

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
R1(config)#router ospf 1 R1(config-router)#network 12.12.12.0 0.0.0.255 area 1 R1(config-router)#network 10.1.0.1 0.0.0.0 area 1 R1(config-router)#network 10.1.1.1 0.0.0.0 area 1 R1(config-router)#network 10.1.2.1 0.0.0.0 area 1 R1(config-router)#network 10.1.3.1 0.0.0.0 area 1 R1(config-router)#network 10.1.4.1 0.0.0.0 area 1 R1(config-router)#network 10.1.5.1 0.0.0.0 area 1 R2(config)#router ospf 1 R2(config-router)#network 12.12.12.0 0.0.0.255 area 1 R2(config-router)#network 23.23.23.0 0.0.0.255 area 0 R3(config)#router ospf 1 R3(config-router)#network 23.23.23.0 0.0.0.255 area 0 R4(config)#router rip R4(config-router)#version 2 R4(config-router)#no auto-summary R4(config-router)#network 34.34.34.0 R4(config)#router rip R4(config-router)#version 2 R4(config-router)#no auto-summary R4(config-router)#network 34.34.34.0 R4(config-router)#network 40.1.0.1 R4(config-router)#network 40.1.1.1 R4(config-router)#network 40.1.2.1 R4(config-router)#network 40.1.3.1 R4(config-router)#network 40.1.4.1 R4(config-router)#network 40.1.5.1

查看路由表

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
R1#show ip route Gateway of last resort is not set 23.0.0.0/24 is subnetted, 1 subnets O IA 23.23.23.0 [110/2] via 12.12.12.2, 00:06:20, FastEthernet0/0 10.0.0.0/24 is subnetted, 6 subnets C 10.1.3.0 is directly connected, Loopback3 C 10.1.2.0 is directly connected, Loopback2 C 10.1.1.0 is directly connected, Loopback1 C 10.1.0.0 is directly connected, Loopback0 C 10.1.5.0 is directly connected, Loopback5 C 10.1.4.0 is directly connected, Loopback4 12.0.0.0/24 is subnetted, 1 subnets C 12.12.12.0 is directly connected, FastEthernet0/0

在R3上配置重分发

复制代码
1
2
3
4
5
R3(config)#router ospf 1 R3(config-router)#redistribute rip metric 200 subnets R3(config-router)#exit R3(config)#router rip R3(config-router)#redistribute ospf 1 metric 10

查看R1路由表,可以看到R4身后的40网段被作为ospf外部路由学习

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
R1#show ip route Gateway of last resort is not set 34.0.0.0/24 is subnetted, 1 subnets O E2 34.34.34.0 [110/200] via 12.12.12.2, 00:00:22, FastEthernet0/0 23.0.0.0/24 is subnetted, 1 subnets O IA 23.23.23.0 [110/2] via 12.12.12.2, 00:12:44, FastEthernet0/0 40.0.0.0/24 is subnetted, 6 subnets O E2 40.1.1.0 [110/200] via 12.12.12.2, 00:00:19, FastEthernet0/0 O E2 40.1.0.0 [110/200] via 12.12.12.2, 00:00:19, FastEthernet0/0 O E2 40.1.3.0 [110/200] via 12.12.12.2, 00:00:19, FastEthernet0/0 O E2 40.1.2.0 [110/200] via 12.12.12.2, 00:00:20, FastEthernet0/0 O E2 40.1.5.0 [110/200] via 12.12.12.2, 00:00:20, FastEthernet0/0 O E2 40.1.4.0 [110/200] via 12.12.12.2, 00:00:20, FastEthernet0/0 10.0.0.0/24 is subnetted, 6 subnets C 10.1.3.0 is directly connected, Loopback3 C 10.1.2.0 is directly connected, Loopback2 C 10.1.1.0 is directly connected, Loopback1 C 10.1.0.0 is directly connected, Loopback0 C 10.1.5.0 is directly connected, Loopback5 C 10.1.4.0 is directly connected, Loopback4 12.0.0.0/24 is subnetted, 1 subnets C 12.12.12.0 is directly connected, FastEthernet0/0

检测网络联通性

复制代码
1
2
3
4
5
6
R1#ping 40.1.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 40.1.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 24/46/76 ms

查看R1链路状态数据库 

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
R1#show ip ospf database OSPF Router with ID (10.1.5.1) (Process ID 1) Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 10.1.5.1 10.1.5.1 1295 0x80000008 0x0031D0 7 23.23.23.2 23.23.23.2 1292 0x80000003 0x005AFB 1 Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 12.12.12.1 10.1.5.1 1295 0x80000001 0x003972 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 23.23.23.0 23.23.23.2 1292 0x80000001 0x001E91 Summary ASB Link States (Area 1) //类型4的LSA用于指出ASBR位置 Link ID ADV Router Age Seq# Checksum 34.34.34.3 23.23.23.2 991 0x80000001 0x006426 Type-5 AS External Link States //类型5的LSA用于描述外网路由 Link ID ADV Router Age Seq# Checksum Tag 34.34.34.0 34.34.34.3 550 0x80000001 0x00E437 0 40.1.0.0 34.34.34.3 550 0x80000001 0x009BBD 0 40.1.1.0 34.34.34.3 550 0x80000001 0x0090C7 0 40.1.2.0 34.34.34.3 550 0x80000001 0x0085D1 0 40.1.3.0 34.34.34.3 550 0x80000001 0x007ADB 0 40.1.4.0 34.34.34.3 550 0x80000001 0x006FE5 0 40.1.5.0 34.34.34.3 550 0x80000001 0x0064EF 0

步骤3:之前的R1的路由表中,显示的外网路由为3条。为了减少路由表的大小,可以在R3上进行外网的路由汇总,具体配置如下:

复制代码
1
2
R3(config)#router ospf 1 R3(config-router)#summary-address 40.1.0.0 255.255.0.0

查看R1路由表,确认汇总成功

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
R1#show ip route Gateway of last resort is not set 34.0.0.0/24 is subnetted, 1 subnets O E2 34.34.34.0 [110/200] via 12.12.12.2, 00:17:33, FastEthernet0/0 23.0.0.0/24 is subnetted, 1 subnets O IA 23.23.23.0 [110/2] via 12.12.12.2, 00:29:55, FastEthernet0/0 40.0.0.0/16 is subnetted, 1 subnets O E2 40.1.0.0 [110/200] via 12.12.12.2, 00:00:49, FastEthernet0/0 10.0.0.0/24 is subnetted, 6 subnets C 10.1.3.0 is directly connected, Loopback3 C 10.1.2.0 is directly connected, Loopback2 C 10.1.1.0 is directly connected, Loopback1 C 10.1.0.0 is directly connected, Loopback0 C 10.1.5.0 is directly connected, Loopback5 C 10.1.4.0 is directly connected, Loopback4 12.0.0.0/24 is subnetted, 1 subnets C 12.12.12.0 is directly connected, FastEthernet0/0

最后

以上就是开放香菇最近收集整理的关于OSPF 外部路由汇总配置详解的全部内容,更多相关OSPF内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(56)

评论列表共有 0 条评论

立即
投稿
返回
顶部