cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5325
Views
10
Helpful
20
Replies

BGP and as-path prepend to influence inbound traffic

gasparmenendez
Level 3
Level 3

Hi folks,

I ruuning Multihoming BGP with 2 ISPs since a while ago, a very simple configuration. Here are the relevant parts:

 

interface TenGigabitEthernet0/0/0
 description *** ISP Level3 ***
 ip address 208.X.X.182 255.255.255.252
!
interface TenGigabitEthernet0/0/1
 description *** ISP Metrocarrier ***
 ip address 187.Y.Y.113 255.255.255.254
 shutdown
!
router bgp 2???25
 bgp log-neighbor-changes
 network Z.Z.240.0 mask 255.255.252.0
 network Z.Z.240.0 mask 255.255.254.0
 network Z.Z.242.0 mask 255.255.254.0
 neighbor 187.Y.Y.112 remote-as 13999
 neighbor 187.Y.Y.112 password 7 ********************
 neighbor 187.Y.Y.112 route-map MC out
 neighbor 208.X.X.181 remote-as 3549
 neighbor 208.X.X.181 password 7 ********************
 neighbor 208.X.X.181 route-map L3 out
!

ip route Z.Z.240.0 255.255.252.0 Null0
ip route Z.Z.240.0 255.255.254.0 Null0
!
ip prefix-list L3 seq 10 permit Z.Z.240.0/22
ip prefix-list L3 seq 15 deny 0.0.0.0/0
!
ip prefix-list MC seq 10 permit Z.Z.240.0/23 le 27
ip prefix-list MC seq 20 permit Z.Z.242.0/23 le 27
ip prefix-list MC seq 30 deny 0.0.0.0/0
!
route-map MC permit 10
 match ip address prefix-list MC
!
route-map L3 permit 10
 match ip address prefix-list L3
!

so far so good. As you can see I have interface TenGigabitEthernet0/0/1 shut down in order to force inbound traffic to come through ISP connected to interface TenGigabitEthernet0/0/0. Obviously automatic failover is not working. When ISP Level3 goes down I need to manually turn interface TenGigabitEthernet0/0/1 up. In order to solve this I've been reading the BGP Documentation and I think I can use the as-path prepend command to influence the inbound traffic but I understand that I can not use two route-map on the same neighbor, is that correct?? how can I achieve my gold, can anybody help me please ?? or the best way is to ask to my ISP to AS prepend my block to the other ISPs ???

Thanks. BR.

20 Replies 20

Yes. That should be the case if you advertise the more specific routes.

thanks @chrihussey, I finally did the two /23 thing. Now is working as I need.

 

Thanks you all for your help!

That's great. Thank you for the update and votes.

Regards

Yes, it would be recommended to do this in a maintenance window. This way you could also test out failing over from one ISP to the other.

ok @chrihussey, I'll schedule a maintenance window ASAP and try what you suggest. I'll keep you posted.

Thanks.

mhrznamn
Level 1
Level 1

Hello,

 

You can call prefix-list simply in neighbor rather than in route-map. And you can create two route-maps with difference sequence number for ISP MC one for AS-path prepend   Z.Z.240.0/22 network and default for rest of the network leave route-map blank

 

router bgp 2???25
 bgp log-neighbor-changes
 network Z.Z.240.0 mask 255.255.252.0

 network Z.Z.240.0 mask 255.255.254.0
 network Z.Z.242.0 mask 255.255.254.0
 neighbor 187.Y.Y.112 remote-as 13999
 neighbor 187.Y.Y.112 password 7 ********************

 neighbor 187.Y.Y.112 prefix-list MC out
 neighbor 187.Y.Y.112 route-map MC out
 neighbor 208.X.X.181 remote-as 3549
 neighbor 208.X.X.181 password 7 ********************

 neighbor  208.X.X.181 prefix-list  L3 out

!

ip prefix-list L3 seq 10 permit Z.Z.240.0/22
ip prefix-list L3 seq 15 deny 0.0.0.0/0
!
ip prefix-list MC seq 10 permit Z.Z.240.0/23 le 27
ip prefix-list MC seq 20 permit Z.Z.242.0/23 le 27
ip prefix-list MC seq 30 deny 0.0.0.0/0


route-map MC permit 10

match ip address prefix-list L3
 set as-path prepend 2???25 2???25 2???25

!

route-map MC permit 20

 

Review Cisco Networking products for a $25 gift card