ospf的高級應用之rip!(H3C)

案例一:網絡

1做業要求:ide

  • 把rip學到的路由重分發到ospf中
  • 在rip中注入默認路由指向ospf
  • 實現路由彙總(在ABR上彙總)
  • 配置末梢區域
  • 配置徹底末梢區域

2.拓撲圖oop

image

3.設備介紹: 測試

交換機:HUAWEI QUIDWAY S2000 serialsui

路由器:HUAWEI QUIDWAY R2621blog

4.設備配置:接口

交換機的配置:ip

[Quidway]vlan 10路由

[Quidway-vlan10]description inget

[Quidway-vlan10]port e0/3 to e0/6

[Quidway-vlan10]quit

[Quidway]int Vlan-interface 10

[Quidway-Vlan-interface10]ip add 192.168.1.1 255.255.255.0

[Quidway]vlan 20

[Quidway-vlan20]description out

[Quidway-vlan20]port e0/1 

[Quidway-vlan20]quit

[Quidway]int vlan 20               //進vlan

[Quidway-Vlan-interface20]ip add 192.168.2.1 255.255.255.0   //配IP

[Quidway-Vlan-interface20]quit

[Quidway]ospf                                         //模式請注意:

[Quidway-ospf]area 2                               //進入要宣告網絡的區域

[Quidway-ospf-area-0.0.0.2]network 192.168.1.0 0.0.0.255    //宣告網絡

[Quidway-ospf-area-0.0.0.2]network 192.168.2.0 0.0.0.255

路由器R3的配置:

[R3]int e1

[R3-Ethernet1]ip add 192.168.2.2 255.255.255.0

[R3-Ethernet1]int s0

[R3-Serial0]ip add 192.168.3.1 255.255.255.0

[R3-Serial0]quit

[R3]ospf enable            // 啓用OSPF協議

[R3]int s0                   //進接口 啓用ospf (全部接口都要啓用

[R3-Serial0]ospf enable area 0

[R3-Serial0]int e1

[R3-Ethernet1]ospf enable area 2

路由器R10的配置:

[R10]int s0

[R10-Serial0]ip address 192.168.3.2 24

[R10-Serial0]int s1

[R10-Serial1]ip add 192.168.4.1 24

[R10-Serial1]int e1

[R10-Ethernet1]ip add 192.168.5.1 24

[R10]ospf enable

[R10]int s1

[R10-Serial1]ospf enable area 1

[R10-Serial1]int s0

[R10-Serial0]ospf enable area 0

[R10]rip // 啓動rip協議

[R10-rip]network 192.168.5.0

[r10]int s0                              //串行口的最後一端要復位!

[r10-Serial0]shutdown

[r10-Serial0]undo shutdow

路由器R5的配置:

[R5]int s1

[R5-Serial1]ip add 192.168.4.2 24

[R5]int loo 1                                                   //因爲未接線,因此設置loopback 接口

[R5-LoopBack1]ip add 192.168.8.1 24                   // 主地址

[R5-LoopBack1]ip add 192.168.9.1 24 sub            //配置輔助IP地址 (爲了實現路由彙總)

[R5-LoopBack1]ip add 192.168.10.1 24 sub

[R5-LoopBack1]ip add 192.168.11.1 24 sub

[R5-LoopBack1]quit

[R5]int s1

[R5-Serial1]ospf enable area 1

[R5-Serial1]int lo 1

[R5-LoopBack1]ospf enable area 1

[R5]int s1

[R5-Serial1]shut

[R5-Serial1]undo shut

路由器R9的配置:

[Router]sysname r9

[r9]int e1

[r9-Ethernet1]ip add 192.168.5.2 24

[r9-Ethernet1]int s0

[r9-Serial0]ip add 192.168.6.1 24

[r9-Serial0]qu

[r9]rip                               //啓用rip協議

waiting...

RIP is running

[r9-rip]network 192.168.5.0      //宣告網絡

[r9-rip]network 192.168.6.0

路由器R12的配置:

[r12-Ethernet0]int s0

[r12-Serial0]ip add 192.168.6.2 24

[r12-Serial0]int e1

[r12-Ethernet0]ip add 192.168.7.1 24

[r12]rip

waiting...

RIP is running

[r12-rip]network 192.168.6.0

[r12-rip]network 192.168.7.0

[r12]int s0                               //該接口復位,不然不通

[r12-Serial0]shutdown

[r12-Serial0]undo shutdow

 

5.路由重分發:

[R10]ospf enable

[R10-ospf]import-route direct    //發佈直連路由

[R10-ospf]import-route rip        //把rip學到的路由信息發送到OSPF中

