中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

6.1.3 Policy Routing

In certain special situations it may be legitimate to base routing decisions not only on the destination IP address but also on other fields in the IP or TCP/UDP header, for instance source IP address or destination port. Such an approach is known as policy routing. Typical applications of policy routing are load balancing (distributing traffic among several connections), QoS provisioning or, indeed, imposing some kind of policy (e.g., to satisfy acceptable use conditions of certain networks).

Modern router architectures usually implement policy routing as part of the facilities for packet filtering (access lists). Incoming packets are processed using a sequence of rules. Each rule consists of match conditions and an action that is applied if the incoming packet matches the conditions. Simple actions can for example just select an explicit next hop or output interface. Some modern router systems offer sophisticated policy routing frameworks where multiple routing tables can be defined and selected by the actions.

Example 6.4. Cisco IOS

In Cisco IOS, routing policies are specified using route maps. Say we want to take all IPv6 datagrams received on the interface GigabitEthernet0/1 whose source address falls under the prefix 2001:798::/40 and send them to a special next hop. We can accomplish this using the following configuration commands:

1. This access list defines the prefix for which the special next hop is to be applied.
2. This route map has a single rule: If the IPv6 datagram matches the access-list 6net-src, then the next hop is set to the given address.
3. This command attaches the route map to the desired interface.