Skip to main content

tplogin.cn首页 > 新闻资讯 >

【理论结合模拟器】CCNA笔记之初识OSPF特性

2013-08-04 01:11 浏览:

最近在备考CCNA,尽管说CCNA是一个网络管理员的初级证书,网络工程师助理,但如果能好好学透里面的知识的话想当个小白领还是可以做到的;

之前一直都是死背题库,但回过头打开GNS3配置个OSPF,发现我不会。。傻了

以前做过的培训也忘得十有八九了,最后还是决定自己再重来一遍,温故而知新,就当为了考试而加深印象了;

 

为了先了解下OSPF的原理,做了个很简单的拓扑

2-1

接口地址如图;

搭建这个拓扑,我要知道的知识点有这么几个:

1)OSPF是怎么宣告路由的;

2)OSPF有没有自动汇总的特性;

3)OSPF是多久更新一次路由表;

 

然后去每台路由器宣告各自的路由:

R1(config)#router ospf 100

R1(config-router)#network 1.1.1.1 0.0.0.252 area 10

R1(config-router)#network 1.1.2.1 0.0.0.252 area 10

R1(config-router)#network 12.1.1.0 0.0.0.255 area 10

 

R2(config)#router ospf 100

R2(config-router)#network 2.2.2.0 0.0.0.252 area 10

R2(config-router)#network 12.1.1.0 0.0.0.255 area 10

R2(config-router)#network 23.1.1.0 0.0.0.255 area 10

 

R3(config)#router ospf 100

R3(config-router)#network 3.3.3.0 0.0.0.252 area 10

R3(config-router)#network 23.1.1.0 0.0.0.252 area 10

###################################

#每台路由器都要宣告各个接口的地址段,包括互联口;刚开#

#始我也没注意,后来把R3的互联口F0/0地址段no掉了,就#

#发现hello包没了,提示interface down or detached ,#

#再开起来,又正常了!                                            #

###################################

 

这样每台路由器的地址段都宣告完了,接下来就看这三台路由器会不会自动更新路由表,等待10秒看看;

……

R1#show ip route ospf      
    2.0.0.0/32 is subnetted, 1 subnets      
O       2.2.2.2 [110/2] via 12.1.1.2, 00:00:27, FastEthernet0/0      
    3.0.0.0/32 is subnetted, 1 subnets      
O       3.3.3.3 [110/3] via 12.1.1.2, 00:00:27, FastEthernet0/0      
    23.0.0.0/24 is subnetted, 1 subnets      
O       23.1.1.0 [110/2] via 12.1.1.2, 00:00:27, FastEthernet0/0

 

R2#show ip route ospf      
    1.0.0.0/32 is subnetted, 2 subnets      
O       1.1.1.1 [110/2] via 12.1.1.1, 00:01:24, FastEthernet0/0      
O       1.1.2.1 [110/2] via 12.1.1.1, 00:01:24, FastEthernet0/0      
    3.0.0.0/32 is subnetted, 1 subnets      
O       3.3.3.3 [110/2] via 23.1.1.2, 00:01:24, FastEthernet0/1

 

R3#show ip route ospf      
    1.0.0.0/32 is subnetted, 2 subnets      
O       1.1.1.1 [110/3] via 23.1.1.1, 00:01:53, FastEthernet0/0      
O       1.1.2.1 [110/3] via 23.1.1.1, 00:01:53, FastEthernet0/0      
    2.0.0.0/32 is subnetted, 1 subnets      
O       2.2.2.2 [110/2] via 23.1.1.1, 00:01:53, FastEthernet0/0      
    12.0.0.0/24 is subnetted, 1 subnets      
O       12.1.1.0 [110/2] via 23.1.1.1, 00:01:53, FastEthernet0/0

 

三台路由器都能正常获取到路由条目,debug也能看到收到的hello包,

R2片段:

*Mar  1 01:22:07.099: OSPF: Rcv hello from 3.3.3.3 area 10 from FastEthernet0/1 23.1.1.2     
*Mar  1 01:22:07.099: OSPF: End of hello processing      
R2#      
*Mar  1 01:22:08.579: OSPF: Send hello to 224.0.0.5 area 10 on FastEthernet0/0 from 12.1.1.2      
R2#      
*Mar  1 01:22:09.759: OSPF: Send hello to 224.0.0.5 area 10 on FastEthernet0/1 from 23.1.1.1      
R2#      
*Mar  1 01:22:13.127: OSPF: Rcv hello from 1.1.1.1 area 10 from FastEthernet0/0 12.1.1.1      
*Mar  1 01:22:13.127: OSPF: End of hello processing

###################################

#是不是看到了一条比较奇怪的hello包,224.0.0.5是哪里的#

#地址?为什么要send到224.0.0.5这个地址两个hello条目 #

#呢?有什么作用呢?OSPF的hello包是通过组播的方式获取#

#的,所以就像上面提到的关了互联口地址为什么就获取不到#

#了hello包呢就是因为这个,这是个原理性问题,不必深究 #

###################################

 

再回过头看拓扑图,R1中有两个loopback接口并且配置了两个不同网段的IP地址,那要怎么验证OSPF有没有自动汇总的特性呢?

往上翻一下,找到R3的OSPF路由条目,看看是不是有两条到1.0.0.0的路由:

R3#show ip route ospf      
    1.0.0.0/32 is subnetted, 2 subnets      
O       1.1.1.1 [110/3] via 23.1.1.1, 00:01:53, FastEthernet0/0      
O       1.1.2.1 [110/3] via 23.1.1.1, 00:01:53, FastEthernet0/0

上面注释了一句话:1.0.0.0/32 is subnetted, 2 subnets 说明1.0.0.0这个网段里有两个子网;

然后下面的路由条目是具体说明要通过哪一跳才能到这个网段,很明显都是通过23.1.1.1过去的;

自动汇总是用来减少路由条目而实现的,具体我说不出个道道来,免得误导人,详情请百度吧;

记住OSPF默认是不启用自动汇总就行了,但要用到了手动汇总,这是另外一回事了;

 

还有就是说OSPF路由的hello包是多久更新一次,我挂上一段配置就明白了,这都是标准定义的,默认都是这样:

R1#show ip ospf interface fastEthernet 0/0   
FastEthernet0/0 is up, line protocol is up     
 Internet Address 12.1.1.1/24, Area 10     
 Process ID 100, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1    
 Transmit Delay is 1 sec, State DR, Priority 1     
 Designated Router (ID) 1.1.1.1, Interface address 12.1.1.1    
 Backup Designated router (ID) 2.2.2.2, Interface address 12.1.1.2    
 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5    
   oob-resync timeout 40    
   Hello due in 00:00:04    
 Index 2/2, 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  (Backup Designated Router)    
 Suppress hello for 0 neighbor(s)

别的不用看,第八行,hello时间,dead时间,wait时间和retransmit时间,都有写明;这些时间都可以更改,后期再说吧;

 

今天只能写到这了,文章质量不是很高,后期再补上来,

在感慨一句,既然选择了这行,我的付出真的太少太少,还需加倍努力!Fighting!

相关文章

snkrsflow什么意思详细介绍

2022-04-15 08:35:39    浏览: 109

snkrsstash是什么意思详细介绍

2022-04-15 08:35:59    浏览: 85

snkrs养号技巧(附详细教程)

2022-04-15 08:36:20    浏览: 88

手把手教你qq表情怎么删除厘米秀

2022-04-15 08:38:42    浏览: 162

怎么用snkrs抢鞋才能更流畅

2022-04-15 08:38:01    浏览: 67