OSPF多区域基本配置

2009年5月18日 发表评论 阅读评论

实验目的:

1、掌握多区域的OSPF配置方法。

2、区别不同区域的路由。

3、掌握OSPF的基本配置命令。

配置步骤:

1.进入R1

Enable

R1#config t

R1(config)# interface s0/0

R1(config-if)# Ip address 192.168.1.1 255.255.255.252

R1(config-if)# No shutdown

R1(config-if)# exit

Interface lo 0

Ip address 10.10.1.1 255.255.255.0

No shut

Exit

Interface lo 1

Ip address 10.10.2.1 255.255.255.0

No shut

exit

2.进入R2

Enable

Config t

Inter s0/0

Ip add 192.168.1.2 255.255.255.252

No shut

Exit

Interface s0/1

Ip address 192.168.1.5 255.255.255.252

No shut

Exit

参照R1和R2配置R3和R4

并用ping命令测试各接口的联通性

3、在R1上进行area 1区域OSPF配置。

R1(config)#router ospf 1

R1(config-router)#network 10.1.2.0 0.0.0.255 area 1

R1(config-roeter)#network 10.1.1.0 0.0.0.255 area 1

R1(config-router)#network 192.168.1.0 0.0.0.3 area 1

R1(config-router)#exit

在R2上进行area1与area2的区域边界路由器(ABR)的OSPF配置。

R2(config)#router ospf 1

R2(config-router)#network 192.168.1.0 0.0.0.3 area 1

R2(config-router)#network 192.168.1.4 0.0.0.3 area 0

R2(config)#exit

参照R1与R2的配置,完成R3与R4的配置。

完成后:

Show ip route  //查看路由表

R1#show ip route

Codes: C – connected, S – static, I – IGRP, 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, E – EGP

…………

Gateway of last resort is not set

172.16.0.0/32 is subnetted, 2 subnets

O IA 172.16.1.1 [110/193] via 192.168.1.2, 00:02:23, Serial0/1

O IA 172.16.2.1 [110/193] via 192.168.1.2, 00:02:23, Serial0/1

10.0.0.0/24 is subnetted, 2 subnets

C 10.1.2.0 is directly connected, Loopback1

C 10.1.1.0 is directly connected, Loopback0

192.168.1.0/30 is subnetted, 3 subnets

O IA 192.168.1.8 [110/192] via 192.168.1.2, 00:02:58, Serial0/1

C 192.168.1.0 is directly connected, Serial0/1

O IA 192.168.1.4 [110/128] via 192.168.1.2, 00:05:06, Serial0/1

R1#

Show ip ospf neighbor //查看ospf邻居表

Show ip ospf database //查看ospf的链路状态数据库

R1#show ip ospf database

OSPF Router with ID (10.1.2.1) (Process ID 1)

Router Link States (Area 1)

Link ID ADV Router Age Seq# Checksum Link count

10.1.2.1 10.1.2.1 492 0×80000004 0×00C83F 4

192.168.1.5 192.168.1.5 486 0×80000003 0×002BB5 2

Summary Net Link States (Area 1)

Link ID ADV Router Age Seq# Checksum

172.16.1.1 192.168.1.5 315 0×80000001 0×00CCC0

172.16.2.1 192.168.1.5 315 0×80000001 0×00C1CA

192.168.1.4 192.168.1.5 479 0×80000001 0×00E33E

192.168.1.8 192.168.1.5 350 0×80000001 0×003E9F

R1#

ping测试连通性:

R1#ping 172.16.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 216/240/288 ms

  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.