公告

文章

评论

留言

连接

信息

登陆

搜索

2008-7-4 11:18:10
ospf路由汇总

第一步、预配置
r1(config)#int s2/1
r1(config-if)#ip add 12.0.0.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#int lo0
r1(config-if)#ip add 1.1.1.1 255.255.255.0
r1(config)#int lo1
r1(config-if)#ip add 1.1.0.1 255.255.255.0
r1(config-if)#int lo2
r1(config-if)#ip add 1.1.2.1 255.255.255.0
r1(config-if)#int lo3
r1(config-if)#ip add 1.1.3.1 255.255.255.0
r1(config-if)#end
r1(config-if)#exit
r1(config)#router ospf 1
r1(config-router)#net 12.0.0.1 0.0.0.0 a 1
r1(config-router)#net 1.0.0.0 0.255.255.255 a 1
r1(config-router)#end

r2(config)#int s2/1
r2(config-if)#ip add 12.0.0.2 255.255.255.0
r2(config-if)#no sh
r2(config-if)#int s2/2
r2(config-if)#ip add 23.0.0.2 255.255.255.0
r2(config-if)#no sh
r2(config-if)#int lo0
r2(config-if)#ip add 2.2.2.2 255.255.255.0
r2(config-if)#exit
r2(config)#router ospf 1
r2(config-router)#net 12.0.0.2 0.0.0.0 a 1
r2(config-router)#net 2.2.2.2 0.0.0.0 a 1
r2(config-router)#net 23.0.0.2 0.0.0.0 a 0
r2(config-router)#end

r3(config)#int s2/1
r3(config-if)#ip add 23.0.0.3 255.255.255.0
r3(config-if)#no sh
r3(config-if)#int s2/2
r3(config-if)#ip add 34.0.0.3 255.255.255.0
r3(config-if)#no sh
r3(config-if)#int lo0
r3(config-if)#ip add 3.3.3.3 255.255.255.0
r3(config-if)#exit
r3(config)#router ospf 1
r3(config-router)#net 23.0.0.3 0.0.0.0 a 0
r3(config-router)#net 3.3.3.3 0.0.0.0 a 0
r3(config-router)#net 34.0.0.3 0.0.0.0 a 2
r3(config-router)#end


r4(config)#int s2/1
r4(config-if)#ip add 34.0.0.4 255.255.255.0
r4(config-if)#no sh
r4(config-if)#int s2/2
r4(config-if)#ip add 45.0.0.4 255.255.255.0
r4(config-if)#no sh
r4(config-if)#int lo4
r4(config-if)#ip add 4.4.4.4 255.255.255.0
r4(config-if)#exit
r4(config)#router ospf 1
r4(config-router)#net 34.0.0.4 0.0.0.0 a 2
r4(config-router)#router eigrp 100
r4(config-router)#no au
r4(config-router)#net 45.0.0.4 0.0.0.0
r4(config-router)#net 4.0.0.0
r4(config-router)#router ospf 1
r4(config-router)#redistribute eigrp 100 subnets
r4(config-router)#end

r5(config)#int s2/2
r5(config-if)#ip add 45.0.0.5 255.255.255.0
r5(config-if)#no sh
r5(config-if)#int lo0
r5(config-if)#ip add 5.5.5.5 255.255.255.0
r5(config)#int lo1
r5(config-if)#ip add 5.5.0.5 255.255.255.0
r5(config-if)#int lo2
r5(config-if)#ip add 5.5.1.5 255.255.255.0
r5(config-if)#int lo3
r5(config-if)#ip add 5.5.2.5 255.255.255.0
r5(config-if)#int lo4
r5(config-if)#ip add 5.5.3.5 255.255.255.0
r5(config-if)#int lo5
r5(config-if)#ip add 5.5.4.5 255.255.255.0
r5(config-if)#router eigrp 100
r5(config-router)#no au
r5(config-router)#net 45.0.0.5 0.0.0.0
r5(config-router)#net 5.0.0.0
r5(config-router)#end

第二步、配置汇总
1、域外汇总—只能在ASBR上做
r4(config)#router ospf 1
r4(config-router)#summary-address 5.5.0.0 255.255.248.0

r4#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is 34.0.0.3 to network 0.0.0.0

