路由重發布
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
!
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
路由重發布