OSPF中路由重分发的实例

网络拓扑

说明:要实现整个网络的通信,在现实当中需要在R1上做NAT来实现与ISP的通信,本案例省略NAT的配置,在ISP路由器上配置默认路由来实现通信,而且需要在R2R3上配置OSPFRIP)重分发和静态路由和直连路由的重分发,从而实现全网的互通,具体的配置如下:

1)配置各路由器,以及OSPF协议、RIP协议、静态路由、接口IP地址

R1的配置如下:

接口地址

R1#conf t

R1(config)#int lo0

R1(config-if)#ip add 1.1.1.1 255.255.255.255

R1(config-if)#no sh

R1(config-if)#exit

R1(config)#int e0/0

R1(config-if)#ip add 10.0.0.5 255.255.255.252

R1(config-if)#no sh

R1(config-if)#exit

R1(config)#int e0/1

R1(config-if)#ip add 172.16.31.1 255.255.255.252

R1(config-if)#no sh

R1(config-if)#exit

R1(config)#int e0/2

R1(config-if)#ip add 192.168.1.1 255.255.255.0 

R1(config-if)#no sh

R1(config-if)#exit

R1(config)#int e0/3

R1(config-if)#ip add 10.0.0.1 255.255.255.252

R1(config-if)#no sh

R1(config-if)#exit

OSPF协议

R1(config)#router ospf 1

R1(config-router)#router-id 1.1.1.1

R1(config-router)#network 1.1.1.1 0.0.0.0 area 0

R1(config-router)#network 10.0.0.0 0.0.0.3 area 0

R1(config-router)#network 10.0.0.4 0.0.0.3 area 1

R1(config-router)#network 192.168.1.0 0.0.0.255 area 0

R1(config-router)#exit

默认路由

R1(config)#ip route 0.0.0.0 0.0.0.0 172.16.31.2

 

R2的配置如下:

接口地址

R2#conf t

R2(config)#int lo0

R2(config-if)#ip add 2.2.2.2 255.255.255.255

R2(config-if)#no sh

R2(config-if)#exit

R2(config)#int e0/0

R2(config-if)#ip add 10.0.0.2 255.255.255.252

R2(config-if)#no sh

R2(config-if)#exit

R2(config)#int e0/1

R2(config-if)#ip add 192.168.100.1 255.255.255.0

R2(config-if)#no sh

R2(config-if)#exit

OSPF协议

R2(config)#router ospf 1

R2(config-router)#router-id 2.2.2.2

R2(config-router)

  • 14
    点赞
  • 65
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值