0

I have Cisco router with 2 bgp's sessions from 2 isp's and want to separate my networks for example 80.80.80.0/24 to go trough first ISP and 90.90.90.0/24 to go trough the second ISP, but to have the option if one of them goes down the traffic to be rerouted.

Is there a way to do this.

Regards, Damjan

1 Answer 1

2

I assume from your question you only really want to control inbound traffic to your 2 networks from the ISPs.

You need to alter the routing decision for upstream networks, 2 ways you could do thist with 2 independent ISPs are:

  • increase the AS path when advertising the network to the provider you want to act as a backup (AS path prepending)
  • by advertising multiple routes that are more specific than the original aggregate routes (more specific routes)

With AS path prepending you literally insert your AS into the AS path multiple times to artificially increase the length. To preprend on a cisco use a route map such as below:

route-map PREPEND permit 10
   match ip address prefix-list PREPREND_ROUTES
   set as-path prepend 65001 65001 65001 65001

Using your example, you might prepend 80.80.80.0/24 when advertising to ISP2, and prepend 90.90.90.0/24 when advertising to ISP1. This would cause traffic for 90.90.90.0/24 to arrive via ISP2 in normal circumstances, with the reverse being true for 80.80.80.0/24.

To use more specific routes, you take for example a /23 route and advertise the 2 inner /24 routes instead, making these routes more specific and preferred over any larger (less specific) aggregate routes. Using your example networks:

ISP1 - advertise 80.80.80.80/24, 90.90.90.0/25, 90.90.90.128/25
ISP2 - advertise 80.80.80.0/25, 80.80.80.128/25 90.90.90.0/24

The above would cause traffic for 80.80.80.80/24 to come via ISP1 in normal circumstances, and 90.90.90.0/24 to come via ISP2.

The more-specific routes option is more reliable if you upstream providers will allow you to advertise with the more specific prefix length to them, some providers may block all routes with a prefix length longer than 24 for example. The reason it is more reliable is that it is possible that using AS path prepending that some networks will still have a shorter path via the prepended route due to a real shorter path of networks.

3
  • Thank you C3st7n for you answer I'm still struggling to make this work. Apr 27, 2017 at 8:48
  • So far I have the following configuration: ip prefix-list 90_out seq 10 permit 80.80.80.0/23 ip prefix-list 90_out seq 20 permit 90.90.90.0/24 ip prefix-list 90_out seq 30 deny 0.0.0.0/0 ! ip prefix-list 80_out seq 10 permit 80.80.80.0/23 ip prefix-list 80_out seq 20 permit 80.80.80.0/24 ip prefix-list 80_out seq 30 deny 0.0.0.0/0 route-map 90_out permit 10 match ip address prefix-list 90_out route-map 80_out permit 10 match ip address prefix-list 80_out Just note that 80.80.80.0 and 90.90.90.0 in the real scenario are in same /23 subnet. Apr 28, 2017 at 10:34
  • It's hard to parse out from the comment and the example addresses make this more confusing because they would not overlap in real life, but I think what you have is correct, but obviously the /23 and /24 routes need to exist in some way before they can match the prefix list. Can you give anymore information about what is or isn't happening?
    – c3st7n
    May 8, 2017 at 8:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .