實驗目的:
1.對ospf的概念有所瞭解。
OSPF(Open Shortest Path First)是一個內部網關協議(Interior Gateway Protocol,簡稱IGP),一個鏈路狀態路由選擇協議,用於在單一自治系統(autonomous system,AS)內決策路由。
OSPF通過路由器之間通告網絡接口的狀態來建立鏈路狀態數據庫,生成最短路徑樹,每個OSPF路由器使用這些最短路徑構造路由表
2學習使用身份驗證
爲了安全的原因,我們可以在相同OSPF區域的路由器上啓用身份驗證的功能,只有經過身份驗證的同一區域的路由器才能互相通告路由信息。
在默認情況下OSPF不使用區域驗證。通過兩種方法可啓用身份驗證功能,純文本身份驗證和消息摘要(md5)身份驗證。純文本身份驗證傳送的身份驗證口令爲純文本,它會被網絡探測器確定,所以不安全,不建議使用。而消息摘要(md5)身份驗證在傳輸身份驗證口令前,要對口令進行加密,所以一般建議使用此種方法進行身份驗證。
使用身份驗證時,區域內所有的路由器接口必須使用相同的身份驗證方法。爲起用身份驗證,必須在路由器接口配置模式下,爲區域的每個路由器接口配置口令。
任務
命令
指定身份驗證
area area-id authentication [message-digest]
使用純文本身份驗證
ip ospf authentication-key password
使用消息摘要(md5)身份驗證 ip ospf message-digest-key keyid md5 key
3.瞭解ospf缺省路由協議配置的基本方法。
配置步驟:
Router1:
en
conf t
host R1
int s0
ip add 2.2.2.1 255.255.255.0
no shut
clock rate 56000
ip ospf message-digest-key 1 md5 cisco
exit
int s1
ip add 5.5.5.1 255.255.255.0
no shut
clock rate 56000
ip ospf message-digest-key 1 md5 cisco
exit
int lo1
ip add 1.1.1.1 255.255.255.0
exit
router ospf 100
net 2.2.2.0 0.0.0.255 area 0
net 5.5.5.0 0.0.0.255 area 0
area 0 authentication message-digest
Router2:
en
conf t
host R2
int s1
ip add 2.2.2.2 255.255.255.0
no shut
ip ospf message-digest-key 1 md5 cisco
exit
int s0
ip add 3.3.3.1 255.255.255.0
clock rate 56000
ip ospf message-digest-key 1 md5 cisco
no shut
exit
int s2
ip add 6.6.6.2 255.255.255.0
exit
route ospf 100
default-information originate
exit
ip route 0.0.0.0 0.0.0.0 3.3.3.2
router ospf 100
net 2.2.2.1 0.0.0.0 area 0
net 3.3.3.0 0.0.0.255 area 0
net 6.6.6.1 0.0.0.0 area 0
area 0 authentication message-digest
Router3:
en
conf t
host R3
int s1
ip add 3.3.3.2 255.255.255.0
no shut
ip ospf message-digest-key 1 md5 cisco
exit
int lo1
ip add 4.4.4.1 255.255.255.0
exit
router ospf 100
net 3.3.3.1 0.0.0.0 area 0
area 0 authentication message-digest
Router4:
en
conf t
host R4
int s0
ip add 5.5.5.2 255.255.255.0
no shut
ip ospf message-digest-key 1 md5 cisco
exit
int s1
ip add 6.6.6.1 255.255.255.0
no shut
clock rate 56000
ip ospf message-digest-key 1 md5 cisco
exit
router ospf 100
net 5.5.5.1 0.0.0.0 area 0
net 6.6.6.0 0.0.0.255 area 0
area 0 authentication message-digest
實驗的結果出現:O*E2路由
實驗中注意:ospf同區域驗證的配置