Cisco BGP routing. Is it possible to force traffic out an interface depending on source address?

Posted on 2009-12-18
Last Modified: 2012-05-08
Hi Experts,

We have a Cisco Internet BGP router which peers with two different ISP's. Under normal operation we are load balancing traffic between the two carriers using route maps and odd/even AS paths. Everything works well.. However, We now need to route a particular local network out of a particular carrier interface.

BGP Router interfaces FYI-
GIG1/0 - Various Public networks (This is our inside int connected to L3 switches)
Fastethernet 2/0 - 40Mbps BT Peering
Fastethernet 2/1 - 100Mbps Telewest Peering

For example, We need network A.B.C.D/24 to route via Telewest at all times (Fa2/1) unless there is a failure. But all other networks should loadshare as normal... I thought of maybe using PBR but I think we'll lose the failover to BT if we have a problem?. Incoming traffic is ok as I am using AS Pre-Pending for the A.B.C.D/24 network via Fa2/0. So Fa2/1 naturally becomes the best route for incoming traffic..

It's how to achieve the outgoing traffic which is stumping me?.. I know I can use local-preference/MED but that will apply to all traffic not just the traffic originating from the A.B.C.D/24 network..

Any ideas guys?

Thanks in advance for your help.

Question by:needsy
    LVL 3

    Expert Comment

    route-map special permit 10
     match ip address 102
     set ip next-hop <fa2/0's gw>

    access-list 102 permit ip a.b.c.d any

    int g1/0
    LVL 3

    Expert Comment

    sorry, needs more

    int g1/0
      ip policy route-map special

    something like this should be able to be adapted to work.
    LVL 22

    Accepted Solution

    You can use policy based routing with a tracking option based on the presence or metric of other routes or on interface status.

    track 10 ip route metric threshold
     threshold up 100
    ip access-list extended PolicyOut
     permit ip A.B.C.D any
    route-map PolicyOut permit 10
     match ip address PolicyOut
     set ip next-hop verify-availability 10 track 10

    The above example makes your policy routing conditional based on the metric of a tracked route.  Set the "threshold up" metric to the expected metric of a tracked route that you expect to receive from your Telewest BGP peer and the "threshold down" metric to anything lower than this.  When the route is present in the routing table with the specified metric or better, the track is up and policy routing occurs.  When the metric drops below the "threshold up" metric, the track is down and normal routing occurs on the remaining path.  Replace with the route you want to track and with the Telewest next hop.

    If you're not importing routes from the BGP peer, the tracking can be adjusted to watch the interface status itself or icmp-echo replies from your Telewest next hop or BGP peer.
    LVL 1

    Author Closing Comment

    This worked with a little tweeking for our requirements.. Finally had time to test over Christmas. Many Thanks & Happy New Year

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    In this tutorial I will show you with short command examples how to obtain a packet footprint of all traffic flowing thru your Juniper device running ScreenOS. I do not know the exact firmware requirement, but I think the fprofile command is availab…
    Creating an OSPF network that automatically (dynamically) reroutes network traffic over other connections to prevent network downtime.
    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…
    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…

    760 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

    14 Experts available now in Live!

    Get 1:1 Help Now