立即注册 登录
雏鹰部落 返回首页

子杰的个人空间 https://bbs.spoto.net/?131778 [收藏] [复制] [分享] [RSS]

日志

OSPF基本配置案例

已有 607 次阅读2013-2-25 17:54

 

1     案例配置拓扑

            

    2   IP地址规划

 

Fastethernet0/0

Fastethernet1/0

R1

192168.12.1/24

N/A

R2

192.168.12.2/24

192.168.23.2/24

R3

192.168.23.3/24

N/A

3     案例配置需求

1.     R1R2R3三台路由器运行OSPF协议,进程为1

2.     指定R1R2R3Router-id分别为1.1.1.12.2.2.23.3.3.3 ,并实现设备能相互通信。

3.     查看路由的协议、路由表、邻居表。

 

4     案例配置思路

一:先配R1R2R3的接口地址。

(config)#interface fastEthernet 0/0

(config-if)#ip address x.x.x.x x.x.x.x

二:R1/R2/R3运行OSPF协议,进程为1

(config)#router ospf 1                          //开启OSPF协议,进程号为1//

(config-router)#router-id x.x.x.x                 //手动指定Router-id//

5     案例检验结果

1)     先查看路由的协议:

R1#show ip protocols

Routing Protocol is "ospf 1"

  Outgoing ** filter list for all interfaces is not set

  Incoming ** filter list for all interfaces is not set

  Router ID 1.1.1.1

  Number of areas in this router is 1. 1 normal 0 stub 0 nssa

  Maximum path: 4

  Routing for Networks:

    192.168.12.0 0.0.0.255 area 0

 Reference bandwidth unit is 100 mbps

  Routing Information Sources:

    Gateway         Distance      Last **

    3.3.3.3              110      00:20:56

  Distance: (default is 110)

/上面显示的OSPF协议,且进程号为1AD(管理距离)默认为110/

 

2)     查看运行OSPF时,默认的网络类型是什么:

R1#show ip ospf int fastEthernet 0/0

FastEthernet0/0 is up, line protocol is up

  Internet Address 192.168.12.1/24, Area 0

  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1

  Transmit Delay is 1 sec, State BDR, Priority 1

  Designated Router (ID) 2.2.2.2, Interface address 192.168.12.2

  Backup Designated router (ID) 1.1.1.1, Interface address 192.168.12.1

  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

    oob-resync timeout 40

    Hello due in 00:00:09

  Supports Link-local Signaling (LLS)

  Index 1/1, flood queue length 0

  Next 0x0(0)/0x0(0)

  Last flood scan length is 1, maximum is 1

  Last flood scan time is 0 msec, maximum is 0 msec

  Neighbor Count is 1, Adjacent neighbor count is 1

    Adjacent with neighbor 2.2.2.2  (Designated Router)

  Suppress hello for 0 neighbor(s)

/上面显示的是默认下运行OSPF的网络类型为广播(BROADCAST),且hello时间为10Sdead时间为40S/

 

3)     查看邻居表:

R2#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface

3.3.3.3           1   FULL/DR         00:00:32    192.168.23.3    FastEthernet1/0

1.1.1.1           1   FULL/BDR        00:00:32    192.168.12.1    FastEthernet0/0

/上面显示的是FULL(在广播网络环境,邻居建立成功显示的FULL),代表的是OSPF邻居建立成功,且优先级为1/

 

4)     查看路由表:

R1#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 not set

 

C    192.168.12.0/24 is directly connected, FastEthernet0/0

O    192.168.23.0/24 [110/2] via 192.168.12.2, 00:32:57, FastEthernet0/0

/上面显示的O表示OSPF的路由条目/

6    案例配置文件

  

 R1:

enable
conf t
hostname R1
!
interface FastEthernet0/0
 ip address 192.168.12.1 255.255.255.0
 no shutdown
 exit
!
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 network 192.168.12.0 0.0.0.255 area 0
!
end

 

R2:


enable
conf t
hostname R2
!
interface FastEthernet0/0
 ip address 192.168.12.2 255.255.255.0
 no shutdown
 exit
!
interface FastEthernet1/0
 ip address 192.168.23.2 255.255.255.0
 no shutdown
 exit
!
router ospf 1
 router-id 2.2.2.2
 log-adjacency-changes
 network 192.168.12.0 0.0.0.255 area 0
 network 192.168.23.0 0.0.0.255 area 0
!
end

 

R3:


enable
conf t
hostname R3
!
interface FastEthernet0/0
 ip address 192.168.23.3 255.255.255.0
 no shutdown
 exit
!
router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
 network 192.168.23.0 0.0.0.255 area 0
!
end

7     案例总结及其它

1.     OSPFhello时间为10SDead时间为40S,管理距离是110

2.     在以太网环境中,默认下OSPF的网络类型为broadcast。优先级默认为1

3.     FULL状态表示邻居已建立成功,注意建立邻居是区域号要相同。

 

 

 

 

 

 

 

 

 

-----------------------------------------------------------------------------------------

SPOTO 我们共创未来

 

您的朋友 周俊杰(Jay)

Email:zhoujj@spoto.net

网 站: http://www.SPOTO.net

新浪博客:http://blog.sina.com.cn/zhoujj0130

-----------------------------------------------------------------------------------------

 

 

路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 立即注册

QQ|熊猫同学技术论坛|小黑屋| 网络工程师论坛 ( 沪ICP备09076391 )

GMT+8, 2024-4-28 08:28 , Processed in 0.061631 second(s), 18 queries , Gzip On.

返回顶部