cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1938
Views
0
Helpful
19
Replies

BGP AS-PATH manipulation question

jcmartin
Level 1
Level 1

Is there a way, other than prepending to the AS-PATH, to alter the AS-PATH? For example, if I was advertising an AS-PATH of 500 5 but I wanted to advertise it as 500 500, how can I do that?

19 Replies 19

marikakis
Level 7
Level 7

Hello,

Regarding your first question:

According to the BGP command documentation there is a way. You still set as-path in route-map configuration mode similar to the prepend, but instead of specifying the keyword prepend you specify the keyword tag. However, you will need some redistribution acrobatics. For more information and an example, please take a look at the following URL:

http://www.cisco.com/en/US/products/ps6566/products_command_reference_chapter09186a008079e0fd.html#wp1048455

Another somewhat specific case that might not interest you is for a receiver to remove private AS numbers from the AS path:

http://www.cisco.com/en/US/products/ps6566/products_command_reference_chapter09186a008079e0f6.html#wp1026277

Regarding your second question:

In a path written in the form 500 5, the originating AS is 500 and peers with AS 5. You cannot control this unless you are in control of the AS 5 router (I mean you cannot force the upstream of AS 500 to say they are somebody else, unless they are willing to do so). For such a purpose, local-as feature can be used:

http://www.cisco.com/en/US/products/ps6566/products_command_reference_chapter09186a008079e0f6.html#wp1024930

http://www.cisco.com/en/US/tech/tk365/technologies_configuration_example09186a00800949cd.shtml

Now that I written all this, I think you would be more interested in the local-as feature. :-) So, we have various ways to alter the AS path. Which one you use depends on what you want to do.

Hope this helps,

M.

What I'm trying to do is mimic what is happening in BGP on a provider MPLS network, without the MPLS gear. In the provider network, the CE routers are all in, for example, BGP AS5. They all peer with the provider in BGP AS500. They can all see each other, because somewhere in the MPLS network, probably in the PE routers, the provider is stripping the AS5 from the AS-PATH, and readvertising is as coming from AS500. To try to duplicate a different problem we're having, I need to replicate this scenario. Unfortunately, local-as won't allow you to use the same AS that is on the router. I tried reconfiguring so that the hubs were on a private AS and use the remove-private-as statement, but this isn't working the way I'd expect either. I'm not sure how the set as-path tag command works, as the examples don't really show a before and after, what the tag consists from or where it comes from, etc.

When AS Override is configured on a PE, the PE replaces occurences of the connecting CE's AS number with its own AS before sending updates to another CE to avoid AS_PATH loops and denial of prefixes on other CE's. Have you tried something like that?

Hope this helps,

M.

I don't have MPLS in my lab, and AS Override is only available with MPLS. So, no, I guess I haven't tried it, just read about it.

Hello,

Ok, I try to think of something that might simplify things, since this is a lab test. Have you tried to use private AS numbers in the lab routers that mimic the CE's, so that you can use the remove-private-as on the router that mimics the PE?

Kind Regards,

M.

Thanks for all your help!

Yes, I did try that, several steps ago. What I found odd was that before this, if I did a debug bgp on the edge router, I could see it rejecting the routes of the other edge routers because it had its own AS in the path. With the remove-private-as option, I no longer see these errors, but the routes are still not getting to the edge routers.

Do not thank me, I really find this interesting!

Ok, have you tried to use different AS numbers on each CE? Perhaps the router that mimics the PE is playing it smart.;-) I mean, this router knows the AS where the routes came from and does not send them back to the same AS.

Kind Regards,

M.

I haven't done that because it doesn't reflect what I have on my customer's network. Didn't see the point. I did try to use the local-as option, even though it can't be used on the same AS, but kept getting AS mismatch errors.

Ok, have you tried to use 2 routers to mimic the backbone? I mean, use another router as a PE to allow the routes to pass through. The second router I believe will have lost the information about the original path.

Kind Regards,

M.

I haven't tried that. I'll have to look at the design of the lab. I have the physical restriction that the lab is about 1000 miles or so away, so I don't have the luxury of being able to move things around...

I understand that, but every feature I can think of right now assumes there are a couple of routers around. Can't think of anything else right now. Sorry!

Kind Regards,

M.

I begin to think of redistribution, which shows despair since I really don't like it. :-) You could run OSPF on the PE, with some participating loopbacks perhaps, and redistribute BGP routes received from one CE into OSPF. Then, redistribute OSPF into BGP and see what happens. Perhaps this is stupid and router outsmarts me. I don't know. This in combination with the remove-private-as.

Kind Regards,

M.

By the way, I have one comment regarding a previous post of yours, regarding the customer topology. Perhaps using different AS numbers doesn't reflect the customer topology, but it could be helpful to make such a simplification. Unless you have an issue that closely relates to having the same AS numbers. We could assume that the provider does its work, unless what we are trying to prove is that it doesn't.

Kind Regards,

M.

I really appreciate all the thought you're putting into this. Like you, I like a good challenge, but I really need to come up with some sort of answer fairly soon, since a customer network is relying on it.

As for your last suggestion about redistributing, I might give that a try next week. Had to give up the lab to someone else who needed it (I've been hogging it with this problem), but get it back Monday.

I do suspect that it has something to do with the way the AS's are set up, but it's a bit more complex than the part I'm working out now, as there are actually two providers and multiple connections between them (which is also the reason I don't have any extra routers in the lab).

I'm also going to check to see if I can put together some sort of MPLS structure on the switches. Not sure if they can handle it, but the commands indicate references to VRFs, so what the heck, I'll try something else new.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card