The Basic Uses of TCP/IP Route Maps
This chapter covers the following subjects:
- Basic Uses of Route Maps
- Configuring Route Maps
路线图是相似的访问列表;他们都have criteria for matching the details of certain packets and an action of permitting or denying those packets. Unlike access lists, though, route maps can add to each "match" criterion a "set" criterion that actually changes the packet in a specified manner, or changes route information in a specified manner. Route maps also allow you more options for matching a given packet. Altogether, route maps are a powerful tool for creating customized routing policies in your network.
Basic Uses of Route Maps
Route maps can be used for both redistribution and for policy routing. Although redistribution has been covered extensively in previous chapters, this chapter introduces the topic of policy routing. And most commonly, they are an essential tool in large-scale Border Gateway Protocol (BGP) implementations. The use of route maps to implement BGP routing policies is outside the scope of this volume, and is covered in "Routing TCP/IP," Volume II (CCIE Professional Development) (1-57870-089-2).
Policy routesare nothing more than sophisticated static routes. Whereas static routes forward a packet to a specified next hop based on the destination address of the packet, policy routes can forward a packet to a specified next hop based on the source of the packet or other fields in the packet header. Policy routes can also be linked to extended IP access lists so that routing might be based on such things as protocol types and port numbers. Like a static route, a policy route influences the routing only of the router on which it is configured.
Figure 14-1shows an example of a typical policy routing application. AbnerNet is connected to two Internet service providers via router Dogpatch. AbnerNet's corporate policy dictates that some users' Internet traffic should be sent via ISP 1 and other users' Internet traffic should be sent via ISP 2. If either ISP should become unavailable, the traffic normally using that provider would be sent to the other provider. A policy route at Dogpatch can distribute Internet traffic in accordance with local policy. The distribution of traffic might be based on subnet, specific user, or even user applications.
Figure 14-1Policy routing allows traffic from AbnerNet to be routed to one of its two Internet service providers based on parameters such as source address, source/destination address combinations, packet size, or application-level ports.
Figure 14-2shows another use for policy routing. One of the systems on the right watches for invasion forces from the planet Mongo, while the other stores back copies ofDilbertcomic strips. Policy routes can be configured to route the critical traffic from the Mongo System to Flash_G over the FDDI (Fiber Distributed Data Interface) link and to route the lower-priority Dilbert traffic over the 56K links—or vice versa.
Figure 14-2Policy routing allows high-priority traffic from the Mongo System to be routed over the FDDI link while low-priority traffic from the Dilbert System is routed over the 56K links.
Tables 14-1 and 14-2 show thematchandsetcommands that can be used with redistribution, and Tables 14-3 and 14-4 show thematchandsetcommands that can be used with policy routing.
Table 14-1.matchcommands that can be used with redistribution.
Command |
Description |
match interfacetype number[...type number] |
Matches routes that have their next hop out one of the interfaces specified |
match ip address{access-list-number|name} [...access-list-number|name] |
Matches routes that have a destination address specified by one of the access lists |
match ip next-hop{access-list-number|name} [...access-list-number|name] |
比赛路线跳路由器的地址specified by one of the access lists |
match ip route-source{access-list-number|name} [...access-list-number|name] |
Matches routes that have been advertised by routers at the addresses specified in the access lists |
match metricmetric-value |
Matches routes with the specified metric |
match route-type{internal|external[type-1|type-2] |第1层|2级} |
Matches OSPF, EIGRP, or IS-IS routes of the specified type |
match tagtag-value[...tag-value] |
Matches routes with the specified tags |
Table 14-2.setcommands that can be used with redistribution.
Command |
Description |
set level{第1层|2级|第1层-2|stub-area|backbone} |
Sets the IS-IS level or the OSPF area into which a matched route is to be redistributed |
set metric{metric-value|bandwidth delay reliability loading mtu} |
Sets the metric value for a matched route |
set metric-type{internal|external|type-1|type-2} |
Sets the metric type for a matched route being redistributed into IS-IS or OSPF |
set next-hopnext-hop |
Sets the next-hop router address for a matched route |
set tagtag-value |
Sets a tag value for a matched route |
Table 14-3.matchcommands that can be used with policy routing.
Command |
Description |
match ip address{access-list-number|name} [...access-list-number|name] |
Matches a packet with the characteristics specified in the standard or extended access lists |
match lengthmin max |
Matches the Layer 3 length of a packet |
Table 14-4.setcommands that can be used with policy routing.
Command |
Description |
set default interfacetype number[...type number] |
Sets the outgoing interface for matched packets when there is no explicit route to the destination |
set interfacetype number[...type number] |
Sets the outgoing interface for matched packets when there is an explicit route to the destination |
set ip default next-hopip-address[...ip-address] |
Sets the next-hop router address for matched packets when there is no explicit route to the destination |
set ip next-hopip-address[...ip-address] |
Sets the next-hop router address for matched packets when there is an explicit route to the destination |
set ip precedenceprecedence |
Sets the precedence bits in the Type of Service field of matched IP packets |
set ip tostype-of-service |
Sets the TOS bits in the Type of Service field of matched packets |