Let's say AS100 is a multihomed AS, connected to AS200 and AS300. It has two eBGP border routers - B1 is connected to AS200, B2 to AS300. The IGP inside AS100 is OSPF.

If B1 knows about AS200, and B2 knows about AS300, and AS100 has IGP protocol running in it, why would anyone need internal BGP (iBGP)?

I thought that's the point of OSPF - it tells every router inside AS about the reachable networks and the right paths, so two hosts from any pair of networks can communicate. So if B1 knows about AS200, I thought that IGP just steps in and tell everyone else in AS100, including B2, about networks from AS100.

But for some reason, iBGP is still needed between B1 and B2 to make thigs fully work. Is it because B2 needs to know exactly the same thing as B1 and vice versa and IGP isn't telling B2 all that B1 knows (not sure why)?

I'd be grateful if you could explain it in the most straighforward way.

  • 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 can provide your own answer and accept it. – Ron Maupin Aug 7 '17 at 13:43

It's not true that you always need iBGP. Many networks with eBGP run fine without it.

There are two scenarios where iBGP is important.

You are a transit provider. That means you allow traffic to pass through your AS. In your example, you allow AS 200 to reach AS 300 by going through you. In this case, B1 needs to know B2's routes so it can advertise them to AS 200, and vice versa. Your internal routers running OSPF don't need to know all these routes. So B1 talks to B2 using iBGP.

You have multiple border routers and they need to determine the best path out. You many have a default route drawing traffic to your edge, but then you may have several carriers from which to chose. B1 needs to know B2's routes so it can forward traffic to B2 if that's a better path.

This earlier SE question might help you too.

There are several good books on BGP design, and you would be served well by reading them. Look for books by Halabi, Stewart or Zhang.

| improve this answer | |
  • Refering to the answer you linked - 'Scalability - You use BGP because you don't want to carry your entire internet routing table in your IGP (i.e. in my case, OSPF)...' it means that I would have to keep the whole BGP table in every OSPF router in my AS, so that BGP router B2 knows what BGP router B1 knows and vice versa, and by using iBGP I keep the BGP routing tables only in those routers that specifically need them, that is eBGP routers? Is that more or less what is meant there? – user4205580 Nov 8 '15 at 11:02
  • Yes, that's the idea, and as @Ron Maupin says below, the BGP metric is more complicated than OSPF's. If you redistribute it into OSPF, you lose all that info. – Ron Trunk Nov 8 '15 at 14:09

Besides what Ron explained, you should also understand that each routing protocol maintains its own table which is separate from the routing table used by the router to forward traffic. It may be useful for routers running eBGP to share their BGP tables, and if they are in the same AS, they would need iBGP to do that.

A router running BGP and OSPF doesn't share routes between the routing protocols unless you specifically redistribute those routes from one routing protocol to another. This presents problems because the metrics, attributes, and administrative distances of each routing protocol are different. BGP maintains a lot of information which OSPF doesn't. If you get eBGP routes on Router 1, redistribute the routes into OSPF, and send them to Router 2 (also running BGP), then redistribute them back into BGP, you have lost all the BGP attributes which Router 1 had received.

The only way to maintain the BGP attributes from one BGP router to another BGP router is to let them communicate with BGP, and in the same AS that is iBGP.

| 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.