soug 发表于 2013-7-26 08:44:02

ospf多区域路由与rip区域的路由重发布

在现实的网络中,网络的连接是依靠链路协议链接的,可是协议却各不相同,没法直接连接使用,而常见的惬意是rip协议和ospf协议。今天的实验就是讲将这两个协议联合使用。实验说明:本实验做的是ospf路由与rip路由的连接,因为两者是不同的协议,没法直连,假设ospf是一个大型的网络区域。rip是个很小的网络区域,那么我们可以把rip重发布到ospf,将rip直连到ospf。


按照上图配置相应的端口和路由协议
在r1
int eth 0/0/0
ip add 192.168.1.1 24

loopback local
int s 0/0/0
ip add 192.168.2.1 24

在r2
int s 0/0/0
ip add 192.168.2.2 24
int s 0/0/1
ip add 192.168.3.1 24

int s 0/0/2
ip add 192.168.6.1 24

在r3
int s 0/0/1
ip add 192.168.3.2 24
int s 0/0/0
ip add 192.168.4.1 24
在r4
int s 0/0/0
ip add 192.168.4.2 24

int eth 0/0/0
ip add 192.168.5.1 24
loopback local
在r5
int s 0/0/2
ip add 192.168.6.2 24

int s 0/0/1
ip add 192.168.7.1 24

在r6
int s 0/0/1
ip add 192.168.7.2 24

int eth 0/0/0
ip add 192.168.8.1 24


loopback local

配置ospf区域与rip区域
ospf区域
在r1
ospf 1
area 1

network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
在r2
ospf 1
area 1

network 192.168.2.0 0.0.0.255
ospf 1
area 0

network 192.168.3.0 0.0.0.255
rip
network 192.168.6.0(关键的一个,很多同学在实验是忘记了,导致最后出错)

在r3
ospf 1
area 0
network 192.168.3.0 0.0.0.255

area 2
network 192.168.4.0 0.0.0.255
在r4
ospf 1
area 2
network 192.168.4.0 0.0.0.255
network 192.168.5.0 0.0.0.255
都配置好后
dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 8      Routes : 8      

Destination/Mask    Proto   PreCost      Flags NextHop         Interface

      127.0.0.0/8   Direct0    0         D   127.0.0.1       InLoopBack0
      127.0.0.1/32Direct0    0         D   127.0.0.1       InLoopBack0
    192.168.1.0/24OSPF    10   4687      D   192.168.4.1   Serial0/0/0
    192.168.2.0/24OSPF    10   4686      D   192.168.4.1   Serial0/0/0
    192.168.3.0/24OSPF    10   3124      D   192.168.4.1   Serial0/0/0
    192.168.4.0/24Direct0    0         D   192.168.4.2   Serial0/0/0
    192.168.4.1/32Direct0    0         D   192.168.4.1   Serial0/0/0
    192.168.4.2/32Direct0    0         D   127.0.0.1       Serial0/0/0


ping 192.168.1.1
PING 192.168.1.1: 56data bytes, press CTRL_C to break
    Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=253 time=80 ms
    Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=253 time=70 ms
    Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=253 time=70 ms
    Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=253 time=90 ms
    Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=253 time=110 ms

--- 192.168.1.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 70/84/110 ms


rip区域
在r5
rip
net
network 192.168.7.0
network 192.168.6.0

在r6
rip
network 192.168.7.0
network 192.168.8.0

Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 8      Routes : 8      

Destination/Mask    Proto   PreCost      Flags NextHop         Interface

      127.0.0.0/8   Direct0    0         D   127.0.0.1       InLoopBack0
      127.0.0.1/32Direct0    0         D   127.0.0.1       InLoopBack0
192.168.6.0/24RIP   1001         D   192.168.7.1   Serial0/0/1
    192.168.7.0/24Direct0    0         D   192.168.7.2   Serial0/0/1
    192.168.7.1/32Direct0    0         D   192.168.7.1   Serial0/0/1
    192.168.7.2/32Direct0    0         D   127.0.0.1       Serial0/0/1
    192.168.8.0/24Direct0    0         D   192.168.8.1   Ethernet0/0/0
    192.168.8.1/32Direct0    0         D   127.0.0.1       Ethernet0/0/0


