在这里,先配置
1
和
3[1.
在
R1
配置重发布直连路由,标记
10
并且路数为
10; 3.
在
R3
配置重发布直连路由,跳数设置为
4;]
,以供后面好测试:
配置参数:
R1:
router ospf 1
redistribute connected metric 10 subnets tag 10
network 192.168.12.0 0.0.0.255 area 0
network 192.168.100.0 0.0.0.255 area 0
R3
:
router rip
version 2
redistribute connected metric 4
network 192.168.200.0
network 200.168.23.0
no auto-summary
查看配置效果:
R2:
r2#SH IP ROU
C 192.168.12.0/24 is directly connected, Ethernet0/0
C 200.168.23.0/24 is directly connected, Ethernet0/1
O E2 192.168.110.0/24 [110/10] via 192.168.12.1, 00:12:30, Ethernet0/0
R 192.168.200.0/24 [120/1] via 200.168.23.2, 00:00:01, Ethernet0/1
10.0.0.0/24 is subnetted, 1 subnets
R 10.1.1.0 [120/4] via 200.168.23.2, 00:00:01, Ethernet0/1
192.168.100.0/32 is subnetted, 1 subnets
O 192.168.100.1 [110/11] via 192.168.12.1, 00:12:30, Ethernet0/0
r2#
可以看出
R2
学习到
R1
重发布的直连路由
192.168.110.0/24
的跳数为
10
;学习到
R3
重发布的直连路由
10.1.1.0/24
的跳数为
4.
接下来配置2[2.RIP路由协议重发布OSPF路由,要求只重分标记为10的OSPF路由,初始量度值为10;]:
配置参数:
R1:
route-map ospf permit 10
match tag 10
set metric 10
router rip
version 2
redistribute ospf 1 route-map ospf
network 200.168.23.0
no auto-summary
查看配置效果:
R3
:
r3#sh ip rou
C 200.168.23.0/24 is directly connected, Ethernet0/1
R 192.168.110.0/24 [120/10] via 200.168.23.1, 00:00:15, Ethernet0/1
C 192.168.200.0/24 is directly connected, Loopback1
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Loopback2
r3#
可以看到
R3
学习到了
OSPF
网络中标记为
10
的路由
192.168.110.0/24
,
R2
将它重发布到
RIP
跳数为
10.
接下来配置4[4.OSPF路由协议重发布RIP路由,要求只重分布路数为4的路由并且路由网络地址在10.0.0.0/8范围内的RIP路由,在OSPF路由域中,设该路由类型为外部路由type-1,初始量度值为40,路由标记值为40.]
配置参数:
R2:
access-list 10 permit 10.0.0.0 0.255.255.255
route-map rip permit 10
match ip address 10
match metric 4
set metric 40
set metric-type type-1
set tag 40
router ospf 1
redistribute rip subnets route-map rip
network 192.168.12.0 0.0.0.255 area 0
查看配置:
R1
:
C 192.168.12.0/24 is directly connected, Ethernet0/0
C 192.168.110.0/24 is directly connected, Loopback2
10.0.0.0/24 is subnetted, 1 subnets
O E1 10.1.1.0 [110/50] via 192.168.12.2, 00:01:45, Ethernet0/0
C 192.168.100.0/24 is directly connected, Loopback1
r1#
可以看到R1学习到了R3重发布的标记为4的10.1.1.0/24的路由,是R2将它重发布进OSPF,配置为type-1类型,度量值为40,标记为40的路由!!!
配置成功!!!