ospf路由域间汇总和域外汇总

更新时间:2023-11-02 21:29:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

OSPF域间路由汇总与域外路由汇总

R1

R1>en

R1(config)#line console 0 R1(config-line)#logg s R1(config-line)#no exec-t R1(config-line)#exit

R1(config)#interface s1/0

R1(config-if)#ip add

R1(config-if)#ip address 12.1.1.1 255.255.255.0 R1(config-if)#no sh

R1(config-if)#no shutdown R1(config-if)#interface s1/1

R1(config-if)#ip add 13.1.1.1 255.255.255.0 R1(config-if)#no sh

R1(config-if)#no shutdown R1(config-if)#interface lo 0

R1(config-if)#ip add 1.1.1.1 255.255.255.0 R1(config-if)#exit

R1(config)#router ospf 110

R1(config-router)#router-id 1.1.1.1

R1(config-router)#network 12.1.1.0 0.0.0.255 a 0 R1(config-router)#network 13.1.1.0 0.0.0.255 a 0 R1(config-router)#network 1.1.1.0 0.0.0.255 a 0 R1(config-router)#end

R1#show ip route

1.0.0.0/24 is subnetted, 1 subnets

C 1.1.1.0 is directly connected, Loopback0 35.0.0.0/24 is subnetted, 1 subnets

O IA 35.1.1.0 [110/128] via 13.1.1.3, 00:04:54, Serial1/1 2.0.0.0/32 is subnetted, 1 subnets

O 2.2.2.2 [110/65] via 12.1.1.2, 00:05:26, Serial1/0 3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 [110/65] via 13.1.1.3, 00:04:44, Serial1/1 4.0.0.0/32 is subnetted, 1 subnets

O IA 4.4.4.4 [110/129] via 12.1.1.2, 00:04:15, Serial1/0 5.0.0.0/32 is subnetted, 1 subnets

O IA 5.5.5.5 [110/129] via 13.1.1.3, 00:03:18, Serial1/1 172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks O IA 172.16.0.4/32 [110/129] via 12.1.1.2, 00:00:08, Serial1/0 O IA 172.16.1.0/24 [110/129] via 12.1.1.2, 00:00:08, Serial1/0 O IA 172.16.2.0/24 [110/129] via 12.1.1.2, 00:00:08, Serial1/0 O IA 172.16.3.0/24 [110/129] via 12.1.1.2, 00:00:08, Serial1/0 24.0.0.0/24 is subnetted, 1 subnets

O IA 24.1.1.0 [110/128] via 12.1.1.2, 00:05:37, Serial1/0 12.0.0.0/24 is subnetted, 1 subnets

C 12.1.1.0 is directly connected, Serial1/0 13.0.0.0/24 is subnetted, 1 subnets

C 13.1.1.0 is directly connected, Serial1/1

R1#show ip route

Gateway of last resort is not set

1.0.0.0/24 is subnetted, 1 subnets

C 1.1.1.0 is directly connected, Loopback0 35.0.0.0/24 is subnetted, 1 subnets

O IA 35.1.1.0 [110/128] via 13.1.1.3, 00:07:49, Serial1/1 2.0.0.0/32 is subnetted, 1 subnets

O 2.2.2.2 [110/65] via 12.1.1.2, 00:08:21, Serial1/0 3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 [110/65] via 13.1.1.3, 00:07:39, Serial1/1 4.0.0.0/32 is subnetted, 1 subnets

O IA 4.4.4.4 [110/129] via 12.1.1.2, 00:07:10, Serial1/0 5.0.0.0/32 is subnetted, 1 subnets

O IA 5.5.5.5 [110/129] via 13.1.1.3, 00:06:13, Serial1/1 172.16.0.0/22 is subnetted, 1 subnets

O IA 172.16.0.0 [110/129] via 12.1.1.2, 00:00:30, Serial1/0 24.0.0.0/24 is subnetted, 1 subnets

O IA 24.1.1.0 [110/128] via 12.1.1.2, 00:08:33, Serial1/0 12.0.0.0/24 is subnetted, 1 subnets

C 12.1.1.0 is directly connected, Serial1/0 13.0.0.0/24 is subnetted, 1 subnets

C 13.1.1.0 is directly connected, Serial1/1 R1#show ip route

Gateway of last resort is not set

1.0.0.0/24 is subnetted, 1 subnets

