Join Chris Bryant for an in-depth discussion in this video iBGP peering and loopback interfaces, part of Cisco BGP Essential Training.
- Time to move on to our first internal BGP peering, we're going to build that between routers one and two, router two down there 126.96.36.199, and first off though, I hate to start a video with a mistake, (laughing) I'm making this one on purpose, so it doesn't count. Router BGP 100, what happens, lets say if you're just typing right away and, you try to make yourself, the neighbor? Think that's going to work? What do you think is going to happen with that command? It's not going to work, cause you can't make yourself the BGP neighbor.
You'd be peering to yourself, and there's just something terribly wrong with that. Not to mention illegal here, you're going to get a message that says can't configure the local system as the neighbor. So if you get that, you know, it freaks you out the first time, like any error message the first time, it's like, huh? And it just means that you put your own local IP address in, or one of your local IP addresses in. Now, lets try 123.2 there instead... Instead... (laughing) there we go, I knew I had it in me. And then on router two we haven't done any BGP config at all, slowly move that back up.
Today we'll start with router BGP 100, and neighbor 188.8.131.52, and our required statement about the remote-as, and we'll give that a few seconds to cook, and see what happens, usually just as I leave it, it ends up coming up. There we go, so it didn't take long at all, there's our adjacency change, your neighbor is up, 184.108.40.206. Now, we know one command to see our neighbor information, let's try it on router two, show...
IP BGP neighbor. We know that we can filter this, by specifying the IP address of the neighbor, but we also know right now router two only has one neighbor, so there's no reason to do that. We know to look for the BGP state of establish, we see that, we love that, this also shows you how long the adjacency of the peering has actually been up, what the remote read is etc. But wouldn't it be nice if we had a command that just gave you, just really what you needed to get started, or double check your config. Without going say through, oh I don't know the five screens of information that I'm showing you right now.
Most of which you really don't need at this point. And there is such a command, you'll be using this one much more often than you use the neighbor command, but it's a good idea to know both, and that is show IP BGP summary. And this is a great command, now I've got a little hanging off because I make the font as large as I can, to make it easy for everyone to see. The only thing hanging off there is a state of zero, and what we're really interested in, frankly, is the neighborhood, and the as, and the up down values.
A couple of these, were just not concerned with right now. But you can see, 220.127.116.11, and actually then you go over it's as 100, we see it's V 4 for version four BGP, and it's going to show you, how long it's been up or down. And we're up to a minute and a half, you also see message received, message received there, incremented message sent and yep, but those are our hellos. And if we go up to router one, run the exact same command, that's going to give you the same kind of information, and you can see here, State/PfxRcd all on one line, not sure why it's on two lines in the other one.
But this works out for us, it shows you, first off your local router BGP read, which is 18.104.22.168, shows you the local as number, and what we really like, is from left to right gives you your neighbors, the version of BGP you're running, the as they're in, you can see messages received, and messages sent coming in, and hopefully continuing to increment. And you'll also see that up down value, hopefully just keep ticking while it's up. That's all there is to an IBGP adjacency. And right now, we're going to start on using our loopbacks for BGP adjacencies.
Now so far we haven't done that, but here's why we usually do, in production networks. And why we'll actually change it, to be using a couple of adjacencies in our lab. Now, there's nothing necessarily wrong, with using physical interfaces to create BGP adjacencies. But in production networks, and in labs you're more likely to use IP addresses from loopbacks, because physical interfaces can go down for a number of reasons but the only way a logical interface really goes down, is if someone intentionally deletes it, or the entire router is unavailable, in that case you have much bigger problems than lost adjacencies.
Now if you use loopbacks, you've got to include a couple of extra commands. And this is one of those thing that catches you, that you don't want to catch on exam day. It's not going to, because you'll know first off, it's an off little BGP role. Loopback interfaces aren't considered directly connected, even if they share a common subnet. You'll need the eBGP multihop command when configuring eBGP adjacencies with addresses that are not on the same subnet. So you'll need that any time you're using loopbacks.
And when these addresses are in loopback interfaces, as they will be in this lab, and the next one. You'll also need the updates source loopback command. And we'll see that, and what it's actually asking for is the interface that your using for your update sources, and that would be, loopback zero, whatever you happen to number it. Now, there's a couple of roles to remember for loopback, using loopbacks for BGP, but there is one more, and this is so fundamental, that its really easy to overlook, so we're not going to do that.
If you use loopback addresses for eBGP adjacencies, particularly in a simpler lab like we're doing right now. You probably need to configure a static route on each one of your routers that points to the remote routers loopback. Because if your local router doesn't have an IP route, and doesn't know how to get to the address specified by neighbor, I mean, you know, your stuck before you begin. We've got an eBGP adjacency in progress here on the board between a couple of routers. I've got neighbor 22.214.171.124 remote-as 200 on the one on the left, and that router's basically saying that's fine, but how the heck do I get to 126.96.36.199, what do I do? And, we're going to see all of these concepts in action, in our next lab, where we create an adjacency between one and three, using their respective loopback interfaces.
Now I say here in the book, that the previous BGP configurations have been removed, I want to do that here alive. It's not hard to do, but I do want to remind you of a quick way to get that done. So we're going to go under router BGP 100, and what I want to do, I'm going to go up till I see my three. I might not still have that one. Okay, I don't, that's fine, let me go in here and just change that to three. And what you can do with this kind of command is just do a control A move the cursor to the front, and type no.
I'm not huge on keyboard shortcuts, its not something I do a lot of, but I really like control A. Because if you just go through your history with page up, and page down, you see a command you want to negate. Then you just stop right there, do a control A cursor moves to the front of the line, just type the word no, put in a space, and you're good. Now what I will do, and of course we're going to get an adjacency chain saying hey, you know that adjacency you just deleted you don't have that anymore. Let's go up to router three... router BGP 200, and I could've just taken BGP off of this, I could've done a no router BGP 200.
But instead ill call that command up, control A, moves the cursor to the front of the line. Type no hit the space barm and your gold. That's all there is to it. During the break between videos, what ill do is create a loopback on routers one and three, 188.8.131.52 and 184.108.40.206, as you'd expect at this point in the course. And then we'll create an adjacency using those loopbacks instead of the physical interfaces we used in the previous video, see you there.
- External BGP peering
- Advertising routes with the network command
- iBGP and eBGP peering and loopback instances
- BGP best path selection process
- Synchronization rules and the full mesh
- Route reflectors