R2(config)#access-list 1 permit 10.1.0.0 0.0.255.255
R2(config)#access-list 2 permit 10.2.0.0 0.0.255.255
R2(config)#access-list 3 permit 10.3.0.0 0.0.255.255
R2(config)#access-list 5 permit 10.5.0.0 0.0.255.255
定义rout-map
R2(config)#route-map biaodu permit 10 定义一个route-map 名字为biaodu和序列号
#match ip address 1 2 定义match的条件(满足控制列表1 2 的)
#set metric 12 基于条件给出set一个动作:metric值为12
#set metric-type type-1 定义为5类lsA 类型1
R2(config)#route-map biaodu permit 20
#match ip address 3
#set metric 1000
#set metric-type type-2
R2(config)#route-map biaodu deny 30 拒绝满足控制列表5的IP的路由
match ip address 5
R2(config)#route-map biaodu permit 50 允许剩下的所有路由
R2(config)#router ospf 1
#redistribute rip subnets route-map biaodu 调用出控制列表biaodu
R2(config)#router rip
#redistribute ospf 1 metric 5
R3#sh ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
C 10.0.0.8/30 is directly connected, Ethernet0/0
O E1 10.2.0.0/16 [110/22] via 10.0.0.9, 01:10:14, Ethernet0/0
O E2 10.3.0.0/16 [110/1000] via 10.0.0.9, 01:10:14, Ethernet0/0
O E2 10.0.0.0/30 [110/20] via 10.0.0.9, 01:10:14, Ethernet0/0
O E1 10.1.0.0/16 [110/22] via 10.0.0.9, 01:10:14, Ethernet0/0
O E2 10.4.0.0/16 [110/20] via 10.0.0.9, 01:10:14, Ethernet0/0
原文地址:http://mokaka.blog.51cto.com/10063775/1634894