[R10]int null 0                        //必須先建立NULL0

[R10]ip route 0.0.0.0 0 null 0     //用一條默認路由指向該接口,表示:經過該接口的路由都扔掉

[R10]rip

[R10-rip]import static              發佈靜態路由

查看路由表信息以下:

[r9]dis ip rout

Routing Tables:

Destination/Mask Proto Pref Metric Nexthop Interface

0.0.0.0/0 RIP 100 1 192.168.5.1 Ethernet1

127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0

127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0

192.168.5.0/24 Direct 0 0 192.168.5.2 Ethernet1

192.168.5.2/32 Direct 0 0 127.0.0.1 LoopBack0

192.168.6.0/24 Direct 0 0 192.168.6.2 Serial0

192.168.6.1/32 Direct 0 0 127.0.0.1 LoopBack0

192.168.6.2/32 Direct 0 0 192.168.6.2 Serial0

<Quidway>dis ip rout

Routing Table: public net

Destination/Mask Protocol Pre Cost Nexthop Interface

127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0

127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0

192.168.2.0/24 DIRECT 0 0 192.168.2.1 Vlan-interface20

192.168.2.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0

192.168.3.0/24 OSPF 10 1572 192.168.2.2 Vlan-interface20

192.168.3.1/32 O_ASE 150 1 192.168.2.2 Vlan-interface20

192.168.4.0/24 OSPF 10 3134 192.168.2.2 Vlan-interface20

192.168.4.2/32 O_ASE 150 1 192.168.2.2 Vlan-interface20

192.168.5.0/24 O_ASE 150 1 192.168.2.2 Vlan-interface20

192.168.6.0/24 O_ASE 150 1 192.168.2.2 Vlan-interface20

192.168.8.0/24 OSPF 10 4696 192.168.2.2 Vlan-interface20

192.168.9.0/24 OSPF 10 4696 192.168.2.2 Vlan-interface20

192.168.10.0/24 OSPF 10 4696 192.168.2.2 Vlan-interface20

192.168.11.0/24 OSPF 10 4696 192.168.2.2 Vlan-interface20

6.配置末梢區域:

[Quidway]ospf

[Quidway-ospf]area 2

[Quidway-ospf-area-0.0.0.2]stub

[R3]ospf

[R3-ospf]stub cost 100 area 2

[R10-ospf]abr-summary 192.168.8.0 mask 255.255.252.0 area 1

查看路由表:

[R3]dis ip rout

Routing Tables:

Destination/Mask Proto Pref Metric Nexthop Interface

127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0

127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0

192.168.2.0/24 Direct 0 0 192.168.2.2 Ethernet1

192.168.2.2/32 Direct 0 0 127.0.0.1 LoopBack0

192.168.3.0/24 Direct 0 0 192.168.3.2 Serial0

192.168.3.1/32 Direct 0 0 127.0.0.1 LoopBack0

192.168.3.2/32 Direct 0 0 192.168.3.2 Serial0

192.168.4.0/24 OSPF 10 3124 192.168.3.2 Serial0

192.168.4.2/32 O_ASE 150 1 192.168.3.2 Serial0

192.168.5.0/24 O_ASE 150 1 192.168.3.2 Serial0

192.168.6.0/24 O_ASE 150 1 192.168.3.2 Serial0

192.168.8.0/22 OSPF 10 4686 192.168.3.2 Serial0

7.在ABR上配置徹底末梢區域:

[R3-ospf]stub cost 100 area 2 no-summary

[Quidway]dis ip rout

Routing Table: public net

Destination/Mask Protocol Pre Cost Nexthop Interface

0.0.0.0/0 OSPF 10 110 192.168.2.2 Vlan-interface20

127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0

127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0

192.168.2.0/24 DIRECT 0 0 192.168.2.1 Vlan-interface20

192.168.2.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0

8.測試:

本機:

clip_image002

C:\Users\Administrator&gt;ping 192.168.7.253

正在 Ping 192.168.7.253 具備 32 字節的數據:

來自 192.168.7.253 的回覆: 字節=32 時間=41ms TTL=59

來自 192.168.7.253 的回覆: 字節=32 時間=37ms TTL=59

來自 192.168.7.253 的回覆: 字節=32 時間=37ms TTL=59

來自 192.168.7.253 的回覆: 字節=32 時間=37ms TTL=59

192.168.7.253 的 Ping 統計信息:

數據包: 已發送 = 4,已接收 = 4,丟失 = 0 (0% 丟失),

往返行程的估計時間(以毫秒爲單位):

最短 = 37ms,最長 = 41ms,平均 = 38ms

相關文章
相關標籤/搜索