ping 192.168.6.2
PING 192.168.6.2: 56data bytes, press CTRL_C to break
    Reply from 192.168.6.2: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 192.168.6.2: bytes=56 Sequence=2 ttl=255 time=50 ms
    Reply from 192.168.6.2: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 192.168.6.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 192.168.6.2: bytes=56 Sequence=5 ttl=255 time=40 ms


现在rip和ospf都配置好了,只差把rip和ospf连接了
在r2里
进入ospf 1 对rip进行重发布
ospf 1
import-route rip
进入rip 做一个默认路由与ospf连接
rip
default-route originate

查看路由
dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 15       Routes : 15      

Destination/Mask    Proto   PreCost      Flags NextHop         Interface

      127.0.0.0/8   Direct0    0         D   127.0.0.1       InLoopBack0
      127.0.0.1/32Direct0    0         D   127.0.0.1       InLoopBack0
    192.168.1.0/24OSPF    10   1563      D   192.168.2.1   Serial0/0/0
    192.168.2.0/24Direct0    0         D   192.168.2.2   Serial0/0/0
    192.168.2.1/32Direct0    0         D   192.168.2.1   Serial0/0/0
    192.168.2.2/32Direct0    0         D   127.0.0.1       Serial0/0/0
    192.168.3.0/24Direct0    0         D   192.168.3.1   Serial0/0/1
    192.168.3.1/32Direct0    0         D   127.0.0.1       Serial0/0/1
    192.168.3.2/32Direct0    0         D   192.168.3.2   Serial0/0/1
    192.168.4.0/24OSPF    10   3124      D   192.168.3.2   Serial0/0/1
    192.168.6.0/24Direct0    0         D   192.168.6.1   Serial0/0/2
    192.168.6.1/32Direct0    0         D   127.0.0.1       Serial0/0/2
    192.168.6.2/32Direct0    0         D   192.168.6.2   Serial0/0/2
    192.168.7.0/24RIP   1001         D   192.168.6.2   Serial0/0/2
    192.168.8.0/24RIP   1002         D   192.168.6.2   Serial0/0/2


在r6里
ping 192.168.1.1
PING 192.168.1.1: 56data bytes, press CTRL_C to break
    Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=253 time=70 ms
    Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=253 time=70 ms
    Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=253 time=70 ms
    Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=253 time=90 ms
    Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=253 time=60 ms


ping 192.168.5.1
PING 192.168.5.1: 56data bytes, press CTRL_C to break
    Reply from 192.168.5.1: bytes=56 Sequence=1 ttl=252 time=90 ms
    Reply from 192.168.5.1: bytes=56 Sequence=2 ttl=252 time=90 ms
    Reply from 192.168.5.1: bytes=56 Sequence=3 ttl=252 time=100 ms
    Reply from 192.168.5.1: bytes=56 Sequence=4 ttl=252 time=90 ms
    Reply from 192.168.5.1: bytes=56 Sequence=5 ttl=252 time=110 ms


OK!证明我们的实验完全没有问题,rip和ospf已经形成了链路


cjcmay 发表于 2013-7-26 22:01:44

有道理。。。

hongleimi 发表于 2013-7-27 23:09:03

不要在一棵树上吊死,在附近几棵树上多试试死几次~

huazhi 发表于 2013-7-28 14:50:02

微机原理闹危机,随机过程随机过,实变函数学十遍,汇编语言不会编!

想你了的他他 发表于 2013-7-28 21:14:17

不在课堂上沉睡,就在酒桌上埋醉。

fateame 发表于 2013-7-29 06:48:09

走,MM,咱们化蝶去……

xxxmenger 发表于 2013-7-29 20:42:16

睡眠是一门艺术——谁也无法阻挡我追求艺术的脚步!
页: [1]
查看完整版本: ospf多区域路由与rip区域的路由重发布