Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Policy based routing and AS number


Can I match the policy based routing with the AS number ?

In my case it would be too difficult to route the traffic on a per IP address basis (matching the IP addresses) on the router2.

site 1--router1-router2--VLAN1---router3

site 1 advertises with BGP to router1, router2 and router3 its own networks.

Traffic from site 1 must be routed on the VLAN1 between router2 and router3...

Kind regards,

  • Other Network Infrastructure Subjects
New Member

Re: Policy based routing and AS number

You can do it.

create your AS-path filter-list

then use as-path filter list in the route-map for matching the criteria.

Set the required action

ex:To permit all traffic originated from AS-100

Outgoing interface on router 2 is vlan1, incoming interface vlan 1

ip as-path access-list 1 permit $100

route-map test

match as-path 1

set next-hop interface vlan1

interface vlan 1

ip policy route-map test


Re: Policy based routing and AS number

CEF doesn't have the AS Path, since the routing table doesn't have the AS Path--the as path filters in a route map are only designed for use with filtering BGP updates, not for use in policy based routing. Using PBR, the only things you can filter on are what you see when you do a show ip route, basically.

But, I'm curious why you don't just set the local preference on the routes learned across vlan1 so they are always preferred over the routes learned from other vlans? The only real reason to use policy based routing is if you can't route the traffic correctly using just the destination address. It sounds like you can do this routing with just the destination address?


New Member

Re: Policy based routing and AS number

I regret for the incorrect answer posted earlier.

As Ruwhite said, it is perfect that we can not use AS-Path for changing the outoing path for the ip datagrams.

Rather we can use in route-filters.

This widget could not be displayed.