Examining Policy-Based Routing

Problem

You want to see information about how policy-based routing has been applied on a router.

Solution

The show ip policy command shows what routing policies have been applied on a router. Here is the output for a router that has all three of the policies from Recipe 5.7:

Router>show ip policy
Interface      Route map
local          dlswtraffic
Ethernet0      Websurfers
Serial0        High-priority

You can see more detail on what each of these policies do by looking at the route maps:

Router>show route-map
route-map High-priority, permit, sequence 10
  Match clauses:
    ip address (access-lists): 101
  Set clauses:
    ip next-hop 10.15.27.1
  Policy routing matches: 0 packets, 0 bytes
route-map Websurfers, permit, sequence 10
  Match clauses:
    ip address (access-lists): 102
  Set clauses:
    ip next-hop 10.15.27.1
  Policy routing matches: 0 packets, 0 bytes
route-map Websurfers, permit, sequence 20
  Match clauses:
  Set clauses:
    ip default next-hop 10.15.26.1
  Policy routing matches: 4 packets, 531 bytes
route-map dlswtraffic, permit, sequence 10
  Match clauses:
    ip address (access-lists): 103
  Set clauses:
    ip next-hop 10.15.27.3
  Policy routing matches: 5 packets, 500 bytes

Discussion

The first command, show ip policy, tells you about all of the routing policies that have been applied on the router. The second command, show route-map, shows all of the route maps. It is important to note that the first command only shows the routing policies that have actually been applied on the router, whether for local traffic ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.