【理論結合模擬器】CCNA筆記之初識OSPF特性


最近在備考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!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章