Asa Route Map

In this example I used a route-map and applied it on a BGP peer 2.2.2.2 (on the incoming routes), the first rule applies tag '10' to any route matched in ACL 100 and tag '20' to any other ( notice that if no match statement is configured the route-map will match everything). View all Alaska Airlines flights and routes here.

I’m a big fan of the Cisco Anyconnect VPN client due to its easy configuration, and the relative ease of deployment to end users. When you deploy an Anyconnect VPN on your ASA, one of the important tasks is to decide how to advertise the VPN assigned addresses into the rest of your network. Fortunately, this is easy to accomplish using route redistribution.

Basic Setup

In this example, my VPN pool will be assigned from the 192.168.254.128/25 range, and I will redistribute these routes into OSPF. Notice that the ASA automatically creates a static host route for a connected client:

Asa Route Map

So we have the building blocks for what we need, now let’s look at the configuration.

There are several different ways to accomplish this task, but I’ll demonstrate what I typically use.

Redistributing into OSPF

First, we’ll create a prefix list to match the address pool for our Anyconnect clients:

This prefix list entry matches the 192.168.254.128/25 subnet, as well as any routes with a mask less-than or equal to 32 bits. This works great, because our routes will all be /32.

Next we’ll create a route-map that we can reference inside OSPF:

And finally, we’ll add enable redistribution in OSPF:

If we look the routing table on another router in our network, we should see the route:

Advertising the subnet instead of individual host routes

If you like to keep your routing tables uncluttered, you might be inclined to only redistribute the entire VPN prefix, instead of the /32 routes. The important thing to remember here is that OSPF will not redistribute a route that is not already in the routing table.

We’ll simply add a static route for the VPN prefix:

Without any other modifications, we will now see routes like this in our network:

But we want to get rid of the /32 routes. So we have two options now:

Cisco Asa Route Map Example

  1. Modify the prefix-list to match only the /25 route
  2. Modify the OSPF redistribution command to ignore subnets.

Asa Route Map Finder

Option 1: Modify the prefix-list

We’ll change the prefix list so we don’t even consider subnets with different masks:

Our redistribution command still has the subnets keyword, but since the prefix list won’t even allow smaller prefix lengths, we end up with just the one route.

Option 2: Modify the OSPF redistribution command

You can also remove the subnets keyword from the redistribution command:

This way it doesn’t matter if the prefix-list matches longer routes, OSPF just won’t redistribute them.

Final Configuration

In the end we have a configuration that looks something like this:

The ASA will still show all of the /32 routes, plus the /25 route:

But routers inside the network will only see the /25 route:

Asa Route MapAsa

I didn’t talk about modifying any of the OSPF metrics as the routes are being injected, but that would be something to consider if you do this in your environment.

Comments are closed.