34.0.0.0/24 is subnetted, 1 subnets
C 34.0.0.0 is directly connected, Serial2/1
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/193] via 34.0.0.3, 00:08:15, Serial2/1
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/129] via 34.0.0.3, 00:08:15, Serial2/1
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/65] via 34.0.0.3, 00:08:15, Serial2/1
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback4
5.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
D 5.5.0.0/24 [90/2297856] via 45.0.0.5, 00:03:00, Serial2/2
O 5.5.0.0/21 is a summary, 00:00:06, Null0
D 5.5.1.0/24 [90/2297856] via 45.0.0.5, 00:02:48, Serial2/2
D 5.5.2.0/24 [90/2297856] via 45.0.0.5, 00:02:29, Serial2/2
D 5.5.3.0/24 [90/2297856] via 45.0.0.5, 00:02:12, Serial2/2
D 5.5.4.0/24 [90/2297856] via 45.0.0.5, 00:01:59, Serial2/2
D 5.5.5.0/24 [90/2297856] via 45.0.0.5, 00:05:25, Serial2/2
23.0.0.0/24 is subnetted, 1 subnets
O IA 23.0.0.0 [110/128] via 34.0.0.3, 00:08:16, Serial2/1
12.0.0.0/24 is subnetted, 1 subnets
O IA 12.0.0.0 [110/192] via 34.0.0.3, 00:08:16, Serial2/1
45.0.0.0/24 is subnetted, 1 subnets
C 45.0.0.0 is directly connected, Serial2/2
O*E2 0.0.0.0/0 [110/1] via 34.0.0.3, 00:08:16, Serial2/1

r3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

34.0.0.0/24 is subnetted, 1 subnets
C 34.0.0.0 is directly connected, Serial2/2
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/129] via 23.0.0.2, 00:13:14, Serial2/1
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/65] via 23.0.0.2, 00:13:14, Serial2/1
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
4.0.0.0/24 is subnetted, 1 subnets
O E2 4.4.4.0 [110/20] via 34.0.0.4, 00:13:14, Serial2/2
5.0.0.0/21 is subnetted, 1 subnets 汇总路由
O E2 5.5.0.0 [110/20] via 34.0.0.4, 00:05:06, Serial2/2
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, Serial2/1
12.0.0.0/24 is subnetted, 1 subnets
O IA 12.0.0.0 [110/128] via 23.0.0.2, 00:13:21, Serial2/1
45.0.0.0/24 is subnetted, 1 subnets
O E2 45.0.0.0 [110/20] via 34.0.0.4, 00:12:58, Serial2/2
S* 0.0.0.0/0 is directly connected, Serial2/1


2、域间汇总—只能在ABR上做
r2(config)#router ospf 1
r2(config-router)#area 1 range 1.1.0.0 255.255.252.0

r2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is 23.0.0.3 to network 0.0.0.0

34.0.0.0/24 is subnetted, 1 subnets
O IA 34.0.0.0 [110/128] via 23.0.0.3, 00:00:07, Serial2/2
1.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O 1.1.1.1/32 [110/65] via 12.0.0.1, 00:00:07, Serial2/1
O 1.1.0.0/22 is a summary, 00:00:07, Null0
O 1.1.0.1/32 [110/65] via 12.0.0.1, 00:00:07, Serial2/1
O 1.1.3.1/32 [110/65] via 12.0.0.1, 00:00:07, Serial2/1
O 1.1.2.1/32 [110/65] via 12.0.0.1, 00:00:07, Serial2/1
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/65] via 23.0.0.3, 00:00:07, Serial2/2
4.0.0.0/24 is subnetted, 1 subnets
O E2 4.4.4.0 [110/20] via 23.0.0.3, 00:00:07, Serial2/2
5.0.0.0/21 is subnetted, 1 subnets
O E2 5.5.0.0 [110/20] via 23.0.0.3, 00:00:07, Serial2/2
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, Serial2/2
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, Serial2/1
45.0.0.0/24 is subnetted, 1 subnets
O E2 45.0.0.0 [110/20] via 23.0.0.3, 00:00:07, Serial2/2
O*E2 0.0.0.0/0 [110/1] via 23.0.0.3, 00:00:07, Serial2/2
r2#

r3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

34.0.0.0/24 is subnetted, 1 subnets
C 34.0.0.0 is directly connected, Serial2/2
1.0.0.0/22 is subnetted, 1 subnets 汇总路由
O IA 1.1.0.0 [110/129] via 23.0.0.2, 00:00:15, Serial2/1
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/65] via 23.0.0.2, 00:17:19, Serial2/1
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
4.0.0.0/24 is subnetted, 1 subnets
O E2 4.4.4.0 [110/20] via 34.0.0.4, 00:00:10, Serial2/2
5.0.0.0/21 is subnetted, 1 subnets
O E2 5.5.0.0 [110/20] via 34.0.0.4, 00:00:10, Serial2/2
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, Serial2/1
12.0.0.0/24 is subnetted, 1 subnets
O IA 12.0.0.0 [110/128] via 23.0.0.2, 00:17:22, Serial2/1
45.0.0.0/24 is subnetted, 1 subnets
O E2 45.0.0.0 [110/20] via 34.0.0.4, 00:00:13, Serial2/2
S* 0.0.0.0/0 is directly connected, Serial2/1
r3#


发表评论:

    昵称:
    密码:
    主页:
    标题:
Powered by Oblog.