1、 配置地址 2、 配置ospf路由 3、 配置RIP 4、 R3上配置静态路由目标网络192.168.6.0 下一跳192.168.4.2 5、 配置OSPF重发布到RIP 中 6、 配置RIP重分布到OSPF中 7、 重发布直连路由到RIP 和ospf 中去 8、 重发布静态路由到RIP和OSPF中去 9、 重发布默认路由到RIP 和OSPF中去

基本配置 R1 interface FastEthernet0/0 ip address 192.168.1.1 255.255.255.0 no shutdown !
router ospf 1 network 192.168.1.0 0.0.0.255 area 0 !
R2 interface FastEthernet0/0 ip address 192.168.1.2 255.255.255.0 no shutdown !
interface FastEthernet1/0 ip address 192.168.2.1 255.255.255.0 no shutdown !
router ospf 1 network 192.168.1.0 0.0.0.255 area 0 network 192.168.2.0 0.0.0.255 area 0

R3

interface Loopback0 ip address 192.168.5.1 255.255.255.0 !
interface FastEthernet0/0 ip address 192.168.2.2 255.255.255.0 no shutdown

!
interface FastEthernet1/0 ip address 192.168.3.1 255.255.255.0 no shutdown !
interface FastEthernet2/0 ip address 192.168.4.1 255.255.255.0 no shutdown

router ospf 1 network 192.168.2.0 0.0.0.255 area 0

router rip version 2 network 192.168.3.0

ip route 192.168.6.0 255.255.255.0 192.168.4.2

R4 interface FastEthernet0/0 ip address 192.168.3.2 255.255.255.0 no shutdown !
router rip version 2 network 192.168.3.0 no auto-summary

R5 interface Loopback0 ip address 192.168.6.1 255.255.255.0 !
interface FastEthernet0/0 ip address 192.168.4.2 255.255.255.0 no shutdown


在路由重发布之前要查看各路由器的路由条目

R2上的路由信息 C 192.168.1.0/24 is directly connected, FastEthernet0/0 C 192.168.2.0/24 is directly connected, FastEthernet1/0 R2#

R4上的路由信息 R4#show ip route C 192.168.3.0/24 is directly connected, FastEthernet0/0

在R3上进行路由重发布 R3(config)#router rip R3(config-router)#redistribute ospf 1 metric 2 发布OSPF到RIP R3(config-router)#redistribute connected 发布直连路由 R3(config-router)#redistribute static metric 5 发布静态路由 R3(config-router)#default-information originate 发布默认路由 R3(config-router)#exit R3(config)# R3(config)#router ospf 1 R3(config-router)#redistribute rip subnets 发布RIP到OSPF R3(config-router)#redistribute connected subnets发布直连路由 R3(config-router)#redistribute static subnets发布静态路由 R3(config-router)#default-information originate always发布默认路由

R4#show ip route

R 192.168.4.0/24 [120/1] via 192.168.3.1, 00:00:02, FastEthernet0/0 R 192.168.5.0/24 [120/1] via 192.168.3.1, 00:00:02, FastEthernet0/0 R 192.168.6.0/24 [120/5] via 192.168.3.1, 00:00:02, FastEthernet0/0 R 192.168.1.0/24 [120/2] via 192.168.3.1, 00:00:02, FastEthernet0/0 R 192.168.2.0/24 [120/1] via 192.168.3.1, 00:00:02, FastEthernet0/0 C 192.168.3.0/24 is directly connected, FastEthernet0/0 R* 0.0.0.0/0 [120/1] via 192.168.3.1, 00:00:02, FastEthernet0/0 R4#

R2#show ip route O E2 192.168.4.0/24 [110/20] via 192.168.2.2, 00:08:45, FastEthernet1/0 O E2 192.168.5.0/24 [110/20] via 192.168.2.2, 00:08:45, FastEthernet1/0 O E2 192.168.6.0/24 [110/20] via 192.168.2.2, 00:08:35, FastEthernet1/0 C 192.168.1.0/24 is directly connected, FastEthernet0/0 C 192.168.2.0/24 is directly connected, FastEthernet1/0 O E2 192.168.3.0/24 [110/20] via 192.168.2.2, 00:08:51, FastEthernet1/0 O*E2 0.0.0.0/0 [110/1] via 192.168.2.2, 00:08:28, FastEthernet1/0