8-2 Policy Routing

  • Routing is normally performed based on the packet destination and the lowest route metric.

  • Policy routing makes routing decisions based on the actions of a route map.

  • Policy routing is applied to an interface and processes inbound packets.

  • Packets can be tested for packet size or a matching condition from a standard or extended IP access list.

  • Packets can then be directed to a specific next -hop router or an outbound interface.

Configuration

  1. Define a route map to use for matching and directing packets:

     (global)  route map   map-tag  [  permit   deny  ] [  sequence-num  ] 

    The route map named map-tag either permits or denies a certain action. If more than one action is to be defined, the sequence number must be used. Route maps with the same name are processed in sequential order. For policy routing, a matching permit action routes according to the route map, and a matching deny action routes normally.

  2. (Optional) Define a matching condition for the route map. If no matching condition is defined, every packet is matched successfully.

    1. Match against the packet size:

       (route-map)  match length   min max  

      IP packets that are between min and max bytes in size are matched.

      -OR-

    2. Match against a standard or extended IP access list:

       (route-map)  match ip address  {  access-list-num   name  } [  access-list-num   name  ] 

      IP packets are tested against one or more numbered or named access lists. A successful match results if all specified access lists permit the packet.

  3. (Optional) Set the action(s) to be taken by policy routing.

    1. Set the IP precedence value in the packet header:

       (route-map)  set ip precedence   value  

      The IP precedence value can be set at the edge of the network, for further downstream Quality of Service processing. Valid values are a number or a name, as listed in Table 8-2.

      -OR-

    2. Specify the next-hop router where the packet will be forwarded:

       (route-map)  set ip next-hop   ip-address  [...  ip-address  ] 

      Matching packets are forwarded to the first available router in the list. The next-hop router must be an adjacent neighbor. If it isn't adjacent, or if the next-hop router is unreachable, the packet is routed normally instead.

      -OR-

    3. Specify the outbound router interface:

       (route-map)  set interface   type num  [...  type num  ] 

      Matching packets are forwarded out the first available interface in the list.

      -OR-

    4. Specify the default destination to be used for the packet if no specific route for that packet exists:

       (route-map)  set ip default next-hop   ip-address  [...  ip-address  ] (route-map)  set default interface   type num  [...  type num  ] 

      default next-hop is the IP address of the next neighboring router; default interface is the outbound interface from which a packet is forwarded.

Table 8-2. IP Precedence Values
Number Name
Routine
1 Priority
2 Immediate
3 Flash
4 Flash-override
5 Critical
6 Internet
7 Network
  1. (Optional) Define more route maps using the same name, with greater sequence numbers .

  2. Apply the route map to an inbound interface for policy routing:

     (interface)  ip policy route-map   map-tag  

    Incoming packets on the interface are processed according to the route map named map-tag.

Example

For packets entering interface serial 0, route all POP3 and SMTP traffic out interface serial 3:

  route-map mailtraffic permit 10   match ip address 101   set interface serial 3   interface serial 0   ip policy route-map mailtraffic   access-list 101 permit tcp any any eq pop3   access-list 101 permit tcp any any eq smtp  


Cisco Field Manual[c] Router Configuration
Cisco Field Manual[c] Router Configuration
ISBN: 1587050242
EAN: N/A
Year: 2005
Pages: 185

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net