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 post and accept your own answer.
    – Ron Maupin
    Jan 5, 2021 at 18:16

2 Answers 2


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.

  • 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? Nov 8, 2015 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, 2015 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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