recommendations for lowering bgp metric in public peering

Hi guys!

I am wondering when configuring a public bgp peering and I have a subnet /23 that is split into 2x /24, how one can achieve best load balancing here.

For example the own AS is 12345 and I have two routers. The first should be preferred for the first /24 net and the second for the second /24. I would like to prepend the as-path e.g. on the first router for the second network to make it less attractive. When I prepend the path with a route-map and "set as-path prepend 12345" it works.

sh ip bgp:
*> 172.16.10.0 172.16.32.1 0 54321 12345 12345 ?

 

When I want to add another time the 12345 AS e.g. "set as-path prepend 12345 12345" then I receive a error message in the BGP update.

BGP(0): 172.16.32.1 rcv UPDATE about 172.16.10.0/24 -- DENIED due to: AS-PATH contains our own AS;

sh ip bgp:
does not show anything for that network

 

I am exhausted today and dont get it when doing it with two and it does not work. Any one knows this from pocket?

Thanks in advance!

Regards!

Markus

Comments

  • One more question: When doing public peering. Is it suitable to prepend the last (own) as or is there some kind of placeholde in BGP who can do this? Like "set as-path prepend 1" or so?

     

    Regards!

    Markus

  • sh ip bgp:
    *> 172.16.10.0 172.16.32.1 0 54321 12345 12345 ?

    When I want to add another time the 12345 AS e.g. "set as-path prepend 12345 12345" then I receive a error message in the BGP update.

    BGP(0): 172.16.32.1 rcv UPDATE about 172.16.10.0/24 -- DENIED due to: AS-PATH contains our own AS;

    sh ip bgp:
    does not show anything for that network

    Can you provide little scenario for this ? Which is the other AS, how routers are peering etc

     

  • Wont make it today i am in hurry this evening.will provide it tomorrow!

    Regards!

  • Wont make it today i am in hurry this evening.will provide it tomorrow!

    Waiting for this Markus..

  • peetypeety ✭✭✭

    I can't follow whether "you" are ASN12345 or if "you" are receiving routes from ASN12345.

    If you are advertising the two /24s, you should be prepending your own ASN.  You shouldn't be seeing your own routes come back in elsewhere, as BGP will discard paths with self-ASN as that'd consitutue a loop (you can override this with allowas-in, but I suggest you have a solid safety net in place for this).  There are also tricks for managing local preference in the next AS which can make a huge difference in your tuning, for the better.

    If you are receiving the two /24s from a neighboring ASN, I'd recommend prepending their ASN.

  • Markus,

    I always prepend my own ASN, but I have seen sometimes people prepending ASN 1 to routes in the real world, but just to be on the safe side, always prepend your own ASN.

    I did not understand the topology, so I will wait for the topology to manifest, but I suppose you have an eBGP connection and it kind surprises me that when you set as-path prepend 12345, whhy the other end router complains about seeing its own ASN, since this is an eBGP. Anyways, I will wait for the topology before drawing any conclusions ;)

    Good luck!

  • I always prepend my own ASN, but I have seen sometimes people prepending ASN 1 to routes in the real world, but just to be on the safe side, always prepend your own ASN.

    Thats exactly addressing my question (so I dont need to send a drawing...TIMESAVER :) ). Why would someone prepend with "1"? I always prepend the own AS number too!

    Regards!

    Markus.

  • When I want to add another time the 12345 AS e.g. "set as-path prepend 12345 12345" then I receive a error message in the BGP update.

    BGP(0): 172.16.32.1 rcv UPDATE about 172.16.10.0/24 -- DENIED due to: AS-PATH contains our own AS;

    sh ip bgp:
    does not show anything for that network

    Did forget that here. Will lab this up in a few minutes again and have a look.

    Regards!

    Markus

     

  • Grrrrr. Labbed up a new session with a test setup just to test the behaviour of as prepending...worked. I wondered why it does not in the other topology. Stopped everything, restarted everything. Worked -.-

    I should enable a script for automatic rebooting every 2mins ;).

    Regards!

    Markus.

  • Sorry for the double-post. So this one is open (just that no one reading this thread thinks its already completed)

     

    Why would someone prepend with "1"? I always prepend the own AS number too!

     

    Regards!

    Markus

  • Grrrrr. Labbed up a new session with a test setup just to test the behaviour of as prepending...worked. I wondered why it does not in the other topology. Stopped everything, restarted everything. Worked -.-

    I should enable a script for automatic rebooting every 2mins ;).

    Regards!

    Markus.

    It happens! Reload is definitely a tool you should have under your tool-belt ;)

  • Sorry for the double-post. So this one is open (just that no one reading this thread thinks its already completed)

     

    Why would someone prepend with "1"? I always prepend the own AS number too!

     

    Regards!

    Markus

     

    Sorry just saw this now. I am not sure why Markus, but to me is just that some people is lazy to check their ASN (lol), so they prepend 1 in the path and whatever. Anyways, if you are not connected to the Internet and this is just a MPLS connection for your company, this shouldn't be a problem.

    Not sure if there is some real explanation to this, if someone knows, share please ;)

    Good luck!

Sign In or Register to comment.