C 1.1.1.0 is directly connected, Loopback0 35.0.0.0/24 is subnetted, 1 subnets

O IA 35.1.1.0 [110/128] via 13.1.1.3, 00:11:19, Serial1/1 2.0.0.0/32 is subnetted, 1 subnets

O 2.2.2.2 [110/65] via 12.1.1.2, 00:11:52, Serial1/0 3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 [110/65] via 13.1.1.3, 00:11:09, Serial1/1 4.0.0.0/32 is subnetted, 1 subnets

O IA 4.4.4.4 [110/129] via 12.1.1.2, 00:10:41, Serial1/0 5.0.0.0/32 is subnetted, 1 subnets

O IA 5.5.5.5 [110/129] via 13.1.1.3, 00:09:44, Serial1/1 172.16.0.0/22 is subnetted, 1 subnets

O IA 172.16.0.0 [110/129] via 12.1.1.2, 00:04:00, Serial1/0 24.0.0.0/24 is subnetted, 1 subnets

O IA 24.1.1.0 [110/128] via 12.1.1.2, 00:12:03, Serial1/0 O E2 192.168.0.0/24 [110/20] via 13.1.1.3, 00:00:02, Serial1/1 12.0.0.0/24 is subnetted, 1 subnets

C 12.1.1.0 is directly connected, Serial1/0

O E2 192.168.1.0/24 [110/20] via 13.1.1.3, 00:00:02, Serial1/1 13.0.0.0/24 is subnetted, 1 subnets

C 13.1.1.0 is directly connected, Serial1/1

O E2 192.168.2.0/24 [110/20] via 13.1.1.3, 00:00:02, Serial1/1 O E2 192.168.3.0/24 [110/20] via 13.1.1.3, 00:00:02, Serial1/1 R1#show ip route

Gateway of last resort is not set

1.0.0.0/24 is subnetted, 1 subnets

C 1.1.1.0 is directly connected, Loopback0 35.0.0.0/24 is subnetted, 1 subnets

O IA 35.1.1.0 [110/128] via 13.1.1.3, 00:12:34, Serial1/1 2.0.0.0/32 is subnetted, 1 subnets

O 2.2.2.2 [110/65] via 12.1.1.2, 00:13:06, Serial1/0 3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 [110/65] via 13.1.1.3, 00:12:24, Serial1/1 4.0.0.0/32 is subnetted, 1 subnets

O IA 4.4.4.4 [110/129] via 12.1.1.2, 00:11:55, Serial1/0 5.0.0.0/32 is subnetted, 1 subnets

O IA 5.5.5.5 [110/129] via 13.1.1.3, 00:10:58, Serial1/1 172.16.0.0/22 is subnetted, 1 subnets

O IA 172.16.0.0 [110/129] via 12.1.1.2, 00:05:15, Serial1/0 24.0.0.0/24 is subnetted, 1 subnets

O IA 24.1.1.0 [110/128] via 12.1.1.2, 00:13:17, Serial1/0 O E2 192.168.0.0/24 [110/20] via 13.1.1.3, 00:00:04, Serial1/1 12.0.0.0/24 is subnetted, 1 subnets

C 12.1.1.0 is directly connected, Serial1/0 13.0.0.0/24 is subnetted, 1 subnets

C 13.1.1.0 is directly connected, Serial1/1

O E2 192.168.0.0/22 [110/20] via 13.1.1.3, 00:00:04, Serial1/1

R2

R2>en R2#conf t

R2(config)#no ip domain-lookup R2(config)#line console 0 R2(config-line)#logg s R2(config-line)#no exec-t R2(config-line)#exit

R2(config)#interface s1/0

R2(config-if)#ip add 12.1.1.2 255.255.255.0 R2(config-if)#no sh

R2(config-if)#no shutdown R2(config-if)#interface s1/1

R2(config-if)#ip add 24.1.1.2 255.255.255.0 R2(config-if)#no sh

R2(config-if)#interface lo 0

R2(config-if)#ip add 2.2.2.2 255.255.255.0 R2(config-if)#exit

R2(config)#router ospf 110

R2(config-router)#router-id 2.2.2.2

R2(config-router)#network 12.1.1.0 0.0.0.255 a 0 R2(config-router)#network 24.1.1.0 0.0.0.255 a 1

R2(config-router)#network 2.2.2.0 0.0.0.255 a 0

