Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 659
  • Last Modified:

cisco 4900 layer 3 routing priority

I have a peculiar secnario with a set of routes on a cisco 4948 layer 3 switch (core switch(

examples are:

172.16.x.x is my main network

I have a static route:

ip route to an upstream route
Iip route to another router

the problem is that traffic is constantly routing to the router due to it matching the first ip route, however i want specific traffic for to route to another route, I cannot remove or change the existing /17 route, is there any way to set route priority so that traffic will first hit the route instead of the first route or am I stuck?

1 Solution
You need to set up route-maps for your scenario:

1. create access-list to match the traffic you want to set the route for

2. create route maps and apply that access-list:

route-map <NAME> permit
match ip <access-list name>
set ip next-hop <gateway>

pathixAuthor Commented:
SO would route maps take precedence over the routing table itself? would i create a route map for just,

or create a route map with the entire routing table in it and remove all static routes? how does this affect directly connected routes?
I am quite sure there is something wrong ...
u r static routes are perfect ..

p route to an upstream route
Iip route to another router

Ideally when a packet from comes it should always go to as in route selection
process longest match of subnet mask wins.

please paste  sh ip route ..
 r u running HSRP ?
I agree with @sanjeevloke in that when a route for a destination IP is determined from the routing table the longest prefix length matching subnet will be used.  So any traffic with a destintation of 172.16.2.x should always use as the next hop.  Are you using any routing protocols and is the default AD of 1 assigned to these static routes ?
I agree, the more specific route has the precedence, please post the sh ip route to solve the mystery

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now