十一、OSPF實驗

十一、OSPF實驗
實驗目的:1、學習OSPF路由協議的配置。
               2、學習OSPF路由協議對連續網絡無類路由的支持。
               希望大家能仔細研究一下下面ip地址中子網的劃分(參考第七篇)。
實驗拓撲
1、ip地址表:
PC1            IP                     192.168.10.18/28          DG       192.168.10.17
PC2            IP                     192.168.10.34/27          DG       192.168.10.33
R1              F0/0                 192.168.10.17/28
R1              S2/0                  192.168.10.5/30
R2              S2/0                  192.168.10.6/30
R2              S3/0                  192.168.10.9/30
R3              S2/0                  192.168.10.10/30
R3              F0/0                 192.168.10.33/27
2、
R1的配置:
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 192.168.10.17 255.255.255.240
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#exit
R1(config)#interface serial 2/0
R1(config-if)#ip address 192.168.10.5 255.255.255.252
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
R1(config-if)#exit
R1(config)#router ospf 110//啓用ospf路由協議,110爲進程id範圍在1-65535,多個OSPF進程可以在同一個路由器上配置,process-id只在路由器內部起作用,不同路由器的process-id可以不同
R1(config-router)#network 192.168.10.0 0.0.0.255 area 0 
//0爲網絡區域ID area-id在0-4294967295內的十進制數,也可以是帶有IP地址格式的x.x.x.x。當網絡區域ID爲0或0.0.0.0時爲主幹域。不同網絡區域的路由器通過主幹域學習路由信息。
 
 
R2的配置:
R2(config)#interface serial 2/0
R2(config-if)#ip address 192.168.10.6 255.255.255.252
R2(config-if)#clock rate 64000
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial2/0, changed state to up
R2(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
R2(config-if)#exit
R2(config)#interface serial 3/0
R2(config-if)#ip address 192.168.10.9 255.255.255.252
R2(config-if)#clock rate 64000
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial3/0, changed state to down
R2(config-if)#exit
R2(config)#router ospf 111
R2(config-router)#network 192.168.10.0 0.0.0.255 area 0 
 
R3的配置:
R3(config)#interface fastEthernet 0/0
R3(config-if)#ip address 192.168.10.33 255.255.255.224
R3(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R3(config-if)#exit
R3(config)#interface serial 2/0
R3(config-if)#ip address 192.168.10.10 255.255.255.252
R3(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial2/0, changed state to up
R3(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
R3(config-if)#exit
R3(config)#router ospf 112
R3(config-router)#network 192.168.10.0 0.0.0.255 area 0 
 
驗證:PC1  ping  PC2            
PC>ping 192.168.10.34
Pinging 192.168.10.34 with 32 bytes of data:
Request timed out.
Reply from 192.168.10.34: bytes=32 time=168ms TTL=125
Reply from 192.168.10.34: bytes=32 time=157ms TTL=125
Reply from 192.168.10.34: bytes=32 time=167ms TTL=125
 
結論:
1、可見ospf路由協議配置成功;
2、在連續網絡的無類路由中,ospf可以學習到所有子網路由信息。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章