OSPF外部路由實驗-基礎(chǔ)篇
?

實驗說明:
R1通過靜態(tài)路由訪問公司B的服務(wù)器網(wǎng)段192.168.1.0/24,由于公司A也需要訪問公司B的服務(wù)器,所以需要在R1上將該靜態(tài)路由引入OSPF,使得公司A也能訪問服務(wù)器.
?
詳細(xì)配置:
1.公司A網(wǎng)絡(luò)配置接口ip并宣告進(jìn)相應(yīng)ospf,保證PC1和PC2之間連通
R1
interface g0/0/0
ip add 10.1.12.1 24
interface g0/0/1
ip add 10.1.13.1 24
interface g0/0/2
ip add 10.1.15.1 24
ospf 1 router-id 1.1.1.1
area 0
network 10.1.12.1 0.0.0.0
area 2
network 10.1.13.1 0.0.0.0
R2
interface g0/0/1
ip add 10.1.24.2 24
interface g0/0/0
ip add 10.1.12.2 24
ospf 1 router-id 2.2.2.2
area 0
network 10.1.12.2 0.0.0.0
area 1
network 10.1.24.2 0.0.0.0
R3
interface g0/0/0
ip add 10.1.13.3 24
interface g0/0/1
ip add 10.1.2.254 24
ospf 1 router-id 3.3.3.3
area 2
network 10.1.13.3 0.0.0.0
network 10.1.2.254 0.0.0.0
R4
interface g0/0/0
ip add 10.1.24.4 24
interface g0/0/1
ip add 10.1.1.254 24
ospf 1 router-id 4.4.4.4
area 1
network 10.1.24.4 0.0.0.0
network 10.1.1.254 0.0.0.0
PC1

PC2

檢查現(xiàn)象:PC1可以ping通PC2

display ospf peer brief


?
2.公司B相關(guān)配置
(1) 相關(guān)接口ip配置
R5
interface g0/0/0
ip add 10.1.15.5 24
interface g0/0/1
ip add 192.168.1.254 24
Server

(2) R5做為出口路由器配置默認(rèn)路由
R5
ip route-static 0.0.0.0 0 10.1.15.1
檢查現(xiàn)象:display ip routing-table

3.保證公司A能夠訪問公司B的server
(1) R1上配置一條靜態(tài)指向Server
R1
ip route-static 192.168.1.0 24 10.1.15.5
檢查現(xiàn)象:R1-ping 192.168.1.1

(2) R1上將靜態(tài)路由引入進(jìn)ospf
R1
ospf 1
import-route static
檢查現(xiàn)象:R1,R2,R3,R4 display ospf LSDb都能看見5類外部LSA

display ospf LSDB ase 192.168.1.0

R4上還能看到R2通告給它的4類LSA

PC2 ping 192.168.1.1

好啦,今天的干貨內(nèi)容就到這里,如果你覺得小老虎的內(nèi)容還不錯,那請大家動動手分享給身邊的小伙伴!