新浪博客

OSPF默认路由重分布 配置案例

2012-09-13 22:41阅读:

OSPF默认路由重分布 配置案例

1 案例配置拓扑

图片

2 IP地址规划


Fastethernet0/0
Fastethernet1/0
SPAN>
Loopback0
R1
12.12.12.1/24
N/A
1.1.1.1/24
R2
12.12.12.2/24
23.23.23.2/24
2.2.2.2/24
R3
23.23.23.3/24
N/A
3.3.3.3/24

3 案例配置需求

R1R2设备运行OSPF协议,进程号为1
R2OSPF进程下做默认路由重分布,让R1学习到R3环回口地址。
R3上配置去往R1的默认路由条目。
实现R1R3的环回口地址相互通信。

4 案例配置思路

1) 配置R1R2运行OSPF协议,进程为1
router ospf x
router-id x.x.x.x //手动指定router-id//
network x.x.x.x x.x.x.x area x //宣告接口网段,areax//

2) 配置R2上做默认路由重分布,实现R1去往R3的路由条目:
ip route 0.0.0.0 0.0.0.0 x.x.x.x //配置去往目的端默认路由//
router ospf x
default-information original //默认路由重分布//

3)配置R3去往R1的默认路由条目:
ip route 0.0.0.0 0.0.0.0 x.x.x.x //默认路由配置//

5 案例检验结果

1)查看R1是否有学习到重分布默认路由条目:

图片

上图O E2表明学习到默认路由,作为去往R3的环回接口网段的路由条目.

2)查看R2上的默认路由条目:

图片

上图表明有去往R3的默认路由条目。

3)R3通往R1的路由条目:

图片

上图表明R3有去往R1的路由条目

4)测试R1能否pingR3的环回接口:

图片

R1R3的环回接口能相互通信。

6 配置案例

R1:
Building configuration...
Current configuration : 738 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 12.12.12.1 255.255.255.0
duplex auto
speed auto
!
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.0 0.0.0.255 area 0
network 12.12.12.0 0.0.0.255 area 0
!
no ip http server
no ip http secure-server
!
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
R2:
Building configuration...
Current configuration : 919 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface FastEthernet0/0
ip address 12.12.12.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 23.23.23.2 255.255.255.0
duplex auto
speed auto
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.0 0.0.0.255 area 0
network 12.12.12.0 0.0.0.255 area 0
default-information originate
!
no ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 23.23.23.3
!
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end

R3:
Building configuration...
Current configuration : 645 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
ip address 23.23.23.3 255.255.255.0
duplex auto
speed auto
!
no ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 23.23.23.2
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end

7 案例总结及其他
1) 默认路由重分布方式:
先配置默认路由条目,再去OSPF进程下输入default-information original
2) 将环回接口地址网段要下发给邻居路由时,可以通过默认路由重分布来实现。





Email:zhoujj@spoto.net
新浪微博:http://weibo.com/zhoujj0130
网 站: http://www.SPOTO.net
雏鹰部落:http://bbs.SPOTO.net

我的更多文章

下载客户端阅读体验更佳

APP专享