4

Consider this network diagram BGP network

  • Routers A and B belong to the same AS
  • Networks 10.0.10.0/24 and 10.0.20.0/24 are routable via AS200 and AS300
  • Network 10.0.10.0/24 is accessible via Router A and pass through Router C
  • Network 10.0.20.0/24 is accessible via Router B and pass through Router D
  • Routers C and D are ISP routers

Network scenarios:

  • When link between routers A and C is down, traffic should pass through router B via D
  • When link between routers B and D is down, traffic should pass through router A via C

Here's the rough config:

Router A

router bgp 100
 network 10.0.10.0/24
 network 10.0.20.0/24
 neighbor 10.0.21.1 remote-as 100
 neighbor 10.0.21.1 next-hop-self
 neighbor 11.0.0.1 remote-as 200
 no synchronization

Router B

router bgp 100
 network 10.0.10.0/24
 network 10.0.20.0/24
 neighbor 10.0.10.1 remote-as 100
 neighbor 10.0.10.1 next-hop-self
 neighbor 12.0.0.1 remote-as 300
 no synchronization

Questions:

  • Am I correct to assume that I have to announce both networks (10.0.10.0/24 and 10.0.20.0/24) to each eBGP peer?
  • What is the best way of doing this?
  • 2
    Looks like you have your peer statements in AS 100 wrong? Which linknet are you using? To control inbound traffic you would use AS path prepending or preferably communities. For outbound traffic you would set local preference. – Daniel Dib Jun 27 '14 at 8:10
  • 1
    Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 8 '17 at 21:14
3

A will learn C's routes directly through eBGP.
A will learn D's routes through B using iBGP.
A will prefer C's routes because they were learned through eBGP.

B will learn D's routes directly through eBGP.
B will learn C's routes through A using iBGP.
B will prefer D's routes because they were learned through eBGP.

To make sure return traffic goes the way you want it to go, you need to do a couple of things.

A needs to advertise all routes to C and B needs to advertise all routes to D.
You need to make sure you aren't advertising C's routes to D or vise versa through your network.
When A advertises B's routes to C, A needs to prepend AS100 once or twice to make it look like a less desirable path.
Similarly, when B advertises A's routes to D, B needs to prepend AS100 once or twice to make it look like a less desirable path.

This is all done using route maps. On A:

ip access-list standard BRoutes
10 permit 10.0.20.0 0.0.0.255

ip access-list standard ARoutes
10 permit 10.0.10.0 0.0.0.255

route-map OutToC permit 10
match ip address BRoutes
set as-path prepend 100 100
route-map OutToC permit 20
match ip address ARoutes

router bgp 100 neighbor 11.0.0.1 route-map OutToC out

This hides D's routes from C so you don't become a transit AS and makes B's routes look an extra couple of AS hops away (even though the AS number is the same). You'd need a mirror configuration on B.

Key search terms for future reference:
Route map
AS Path
BGP Metric
AS Path prepending

| improve this answer | |
  • Also, for iBGP neighbors, the recommended best practice is to establish loopback IP addresses on each iBGP neighbor and use those for establishing neighbor relationships. This allows you to load-balance your IGP connections for BGP traffic and keeps you from losing your iBGP neighbor relationship if one of your internal links goes down. – Avery Abbott Jun 29 '14 at 18:09
4

You should announce both networks to each eBGP peer and work with a route-map to prepend your AS path for influencing the incoming traffic on both routers. (of your EBGP have maybe a BGP community?)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.