1. Understanding BGP Neighbors – Internal – External
We’ll try to understand some of the concepts we’ll see in this video. Now, like I said, we’ll start with BGP neighborship. Weirdly, we have two types of neighbourhood BGP: internal BGP and external PGP. So we’ll see the differences and also try to see the basic configuration of the BGP routing protocol. We’ll just try to understand the basic commands in this video. Probably in our next video, we’ll try to get into latencies.
Okay? So we’ll try to understand some basic commands, and then finally we’ll move on to the different types of BGP tables. Like OSPA, EHRP maintains three tables. In a similar way, BGP also maintains these three tables. So we’ll try to differentiate between what those tables are. That’s what we’ll see. So let’s get started with the BGP neighborhood. BGP neighbours are similar to the OSP of your neighbourhood or the EHRP neighborhood. But there are some differences or a few things that are not similar. Like the BGP neighbors, the TCP neighbours form a neighbourhood by using a TCP connection. So far, so good on port 179. And then they will exchange the routing updates. The BGB updates are only exchanged once the neighborship is formed. And then this neighborship has to be manually configured. Now, this neighbouring is manually configured.
We’ll see those commands. So, what exactly does “manually configured” mean? I’ll try to get into that. So, “Neighborhood,” let me tell you what this manual is about. Now, BGP neighborship is also called “BGP peers,” or we also call it “BGP speakers.” Now, mainly, there are two types of neighborhoods: IBGP Neighborhood, internal BGP, and external PGP And one more point, the neighborship has to be manually configured. Now, what is exactly manually so in this manually configuration, like if I take an example, in case of Oospore EHRP, let’s say I’m using EHRP or OSPF protocols; even these protocols also maintain a neighbour table where, automatically, whenever you realize this interface, it’s going to send a hello message to a multicast address. And when you bring up the other interface, it will respond to that hello message. And then they will automatically build a neighbour ship, and they will automatically become neighbours of each other, and they will build a table called the Neighbor Table.
And we can verify with Shiur neighbours in the case of EHRP, and we can use Shiur neighbors. Now, there is something called automatic neighborhood, or even in those protocols, we can configure manual neighborhood. That is, once again, a secondary consideration. But in the case of BGP, these two routers only exchange routes after forming the neighborhood, just like in OSPF. But the difference is, on the router one, we had to configure a command called “neighbor,” and whatever the IPO was, let’s say one, one, two. Then, on router two, you must configure another command specifying that neighbor’s IP address, say one.
So, if you manually configure both ends and they have the correct configurations, And if both ends of these neighbours are reachable, then only they will form a neighbourly relationship. Now, the major difference between your IGP neighborship and EHR POSP is that in EHR, the neighborship occurs automatically based on multicasts, whereas in BGP, the neighborship has to be manually configured. That is the one major difference. So we’ll see the configuration as well as move on with our training here; it’s also called BGP speakers. And we’ve got two types of neighbors. We have internal BGP neighbours and external BGP neighbors. So the basic difference again between these two is that internal BGP neighbours are called IBGP neighbors. If the routers are Router A, Router B, Router C, and Router D, then These four routers are all neighbours to one another. And all four routers are the same.
What is that? as a self-contained system with 65,500 units. Now, all of these routers are referred to as IBHGP neighbours because router A is a neighbour of router B, and router B is a neighbour of router A, and both belong to the same autonomous system number. Now, this type of neighborship is known as “internal BGP neighbors.” Whereas here, you can see C and X. These two are external BGP neighbors. Because router C is in AS 65,500 and router X is in AS 65,100, we refer to them as EBGP neighbors. So they both are different, as we call them external BGP neighbors. You can see Cand X or EBGP neighbors, D and Y or EBGP neighbors, and all the ABCD or internal BGP neighbours in this diagram. So that’s a basic difference. And then the next thing we’ll see is that, just like your OSPF or EHRP, BGP also maintains three kinds of tables. Neighbor Table, BGP Table, Routing Table Now, when you talk about routing tables, they’re similar one. It contains a list of the best routes. Whatever the best route installed in the routingtable, it will be shown by using acommand called Show IP Route neighborship.
The neighborship table contains a list of neighbours that have been configured by the administrator. And one more thing we discussed just now: the neighbours have to be manually configured by using the neighbour command. And for verification, we can use the show IPBGP Summary and show IP BGP neighbours commands. These two commands will be very useful to verify whether the neighborship is up or not. Okay? Another change is that this neighbourhood is no longer required to be directly connected. So we’ll see that split horizon rule, and those things will definitely get into it when we get into labs, as we’ll probably see in our next video probably.
And then there is the BGP table, which contains all the routes that are advertised in BGP and known by BGP—nothing but all the networks. Whichever you advised in BGP, we can verify by using a command called Show IP PGP Command. So, majorly, this BGP table will be seen in more detail when we move on, probably after four or five videos, and we’ll be getting into this BGP table verification. But the next three to four videos will be major. Concerning neighborliness, how to convey neighborliness, and what are the various approaches to conquering neighbourliness Because if the neighbouring relationship is established, everything indicates that things will only work once the neighbouring relationship is established. We have a lot of variations in the neighborhood, like internal BGP neighbors, external BGP neighbors, neighbourhoods using loop bags, and neighbourhoods using route reflectors. So neighbourhoods use peer groups. We have a lot of things, so probably we’ll try to get into those things more in detail in our next four or five videos. After that, we’ll be focusing on the BGP path selection process. So this is where we’ll be discussing the BGP path selection process. So that is something we’ll be getting into more detail about later on and then verifying the routing table. This is also true. The last thing before we finish this video is that we are going to see the basic configuration. The basic configuration in BGP is similar to that in EHRP or OSPF. As an example, we begin with the BGP router and then define the autonomous system number. My own as If I’m using 65,000, I have to define the number as 65,000. After that, network commands are similar.
For example, if you do not prioritise any network, we must say network and network ID. And this mask option is optional. Now, a mask is optional, and I’ll go over this in greater detail in my next video, where we’ll see some practical examples. So I’ll give you some more detail about this configuration when I do the labs. So, apart from that, there is a neighbour command. So the neighbour command is mandatory here. Why? Because here on the router one, you have to configure a neighbour command saying that neighbor, whatever the IPRs, let’s say the IPRs of the router two are one, one, two. Okay? And both the routers are at the same address, let’s say 500. I had to say “remote” and then I had to define the number as 500. So if this neighbour is sorry, I think I’m missing 65,000 here, so let’s do the same number. So it is 65,000. So if I’m using 65,000 here, and if I use 65,000 here automatically, the router will understand that it’s an internal BGP neighbour because my S and the neighbor’s S are the same. If this number here and this number there are different, then it will automatically understand them as external BGP neighbors. So that’s how, based on the configurations you are doing, the devices will understand automatically whether you are configuring an external BGP neighbour or an internal BGP neighbor.
Okay? So let us quickly revise what we discussed. So first, we started with BGP neighbors. The main part of the BGP neighborship has to be manually configured. That’s the first thing we’ve noticed. And we have two types of neighbors: internal BGP neighbors and internal BJP neighbors. If both routers are in the same state, they are referred to as internal and external BGP neighbors, respectively. If one router is in the United Nations, the other router is in a different area. These two routers are referred to as “external BGP neighbors.” And then we have seen some of the basic configuration of the routing protocol. For example, inside your router, we primarily use the neighbour command, BGP, and whatever the number is. And then we use subnetwork commands to advertise. So it’s more like your OSP or EHRP. Aside from this neighbour command And then BGP maintains three tables; it maintains a neighbour table, and we can verify the neighbour table by giving a Show IP BGP Summary command or a Show IP BGPNeighbors command to the BGP database table or the BGP table. It has all the routes that are advertised inside the BGP. And finally, we have the routing table, which contains the best route to the destination. Okay, so probably we’ll see you in the next video, where we’ll try to get into some more laps.
2. IBGP Neighbors – LAB
So now we are ready to start with our basic lab, the BGP. Now, if you remember, we already discussed in our previous section things like how to configure the basic BGP. Like, first we need to define the number, and then we use something called the neighbour command because in BGP the neighbours have to be manually configured, and then the network command is going to advertise the network. I’ve got one simple scenario here: how to configure the basic BGP configurations. As an example, router A has a ten-to-one neighbourhood formation ratio. Just a minute, let me check the conflicts here. So router A, as you can see, is using 65,101, and then it is forming the neighbourhood with 109,216811, and the remote for Aus is 65 10 two.
So if my AES and the neighbours are different, then it will understand that it is your external BGB neighbor. Then router A forms the neighbourhood with ten two as well. And there should be another command neighbour ten, and the remote is so why are A and CB forming a neighbour ship despite not being replicated? Because of the horizontal speed rule, I’ll explain. So I’ll get into more detail about that. So these are some of the basic neighbour commands.
So, we are ready to start our lab. Here’s where I’m going to take my four routers, the same topology that I’ll be using in all my CCNP classes. So I’m going to use the same topology, and then I’m going to configure a task here where we are going to configure the IBGP peering by using the number 100, as per the diagram, using our directly connected faces. And after that, make sure that all the routers see the routes of other routers. So, what is my final requirement? I want to ensure that all four corners form a neighbourhood with one another.
Okay, we need to configure the neighbours as per our diagram, and then we have to make sure that the router one route should be seen on router two, on router three, as well as on the router phone. So, once again, vice versa. Router 2 should also be able to see all the routes. Routers three and four Okay, so let’s get started with the basic configurations. I already have my devices connected similarly to the ports. Whatever you can see here—the router—is the one I’m going to configure. If you verify, router one is preconfigured with IP addresses exactly as in the diagram. So divide zero by 010-1142. Now, in the same way that all the devices have their own IP addresses, The same thing happens in router two. Also, on router 3, I have an IP address preconfigured, but only the IP address is preconfigured on router 4. If I verify, I don’t have any of the routing protocols running here; it’s just a basic IP address configuration. Okay, so you know that basic configuration. So I’ll start with the basic BGP configurations on the router one. The number 500 (or any other number I can use here) is used by Router One to form the BGP. I’m going to assume that I’ll run number 500, and then I’ll send neighbor. Router one is now forming a neighborship with one, two, and four, four. because here the neighborship has to be manually configured. So I need to manually say “neighbour 1,” “neighbor 2,” and then there is a command called “remote as.” We must now determine which neighbour this is, which is currently router one, which forms the neighbour ship with router two, and router two also belongs to the same as. So, if it is the same, we simply give the neighbour the same number, 500. So if my S number and the neighbor’s AS number match, then automatically all the routes exchanged with this neighbour will be considered internal PGP routes within the same autonomous system. Neighbor. So here we are going to just assume just one as we have some labs in the future. In the next videos, we’ll also see how to configure external BGP neighborship also. So first, let us try to focus completely on internal BGP neighbors. After that, I’ll say good-by to my neighbor. Four four one is the number of the other neighbor. So I’m going to say four one.
Remote Ace is also 500. So I have two router neighbours who are directly connected to routers two and four. So I configured router two and then router four. And then I’m going to use a network command. I’m going to configure my LAN interface, and then I’m going to configure my Van interface, which is a one-dot network. And then I’m going to my Vainer face, which is a 4-dot network. So I just have to do these ten, one, and four. And there is one more command. Let’s say we take an example. If you recall, I already had my preconfigured interfaces, and I also had some other interfaces. So if I verify the swipe interface in brief, I get a loopback interface. I want to advertise that loopback interface. So I’m going to say eleven. Since we are pressing, we have an option called “mask” here. So I’m not pressing Enter here. Now here, I am going to use a mask. Now, the first thing we need to understand is why there is a difference. So you can ask me why I’m not using the mass command here and why I have to use the mask command here.
Okay, so let me explain to you why it is used in BGP. There is a rule that whenever you’re advertising anything in the network command, let’s say in my router, router one, I have three interfaces, which is a ten-dot network contained on my f zero by zero interface, and it is going to use eight subnet marks. So that’s something I’ve set up on the interface, and on s one by zero, I’ve set up one one with eight submitted marks, and on s one by one, I’ve set up some other IP, I believe something around four two with slash eight submitted marks. So if you want, I can verify, and I can show you that as well. So, if I go to my router number one and verify showan interface f zero by zero, I can see that I’m using slash 24. And I can see it if I give it one by one; sorry, eight here, eight here. Likewise, if I give them one by one, slash eight. And when I check my loopback interface, it is eleven out of twenty-four. So I’ve used eleven with a 24 subnet mask in my loop bag interface that I’m going to configure on my loop bag zero interface. Now in BGP there is a rule that I think I got a rule in my notes here I’ll try to explain you that the router always looks for the exact mask, exact network and the mask in the routing table.
But if it cannot find it, it will not announce anything. The router looks for exactly this in the routing table if they do not match. Okay? Now, whenever you confirm any network command, let’s say here I just configured network ten and I didn’t use any mask option, we’re going to do this by default. So when you don’t use any mask, the BGB is going to understand it as a default mask, which means the default mask is to slash it. When it takes a slash at it now Now, when you are dazzling the network ID, the mask must exactly match the same mask in your routing table. In your routing table, there is also a default rule in BGP. BGP will not announce any route unless and until the same matching route and the matchingmask is present in the routing table.
Now you should see these routes in the routing table. I can see my home network with a slash through it if I go to my router one and show IProute. Now this network will be advised, but if I use it, if I verify it, if you try to see it here, if I give this command without the mask option, by default the network will be advertised as eight. Now, if I verify my routing table, this is not slash 80 to slash 24.
Now, if the masks do not match, the route will not be advised. So, in a nutshell, whenever you’re giving advice, make sure that whatever mask you’re using in the network command, whatever mask you’re using in the network command, that mask should exactly match the same on the interface, or at least it should be in the routing table. So then only the BGP will advertise the route. That is a compulsory rule, which is one of the basic things we need to know, especially when we advertise the BGP generally. Sometimes we’ll see some of the routes weren’t advertised in the BGP, and this might be the reason. So this is the default ruling of the PGP. So that’s the reason I’m saying network eleven; I’m going to say 24. That’s the reason I’m using this command. But I don’t need to use it here because I’m advertising with a slash eight, and it’s also reconfigured with a slash eight on the interfaces or in the routing table, but it’s configured with a slash 24 here. So I have to advertise with “slash 24” only. So we need to make sure that we are advertising the same mask that is in our routing table or on the interface. So this is one thing we need to keep in mind, and after that, if you just try to verify, I’ll try to quickly copy and paste the same commands again.
Anyway, I did that; this is the command we did, and this command also. We configured just now, and this command, just for reference, I’m adding, but it’s not present in our diagram, so we can simply ignore that. But we need to understand this: we need to match the exact mask, and after that, there is a command called “no auto summary.” Auto summary is disabled by default in the majority of the new iOS. But you can give this, and there’s one more command called “no synchronization.” So about synchronization, I’m going to discuss it in a separate video. So as of now, you just simply follow that no sync is something we need to add, but I’ll definitely get into these things. What exactly is the synchronisation rule, and why do we need to turn it off? I’ll explain it in greater detail once we have a firm grasp on EBGP and IBGP neighborships. So, in a similar way, I need to do the same thing on router 2. Also on router 2, I’m going to say router BGP 500, and then I’ll say no auto summary, no synchronization, and network command 20 dots network. Sorry. So first, we’ll start with our neighbors.
In any case, neighbour router two has now formed a neighbourhood with two routers, resulting in one router and two neighbors. I’ll say one one and remote S are both 500, and then I’ll send out a summary with no single edit, and the network commands a 20-dot network in the land, a two-dot network in the van, and a one-dot network in the van. So I just advertise my 20 network, a two-dot network, and a one-dot network, and then I’ll go to router 3 and do the same thing in the order summary: no synchronization, neighbour two one, which is my first neighbour in the 503 form, and the other neighbour is three three two. So I’ll say three dot two, and the remote is again 502 neighbors, followed by advertisements, the three dot network, and the two dot network. That’s it. Now I’m going to do the same thing to router BGP 500, so it has to be 500, so I’ll remove it. So, BGP 500 router, no auto summary, no synchronisation neighbor. On the router, we have two neighbors, three dots three or three dots one, which is my first neighbor, 500. And on the router one also, I got four, four, two, which is my router, one neighbor, and then I was advertising my LAN interfaces and one interface. Done. So, after we’ve completed the configurations, it’s time to verify. Now, just like when we configure EHR per OSP, the first thing we need to verify is the neighborship, and for this we use a command called Show IP BGP Summary.
So this command is very useful for verifying the neighborhood. Now, if you look at this neighborhood, these are the neighbors, and the current version is version 4, and the neighbour is also in the same, which is why we see 500 here. And from this neighbor, you can see what the state is and how many prefixes I am going to receive. So if you see any number here, that confirms that the neighbour ship is established. So, even if you see 0, it confirms that the neighbourly relationship has been established. So if you see a number that isn’t zero, it could be any number. If you see something called “active” or “idle,” then you have to understand that there is some problem. So, if you see messages for a long time, everything is fine here right now. But we’ll do some troubleshooting in the later videos, where we’ll try to figure out what might be the possible reason if you see a state called “ideal” or “active.” So we’ll do some troubleshooting separately. As of now, we are going to assume that everything is working fine. Or you can use this command: show IP BGP neighbors. Shui BGP neighbours will now show you all of the information: who the neighbour is and what it is, what version you are running, and the router ID. Route ID concept is same like OSPF, by default it will take the highest type of the loop back. If there is no loopback, the highest type of the active physical interface, we can even manually change the route. Ready? Also there’s a command called BGP route ID. But in general we can ignore this command, not really required as of now. Okay? And you can see that the BGP state has been established and is operational.
So it gives a lot of information. But I generally prefer this very short command: “show IPBGP.” It will show you that the neighborship is up and how many prefixes I’m going to receive from the neighbor. Now on the router, I can see two neighbours in a similar way. I’ll verify on the router, and I should see two neighbors. As you can see, these are two neighbors, and their neighbouring relationship is good. and I’m going to receive the routes. Now, if I verify on the router one, show IP route, and go on further, show IP route PGP, Now on router 1, I can see the routes coming from router 2, which is a 20-dot network. As you can see, it has an administrative distance of 200. Because the route is coming from internal BGP, the default administrative distance is 200 for any routes received from an internal BGP neighbor. And if you receive any routes from an external BGP neighbor, then you’ll see something called “20” as administrative distance. So when we start BBGP, we can probably see those things as well. And I’m going to receive 40 or network, too. But I think something is missing here. If you try to see here on Route 3, the route is not coming, okay? So if you just try to figure out the problem, the problem is that the Router Three route is not coming.
3. BGP Split Horizon Rule
So, as you can see in my routing table, this route does not arrive on router 3. So route three will not be arriving. I don’t see ten if I try to verify on the router 3, Show IProute BGP on the router 3. So that means router one is not receiving router three’s route, and router three is not receiving router one’s route, except that everything else is working fine. Similar way, if I try to give Show IP route on the router two and on the router two, I can see ten and eleven which are coming from router one, and I can see 30.I don’t see 40 on the router; 240 is missing. And I believe that on Router 4, which route should be missing, Router 20 should be missing. Okay, now, it’s very simple here. Just now, we need to figure out what the problem is here. The issue here is actually quite simple. If you try to see my diagram here, this is my diagram. Router one is not able to see the route coming from router three here. So here, this 30-dot network is not coming on router 3. And this 10-dot network is not coming on router 3. So the router-three route is not coming to router one, router one, or router three. Similarly, the same thing is happening between routers two and four.
So, in short, from this, we can understand that the routes are only sent to the neighbours that are directly connected. and it’s not going from there. Here, the reason is because of something called the BGP Split Horizon Rule. Now, by default, there is a loop prevention mechanism inside the BGP because, for external routing, BGP will carry autonomous system path information. Based on that, it will deny the route. But in the case of internal BGP, what it will do is what the default rule says: an update sent by one IBGP neighbour should not be sent back to another IBGP neighbor. I’ve got the rule here. An update sent by one IBGP neighbour should not be sent back to another IBGP neighbor. Okay? So, if router 1 sends an update to router 2, router 2 should not send the same information to router 3. Okay, so that means that router two can send its own information to router three. That’s what’s happening here. Also, now what is happening here is that router one is sending the 10-dot network update to router two. But router two is saying I should not pass on this information to router three because of this rule; the same thing is happening here. Furthermore, router one sends to router 4, but router 4 does not send to router 3.
The same thing is happening between two and four. Router two is sending to these two routers, but these two are not sending to other routers. So it’s simple. an update sent by one neighbor. So if router one is sending a 10-dot network, it should not send that 10-dot network again to other routers. However, the router 2 can only send its own networks and not the others. Because if this route is not present right now, it is possible that your route will reappear and create loops. So now, to overcome this, there are two possible solutions. The one option is that we need to configure a full mesh neighbour relationship as a possible solution. which means if you have four routers inside the autonomous system number, like in our example, we have four routers. Router one should form a neighbourhood with Router 2, which we already did. Router one should be connected to router four via a neighbour relationship. Again, we did that. Router one also should form neighborship with routerthree even though it is not directly connected. As a result, there is no need for BGP neighbours to be directly connected. So there’s no rule that they should be deadly connected, but they should have a fully meshed neighborhood. That is mandatory, and that neighbour must be reachable again. As a result, full mesh neighborship is required. Or we can use something called Rotrifactas, which we’ll see more in detail in the next videos.
This is one more option. So Rotriffetas is just an alternative solution to full mesh. So we’ll see more detail about routereflect in our next separate section. But as of now, I am going to go with a full mesh neighborhood. So, if you have ten routers inside, each router should have nine neighbour commands. Even though they may be dedicated, they may not be dedicated. So this is a compulsory rule in BGP. So you have to follow this rule. There are many default rules within the BGP that you must understand before configuring. So that’s what we are going to do here. So let me configure now on the router one, router one to router two, the neighborship is there. If you verify my configurations on the routerone already I have two neighbour commands one, one, two and remote as four one. Now I need to configure one more command. What is that? There is router one to two neighborship and router one to four neighborship. I’ll need to point the neighbouring router to this one. So I’m going to say that neighbour two, route two remote S, is 500 done. The same thing I need to do on the router three also. On the router, I’m going to say router BGP 500 neighbour 1, and the remote S is 500. So I’m going to configure the neighborship between these two addresses, this address and this address which means between router one and router three, after some time you should see the neighborship message comes up. The BGP process is significantly slower. So you have to wait for the neighbourhood to come up.
As you can see, the neighbouring appears. So now, if I verify the Show IP BGP summary, router one is also forming, and router three is also forming a neighbourhood with one, which is my router one. Okay, now if I verify “Show IP” now on the router, you should see the route coming, so it will take some time, but in the meantime, we’ll configure the other things as well. But, in the meantime, let me configure the same thing between neighbours routers 2 and 4. There is one more thing to consider when configuring BGP neighbours within the network: if they are not directly connected. So if you’re using this address on the routerfour, again, you have to use this address in reverse, or if you’re using this address now, you have to use this address, which means you have to use the same direction addresses to form a neighborship because you cannot reuse like this. As an example, I’ll use this address on the router to confirm the neighborship, and router four is forming the neighbourhood with this address. So you can see the direction will change here because now the router will try to reach this neighbour from this side, and this will be the default source address. As a result, the neighbors’ source addresses will no longer match, and the neighbourly relationship will be dissolved. So, when forming a neighborhood, make sure that the addresses are on the same side, in the same direction, or these two addresses. This is an important point to remember when establishing a neighbour relationship with routers that are not directly connected. So, for example, on router two, I’ll use three to the desired address: three, three, two, and remote is 500; and on router four, BGP 500, and then neighbours two, two, one, and remote are 500. Done. Okay, so on routers two and four, I did the same thing. So now we have four routers because each router has three neighbors. As a result, every router in the Ace should be a neighbour of every other router. So now, if I verify the neighbour message, I’m expecting the neighbourhood to come up.
On the router 4, if I give you the IPGPsummary, you can see the neighborship message has come up, and you can see all three neighbors, even though they are not identified. The neighbouring relationship is clearly established, and some of the routes are visible. And if I run Show IP route BGP on the routerfour, I should see two dual networks appear. So let us wait for some time. Meantime, I’ll check on the router one. On router 1, I can see a 30-dot network has come up, and if I check on router 3, I should see a 10-dot network. On the router 3, you can see the 10-dot network and the 11-dot network coming. And similarly, if I check on the router, I should see 20. So before we confirm there’s no 20 here, 20 is also there. Now, this is one important thing we need to keep in mind when you are doing the basic BGP configurations. The basic rule in BGP is that all routers within the AIS should form neighbours with each other. Now I’m talking about only same as we are not talking about external neighbors, we are talking about only internal neighbors. Either you have to form a full mesh neighbour relationship, which we used this time, or we can have an alternate solution called route reflectors, which is more efficient and better when it comes to large networks. So we’ll see more in detail about route reflections in our next videos.