Source Based Routing with Cisco

When you are transitioning from one carrier to another using provider allocated IP space there is a neat little trick you can use to route outbound traffic through the correct carrier.  While there are some carrier’s that do not filter their ingress traffic, there are many others who do.

In this example we will assume the following

  1. Carrier A has assigned to the wan point-to-point link and has allocated for your internal use
  2. Carrier B has assigned to the wan point-to-point link and has allocated for your internal use
  3. Both carriers are preforming ingress traffic filtering and would block outbound packets not belonging to their ip space
  4. While you can use DHCP to reassign internal users to the new carrier B space there are some statically configured nodes that will need to be able to re-ip when they are ready
  5. You need to migrate without a systems outage caused by moving from one ip to the other
  6. Router Gig0/1 is connected to your internal lan
  7. Router Gig0/2 is connected to carrier A
  8. Router Gig0/3 is connected to carrier B
  9. Your current default route point to the carrier A wan

First you need to create two access lists for each set of internal ip addresses.

ip access-list extended carrier-a
 permit ip any
ip access-list extended carrier-b
 permit ip any

Next you will need to create a two stanza route map which first does not change the new space, then secondarily forces the old traffic out carrier A

route-map backbones deny 20
 match ip address carrier-b
route-map backbones permit 30
 match ip address carrier-a
 set ip next-hop

After that you will need to assign the new Policy based routing rule to the Gig0/2 Interface

interface GigabitEthernet0/1
 description Internal Lan
 ip address secondary
 ip address
 ip policy route-map backbones

Last you will need to change the default route from Provider A to Provider B so that traffic normally routes out the new provider.

 ip route
 no ip route

In my next post I will extend this example to apply to migrating from dual carriers with provider space to a RIR allocate with dual routers.

Leave a Reply

Your email address will not be published.