cheng029 发表于 2012-8-2 09:07:41

ospf的高级应用之rip!(H3C)

案例一:
1作业要求:

[*]把rip学到的路由重分发到ospf中
[*]在rip中注入默认路由指向ospf
[*]实现路由汇总(在ABR上汇总)
[*]配置末梢区域
[*]配置完全末梢区域
2.拓扑图

3.设备介绍:
交换机:HUAWEI QUIDWAY S2000 serials
路由器:HUAWEI QUIDWAY R2621
4.设备配置:
交换机的配置:
vlan 10
description in
port e0/3 to e0/6
quit
int Vlan-interface 10
ip add 192.168.1.1 255.255.255.0
vlan 20
description out
port e0/1
quit
int vlan 20               //进vlan
ip add 192.168.2.1 255.255.255.0   //配IP
quit
ospf                                       //模式请注意:
area 2                               //进入要宣告网络的区域
network 192.168.1.0 0.0.0.255    //宣告网络
network 192.168.2.0 0.0.0.255
路由器R3的配置:
int e1
ip add 192.168.2.2 255.255.255.0
int s0
ip add 192.168.3.1 255.255.255.0
quit
ospf enable            // 启用OSPF协议
int s0                   //进接口 启用ospf (所有接口都要启用)
ospf enable area 0
int e1
ospf enable area 2
路由器R10的配置:
int s0
ip address 192.168.3.2 24
int s1
ip add 192.168.4.1 24
int e1
ip add 192.168.5.1 24
ospf enable
int s1
ospf enable area 1
int s0
ospf enable area 0
rip // 启动rip协议
network 192.168.5.0
int s0                              //串行口的最后一端要复位!
shutdown
undo shutdow
路由器R5的配置:
int s1
ip add 192.168.4.2 24
int loo 1                                                   //由于未接线,所以设置loopback 接口
ip add 192.168.8.1 24                   // 主地址
ip add 192.168.9.1 24 sub            //配置辅助IP地址 (为了实现路由汇总)
ip add 192.168.10.1 24 sub
ip add 192.168.11.1 24 sub
quit
int s1
ospf enable area 1
int lo 1
ospf enable area 1
int s1
shut
undo shut
路由器R9的配置:
sysname r9
int e1
ip add 192.168.5.2 24
int s0
ip add 192.168.6.1 24
qu
rip                               //启用rip协议
waiting...
RIP is running
network 192.168.5.0      //宣告网络
network 192.168.6.0
路由器R12的配置:
int s0
ip add 192.168.6.2 24
int e1
ip add 192.168.7.1 24
rip
waiting...
RIP is running
network 192.168.6.0
network 192.168.7.0
int s0                               //该接口复位,否则不通
shutdown
undo shutdow

5.路由重分发:
ospf enable
import-route direct    //发布直连路由
import-route rip      //把rip学到的路由信息发送到OSPF中
int null 0                        //必须先创建NULL0
ip route 0.0.0.0 0 null 0   //用一条默认路由指向该接口,表示:通过该接口的路由都扔掉
rip
import static            发布静态路由
查看路由表信息如下:
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.配置末梢区域:
ospf
area 2
stub
ospf
stub cost 100 area 2
abr-summary 192.168.8.0 mask 255.255.252.0 area 1
查看路由表:
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上配置完全末梢区域:
stub cost 100 area 2 no-summary
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.测试:
本机:

C:\Users\Administrator>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

111 发表于 2013-3-13 15:20:03

这是什么东东啊

bestjoe 发表于 2013-5-15 18:16:27

男人有冲动可能是爱你,也可能是不爱,但没有冲动肯定是不爱!

十二12 发表于 2013-5-16 07:40:15

商女不知亡国恨、妓女不懂婚外情。

uyfrjk 发表于 2013-5-17 03:17:21

要是我灌水,就骂我“三个代表”没学好吧。

pgup12 发表于 2013-5-17 15:53:02

女,喜甜食,甚胖!该女有一癖好:痛恨蚂蚁,见必杀之。问其故曰:这小东西,那么爱吃甜食,腰还那么细!

yxsailing 发表于 2013-5-18 02:34:45

如果回帖是一种美德,那我早就成为圣人了!
页: [1]
查看完整版本: ospf的高级应用之rip!(H3C)