R2(config-router)#area 1 range 172.16.0.0 255.255.252.0

R2(config-router)#do show ip route

Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets

O 1.1.1.1 [110/65] via 12.1.1.1, 00:00:45, Serial1/0 35.0.0.0/24 is subnetted, 1 subnets

O IA 35.1.1.0 [110/192] via 12.1.1.1, 00:00:45, Serial1/0 2.0.0.0/24 is subnetted, 1 subnets

C 2.2.2.0 is directly connected, Loopback0 3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 [110/129] via 12.1.1.1, 00:00:45, Serial1/0 4.0.0.0/32 is subnetted, 1 subnets

O 4.4.4.4 [110/65] via 24.1.1.4, 00:00:45, Serial1/1 5.0.0.0/32 is subnetted, 1 subnets

O IA 5.5.5.5 [110/193] via 12.1.1.1, 00:00:45, Serial1/0 172.16.0.0/16 is variably subnetted, 5 subnets, 3 masks O 172.16.0.4/32 [110/65] via 24.1.1.4, 00:00:47, Serial1/1 O 172.16.0.0/22 is a summary, 00:00:47, Null0

O 172.16.1.0/24 [110/65] via 24.1.1.4, 00:00:47, Serial1/1 O 172.16.2.0/24 [110/65] via 24.1.1.4, 00:00:47, Serial1/1 O 172.16.3.0/24 [110/65] via 24.1.1.4, 00:00:47, Serial1/1 24.0.0.0/24 is subnetted, 1 subnets

C 24.1.1.0 is directly connected, Serial1/1 12.0.0.0/24 is subnetted, 1 subnets

C 12.1.1.0 is directly connected, Serial1/0 13.0.0.0/24 is subnetted, 1 subnets

O 13.1.1.0 [110/128] via 12.1.1.1, 00:00:47, Serial1/0

R3

R3>en

R3(config)#no ip domain-lookup R3(config)#line console 0 R3(config-line)#logg s R3(config-line)#no exec-t R3(config-line)#exit

R3(config)#interface s1/1

R3(config-if)#ip add 13.1.1.3 255.255.255.0 R3(config-if)#no sh

R3(config-if)#no shutdown R3(config-if)#interface s1/0

R3(config-if)#ip add 35.1.1.3 255.255.255.0 R3(config-if)#no sh

R3(config-if)#no shutdown R3(config-if)#interface lo 0

R3(config-if)#ip add 3.3.3.3 255.255.255.0 R3(config-if)#exit

R3(config)#router ospf 110 R3(config-router)#router-id 3.3.3.3

R3(config-router)#network 13.1.1.0 0.0.0.255 a 0 R3(config-router)#network 35.1.1.0 0.0.0.255 a 2 R3(config-router)#network 3.3.3.0 0.0.0.255 a 0

R4

R4>en R4#conf t

R4(config)#no ip domain-lookup R4(config)#line console 0 R4(config-line)#logg s R4(config-line)#no exec-t R4(config-line)#exit

R4(config)#interface s1/1 R4(config-if)#ip add

R4(config-if)#ip address 24.1.1.4 255.255.255.0 R4(config-if)#no sh

R4(config-if)#no shutdown R4(config-if)#interface lo 0

R4(config-if)#ip add 4.4.4.4 255.255.255.0 R4(config-if)#exit

R4(config)#router ospf 110

R4(config-router)#router-id 4.4.4.4

R4(config-router)#network 24.1.1.0 0.0.0.255 a 1 R4(config-router)#network 4.4.4.0 0.0.0.255 a 1 R4(config-router)#exit

R4(config)#interface lo 1

R4(config-if)#ip address 172.16.0.4 255.255.255.0

R4(config-if)#ip address 172.16.1.4 255.255.255.0 secondary R4(config-if)#ip address 172.16.2.4 255.255.255.0 secondary

R4(config-if)#ip address 172.16.3.4 255.255.255.0 secondary R4(config-if)#exit

R4(config)#router ospf 110

R4(config-router)#network 172.16.0.0 0.0.3.255 a 1

R5

R5>en R5#conf t

R5(config)#no ip domain-lookup R5(config)#line console 0 R5(config-line)#logg s R5(config-line)#no exec-t R5(config-line)#exit

R5(config)#interface s1/0

R5(config-if)#ip add 35.1.1.5 255.255.255.0 R5(config-if)#no sh

