cisco 4900 layer 3 routing priority

Posted on 2011-10-05
Last Modified: 2012-05-12
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?

Question by:pathix
    LVL 10

    Expert Comment

    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>


    Author Comment

    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?
    LVL 6

    Accepted Solution

    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 ?
    LVL 6

    Expert Comment

    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 ?

    Expert Comment

    I agree, the more specific route has the precedence, please post the sh ip route to solve the mystery

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Even if you have implemented a Mobile Device Management solution company wide, it is a good idea to make sure you are taking into account all of the major risks to your electronic protected health information (ePHI).
    I recently attended Cisco Live! in Las Vegas, a conference that boasted over 28,000 techies in attendance, and a week of hands-on learning hosted by a solid partner with which Concerto goes to market.  Every year, Cisco displays cutting-edge technol…
    Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now