For route redistribution, route maps are usually used to control the mutual route redistribution
between two routing domains.
One or more match or set commands can be executed to configure a route map. If the match
command is not used, all the routes will be matched. If the set command is not used, no operation will
be performed.
When configuring route maps, pay attention to the following when using the sequence number of a
route map:
When you create the first route map policy, if sequence-number is not specified, it is 10 by default;
If only one route map policy exists and sequence-number is not specified, no new route map policy
will be created, and the existing route map policy will be accessed for configuration;
If more than one route map policy is available, the sequence number of each policy shall be specified;
otherwise an error message will be displayed.
2. policy-based routing
Policy-based routing refers to a routing mechanism based on user defined policies. Compared with
traditional destination IP address-based routing, policy-based routing offers a flexibility for routing
based on source IP address, length and port of IP packets. Policy-based routing can apply to the IP
packets received on an interface or the IP packets sent from the local device.
Policy-based routing utilizes route map to define routing and forwarding policy. The match command
defines packet filtering rule and the set command defines the action for the packets matching the
filtering rules. The match command used includes match ip address and match length; the set
command includes set ip tos, set ip precedence, set ip dscp, set ip [default] nexthop, set ip next-hop
verify-availability, set [default] interface.
The following example enables the OSPF routing protocol to redistribute the RIP routes with the hop
count of 4. In the OSPF route domain, the route type is the external route type-1, the default metric is
40 and the tag is 40.
!
router ospf
redistribute rip subnets route-map redrip
network 192.168.12.0 0.0.0.255 area 0
!
!
route-map redrip permit 10
match metric 4
set metric 40
set metric-type type-1
set tag 40