R5(config-if)#no shutdown R5(config-if)#interface lo 0

R5(config-if)#ip add 5.5.5.5 255.255.255.0 R5(config-if)#exit

R5(config)#router ospf 110

R5(config-router)#router-id 5.5.5.5

R5(config-router)#network 35.1.1.0 0.0.0.255 a 2 R5(config-router)#network 5.5.5.0 0.0.0.255 a 2

R5(config-router)#do show ip route Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets

O IA 1.1.1.1 [110/129] via 35.1.1.3, 00:06:31, Serial1/0 35.0.0.0/24 is subnetted, 1 subnets

C 35.1.1.0 is directly connected, Serial1/0 2.0.0.0/32 is subnetted, 1 subnets

O IA 2.2.2.2 [110/193] via 35.1.1.3, 00:06:31, Serial1/0 3.0.0.0/32 is subnetted, 1 subnets

O IA 3.3.3.3 [110/65] via 35.1.1.3, 00:06:31, Serial1/0 4.0.0.0/32 is subnetted, 1 subnets

O IA 4.4.4.4 [110/257] via 35.1.1.3, 00:06:31, Serial1/0 5.0.0.0/24 is subnetted, 1 subnets

C 5.5.5.0 is directly connected, Loopback0 172.16.0.0/22 is subnetted, 1 subnets

O IA 172.16.0.0 [110/257] via 35.1.1.3, 00:00:17, Serial1/0 24.0.0.0/24 is subnetted, 1 subnets

O IA 24.1.1.0 [110/256] via 35.1.1.3, 00:06:32, Serial1/0 12.0.0.0/24 is subnetted, 1 subnets

O IA 12.1.1.0 [110/192] via 35.1.1.3, 00:06:32, Serial1/0 13.0.0.0/24 is subnetted, 1 subnets

O IA 13.1.1.0 [110/128] via 35.1.1.3, 00:06:32, Serial1/0

R5(config-router)#exit R5(config)#interface lo 1

R5(config-if)#ip address 192.168.0.5 255.255.255.0

R5(config-if)#ip address 192.168.1.5 255.255.255.0 secondary R5(config-if)#ip address 192.168.2.5 255.255.255.0 secondary R5(config-if)#ip address 192.168.3.5 255.255.255.0 secondary R5(config-if)#exit

R5(config)#router ospf 110

R5(config-router)#redistribute connected subnets

R5(config-router)#summary-address 192.168.0.0 255.255.252.0

R5(config-router)#do show ip route Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets

O IA 1.1.1.1 [110/129] via 35.1.1.3, 00:11:41, Serial1/0 35.0.0.0/24 is subnetted, 1 subnets

C 35.1.1.0 is directly connected, Serial1/0 2.0.0.0/32 is subnetted, 1 subnets

O IA 2.2.2.2 [110/193] via 35.1.1.3, 00:11:41, Serial1/0 3.0.0.0/32 is subnetted, 1 subnets

O IA 3.3.3.3 [110/65] via 35.1.1.3, 00:11:41, Serial1/0 4.0.0.0/32 is subnetted, 1 subnets

O IA 4.4.4.4 [110/257] via 35.1.1.3, 00:11:41, Serial1/0 5.0.0.0/24 is subnetted, 1 subnets

C 5.5.5.0 is directly connected, Loopback0 172.16.0.0/22 is subnetted, 1 subnets

O IA 172.16.0.0 [110/257] via 35.1.1.3, 00:05:26, Serial1/0 24.0.0.0/24 is subnetted, 1 subnets

O IA 24.1.1.0 [110/256] via 35.1.1.3, 00:11:41, Serial1/0 C 192.168.0.0/24 is directly connected, Loopback1 12.0.0.0/24 is subnetted, 1 subnets

O IA 12.1.1.0 [110/192] via 35.1.1.3, 00:11:41, Serial1/0

C 192.168.1.0/24 is directly connected, Loopback1 13.0.0.0/24 is subnetted, 1 subnets

O IA 13.1.1.0 [110/128] via 35.1.1.3, 00:11:41, Serial1/0 C 192.168.2.0/24 is directly connected, Loopback1 C 192.168.3.0/24 is directly connected, Loopback1 O 192.168.0.0/22 is a summary, 00:00:15, Null0 R5(config-router)#

本文来源:https://www.bwwdw.com/article/6t52.html

Top