cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1496
Views
0
Helpful
8
Replies

how to pad the as path in the bgp table?

klogan
Level 1
Level 1

I have DistributedDirectors that use the AS hop count as a metric for deciding which ip address to give out for a dns query. I have entered the following commands in an attempt to pad the AS entries for a particular AS, but it appears to be ignored. Is there a way to pad the AS entries in the bgp table?

router bgp 22745

neighbor 216.140.243.231 route-map set-inbound-as-path in

ip as-path access-list 20 permit ^3147$

ip as-path access-list 21 permit .*

route-map set-inbound-as-path permit 10

match as-path 20

set as-path prepend 6395 6395

!

route-map set-inbound-as-path permit 20

match as-path 21

IOS (tm) 3600 Software (C3660-I-M), Version 12.3(1a), RELEASE SOFTWARE (fc1)

Thanks.

3 Accepted Solutions

Accepted Solutions

Harold Ritter
Spotlight
Spotlight

When prepending inbound, you should only prepend the neighbor's ASN. Is 6395 the ASN for peer 216.140.243.231? Also the Match in this case will only allow prefixes that have only 3147 in the ASPATH.Is that waht you want?

Hope this helps,

View solution in original post

The ACL you have will only match it if the entire AS path is "3147", nothing else. If you want to prepend only when the destination is 3147, I believe it would be

ip as-path access-list 20 permit _3147$

If you want to prepend when it transits 3147, it would be

ip as-path access-list 20 permit _3147_

Putting it on as if it originated in 3147 (ie: ^3147) doesn't make sense when 6395 is the neighbor. If you want to do it when its one hop out from 6395, it would be:

ip as-path access-list 20 permit ^6395_3147_

There is a good article here:

http://www.cisco.com/en/US/customer/tech/tk365/tk80/technologies_tech_note09186a0080094a92.shtml

View solution in original post

You can match on their address space using a prefix-list instead of matching on the AS_PATH as follow:

!

ip prefix-list CustPrefix permit x.y.z.0/24

!

route-map set-inbound-as-path permit 10

match ip address prefix-list CustPrefix

set as-path prepend 6395 6395

!

route-map set-inbound-as-path permit 20

Hope this helps,

View solution in original post

8 Replies 8

Harold Ritter
Spotlight
Spotlight

When prepending inbound, you should only prepend the neighbor's ASN. Is 6395 the ASN for peer 216.140.243.231? Also the Match in this case will only allow prefixes that have only 3147 in the ASPATH.Is that waht you want?

Hope this helps,

Yes, the AS 6395 is the neighbor AS and I am trying to match only AS 3147 to do a pad.

The ACL you have will only match it if the entire AS path is "3147", nothing else. If you want to prepend only when the destination is 3147, I believe it would be

ip as-path access-list 20 permit _3147$

If you want to prepend when it transits 3147, it would be

ip as-path access-list 20 permit _3147_

Putting it on as if it originated in 3147 (ie: ^3147) doesn't make sense when 6395 is the neighbor. If you want to do it when its one hop out from 6395, it would be:

ip as-path access-list 20 permit ^6395_3147_

There is a good article here:

http://www.cisco.com/en/US/customer/tech/tk365/tk80/technologies_tech_note09186a0080094a92.shtml

Thanks for the info Craig. I will try that. I was not aware of the use of the _ in the ACL.

If the peer AS is 6395, updates received from that neighbor will not match ^3147$ since 6395 will also be part of the AS_PATH. If you want to match on any AS_PATH containing 3147 then you need to do the following ip as-patch access-list 20 permit _3147_.

Let me know if that is what you are trying to achieve,

I changed my as-path access list to include the full AS path not just the customers AS, and that worked. Thanks Craig and hritter. I obviously did not understand the correct use of the AS parameters after the permit keyword.

Not to get greedy here, but is there a way to inbound pad the AS path for a single route entry that only has one AS entry?

In otherwords, we and our customer have an ISP in common and their address space is in the ISPs AS, so there is only the single AS entry. Can just their address space be padded without affecting other address spaces that are in the ISPs AS?

Thanks again for the helpful hints.

You can match on their address space using a prefix-list instead of matching on the AS_PATH as follow:

!

ip prefix-list CustPrefix permit x.y.z.0/24

!

route-map set-inbound-as-path permit 10

match ip address prefix-list CustPrefix

set as-path prepend 6395 6395

!

route-map set-inbound-as-path permit 20

Hope this helps,

That did the trick. Thank you for your help, I will go back and read the documentation again so I get a better feel for this type of manipulation.

Review Cisco Networking for a $25 gift card