Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
With An ISP.
If you look at traditional BGP books, like if you go to Cisco Press and grab their book on
BGP, you'll find that there's gobs and gobs more concepts before they ever start touching the
configuration, which is wise because there is a lot to BGP. But a lot of times if you go at it that
way, it's just kind of boring. You get a lot of concepts, which you forget half of it before you
even start, and then by the time you get to the config, you're like, wait a sec. How did that
work? So I want to change that. I want to give you just a few more facts, my thought is five
minutes or less. Well, how many times have you done that? You're at a data center or
something. Your wife or husband calls and is like, hey, how much longer are you going to be?
You're like just five minutes. I just need five minutes, and I'm done. And three hours later. So it
won't be three hours, but nonetheless, I just want to talk about the facts-- it's funny, as I look
at it, I'm like BGP relationships, the facts. I feel like I'm talking to my 10-year-old son or
something. I'm like, son, there's something I need to tell you about BGP.
So moving down, we've got BGP packets and process, like how does a neighbor form?
And then I just want to go practical. I want to say, OK, let's bring up a connection to an ISP
using BGP. How do we do it? What does it mean? What are we going to expect, when we do
that, to receive? And just kind of talk about it a lot more practical and hands on than just
concepts.
network. So my router will say, router one. They think, oh, well, so I'm going to go out, I'm
going to say, hey, I know about the 150.1 network. No, no, no, no, no. That's not how it works.
That's, I would say, the toughest piece to get, is this does not actually control the actual
advertisement at all. What happens is the router looks around, identifies the interfaces. It
goes, oh look. Serial zero. It's 150.1. Great. I'm going to send hellos, try and form a neighbor
there. And second off, I'm going to advertise that network, meaning I'm looking at the
serial zero interface, looking at the IP address command, and the IP address
command says I've got 150.1.1.1/30, or 255.255.255.252 would be that subnet
mask. So it says, I'm going to advertise the 150.1.1.0/30 network. That's what gets
advertised, not 150.1.0.0.
In BGP, Neighbors Discover each other Manually.
Now, this is going to be relevant when it gets to BGP. So first off, neighbors never in
BGP discover each other. I have to manually config. So right there, let me change my pen a
little fatter. Does not send a hello. Does not say, hello, everyone. I want to form a neighbor,
because there is hello packet to BGP. Neighbors have to be manually set up.
next hop. Then I do a duplicate IP route. IP route 1.1.1.1, again, exactly the same destination,
and this time, go here. You would put the next hop one, and I'm just out of room-- next hop
two right there. So you would have two routes to the same 1.1.1.1 with BGP. Then you would
configure your neighbor at 1.1.1.1. You would say, hey, I want to peer with 1.1.1.1. So what
happens is Router One down here looks at its routing table, sees two equal cost
paths in its routing table to the same place, 1.1.1.1. It goes, oh, sweet. I can load
balance. So what you do is you end up load balancing over both of those links to reach and
form that BGP neighbor. There's a little more to it than that, but what I want to give you, just
at this-- I know that we're still. Good grief. I need a wireless headset, people. I keep stepping
on myself.
The reason I wanted to show this to you is I want you to see how BGP relies on the
foundation routing protocol, meaning I just plugged some static routes right there, but like I
said, that's kind of old school. You don't have to go that way. You could use OSPF to do the
same job for you a little easier, or EIGRP. BGP uses an internal routing protocol, or static
routes-- I'll put IGP right here-- in order to reach its neighbors and form BGP relationships kind
of on top of that. Does that make sense? This is such a huge concept. I'm going to be
repeating this again and again. The IGP lays the foundation. This is the road, right? Let me
take out these redundant links, and this is like the road to Rome. You've got there's this nice,
long road that's paved of [INAUDIBLE] and IGP. BGP doesn't even care about it. It's like, hey, I
just want to talk to 1.1.1.1. What you did was make a killer road by doing some load balancing
between some links, but BGP is just like, hey, I'm happy. Got a lot of bandwidth. I can peer
with 1.1.1.1.
So we will see that concept again and again and again all throughout, because I know
for me, when I got into BGP, I was like, huh? I know. You're looking at that going, why was that
confusing? That wasn't that bad. But you'll start seeing when we get to IBGP and things like
that, it starts getting a little wacky.
So one of the beautiful things about BGP's neighbor process is it's so amazingly simple.
There is a lot that can go wrong. I will say that. You'll be troubleshooting with BGP. But if you
know the process and you know where things get stuck, it's kind of like you'll know exactly
where to look. You'll be like, oh, it's not working. OK, I know what that is. So it's not like OSPF.
OSPF is a lot more complex.
1) BGP Packets
So here it is. Four packets BGP uses.
1.2) Update
Updates are just that. Hey, got some news for you. Here's an update. Here's a route
that just went up. Here's my routing table. Updates are pretty much everything else
that BGP sends that's of value.
1.4) Notifcation
And then we have notifications. Notifications, think of yourself in grade school, if
teacher was like, hey, Johnny, I've got a notification for you, that's usually a bad thing.
And with BGP, anytime you see a notification, it's bad. Something bad is
about to happen. It's about to tear down the session, something didn't match with a
neighbor. So if you're doing a debug and you see a notification, look there. That's where
the problem is. It's going to say something like, authentication mismatch, or peer and
wrong remote autonomous system, or something to that nature. That will be in the
notification. So that's it. That's the four packets that BGP uses.
2) BGP States
Now, the transition that BGP goes through when it's forming a neighbor process
is right on the right hand side, Idle Active, Open Sent, Open Confirm, and Establish. And
we'll be working through this more as we go.
2.1) Idle
Idle means I've got a neighbor configured, I haven't tried to talk to him that.
2.2) Active
Active means I'm trying to start the communication, and I'll leave it at that
because that's where a lot of bad things happen. Maybe I'm trying to start the
communication, but the other guy doesn't recognize me. Or I'm trying to start the
communication, but I don't know how to reach the neighbor's IP address that you've set
up. For example, let's say I said to peer with 1.1.1.1 over here, but I forgot to type in
these static routes. So Router One doesn't know how to reach 1.1.1.1. You might type in
neighbor 1.1.1.1 in BGP, it's like, yeah, I'm just kind of active. I'm active on that
neighbor. I want to form a neighbor relationship, but I don't know how to get there. So
you'll see the neighbor relationship go from Idle to Active, Idle to Active. It kind of
bounces back and forth.
GNS3 Introduction
So before we get going, I know some of you probably recognize the graphics that
I have on the screen here. This is my little simple BGP scenario. And I want to mention
that I am going to be using-- I have fallen in love with this little tool-- GNS3 for this
entire series. Let me give you the fly by commercial on GNS3, and I say commercial
loosely, because it's free. I'm not like, buy now. It's free. Go download it. Go to
gns3.net, that's our little URL right there. And GNS3 is made by a guy named Jeremy,
which immediately caused a bond between us. He's actually in France, though. And he
took something called Dynamips, which was an open source IOS emulator, that actually
boots real IOS image for Cisco. I'm talking the real software for Cisco, and allows you
essentially to trick it, to make it believe it's running on a router when it's really running
on a PC. Well, Dynamips was kind of a world changing thing for a lot of people that lived
in the Linux world. What Jeremy did is he created GNS3, which is a graphical front end
to Dynamips. Why can't I say that? The Q one, which allows you to do a lot of ASA, like
PIX ASA. You can actually emulate Junos. I don't know why you would want to do that,
but maybe you wanted to see, well, this is why I like Cisco better, than you might give
that a whirl. But this is really cool. Recently, it actually added VirtualBox, which hang
on, let me show you this screen shot here. So anyway, what Jeremy did is he created
this graphical front end for it where all you have to do is drag and drop the routers onto
the white pavement, and it automatically does all the Dynamips, Linuxy, text file
configuration for you from behind the scenes. So it makes it really easy to do this kind
of stuff. And I say really easy tongue in cheek, because there is a little bit of setup that
you're going to have to do. You'll have to learn a little bit about, for instance, idle PC
timers so it doesn't destroy your processor. Ironically, here's the funny thing. CBT
Nuggets and me created an absolutely free, excellent video called GNS3 Overview and
Operation which, if you're new to GNS3, if is your first time using it, check that out. It'll
save you a lot of pain. I'm just talking about how to get it set up and how to get going
on there. But one of the neat things, I was saying that they added Virtual Box, is-- let
me see if they have a picture of it. Well, this isn't it, I don't think, but you can actually
put a little PC on there. And now that they have Virtual Box, you can actually boot
Windows XP or Windows 7, if you're brave-- you can boot an actual operating system on
the PC within there. Or Linux. Throw Ubuntu on there to get a quick Linux system up
and running, to where you actually have real hosts that you can ping, you can run web
servers on. It's like building your own little world. So the GNS3 is so amazingly
excellent. The reason that I use it, the big reason, is because it is free, and it allows you
to do the same things that I'm doing. There's been series I've created for CBT Nuggets.
I just finished CCNA Lab, Cisco for the Real World, where I used GNS3 and just built a
ton of lab scenarios, and I'm planning on doing the same thing for BGP. So I'm going to
make available all of my topology files. So this, by the way, is the topology file that
matches the screenshot that you see. So that you're able to walk through exactly the
same stuff that I am, just by downloading the topology files and plugging it into your
GNS3.
So that all being said, let me give you a quick description, then we'll get into the config. What
we've got is we've got Router One. Let me grab a pen here. Down here, this is you, and you're
Autonomous System 500.
So with that being said, we're just using 500 for fun. We have our autonomous system
down here, 500. We would like to peer with both ISPs. We've got ISP1. And by the way, I just
put some junk networks in there so that we could receive some routes. 151.x.x.x, those routes
are all originating from ISP1's autonomous system. We've got 152.x.x.x, which all originate
from ISP2. And then I've got these guys, which originate from some other autonomous
system, 153.1.1.0, and 153.2.2.0. Now truth be told, I'm actually originating both of these
from both autonomous systems. There's no mystical link behind the scenes linking these guys
or anything like that. What I want you to see is how a router handles it when he gets two
routes to the same destination. For instance, ISP1 is going to say, hey, I know about 153.1.1.0.
This guy's going to say the same thing. Now the question will be, which one's Router One
going to choose, and why would it choose that way, and can we influence that choice? All
those kind of things, because that's really going to lead us into where we're going with BGP.
So let's get started. Let me bring up my terminal here. Router One. So I've got Router One
configured right here. Let me just get you oriented. I'm going to do a Show IP Interface brief.
And right here, you can see that I've got serial zero. That's actually a connection to ISP1.
Serial 0/1, that's the connection to ISP2. And then I've got fast ethernet zero, which is my
connection to that 200.x.x.x network down here, the 200.1.1.0 network. So very, very simple
topology. I'm going to do-- again, this is starting off really basic-- Show IP Protocols, just to
show there are no routing protocols running at all, including BGP. So if I'm ready to set up BGP,
here's what I do. I'm going to go into Global Config and type in Router BGP, followed by my
autonomous system number. Now, that would be documented somewhere. The ISPs would we
give it to you because they need to type that in. When they're setting up their manual
neighbor relationship to you, they're going to need to know what your autonomous system is.
So chances are, they'll give it to you if you're using a private autonomous system. So I'm
going to say 500 in this case. From there, I'm going to go in and show you-- well, I'll hit the
question mark and you can see, this is a decent amount of commands underneath here, but
not that many. Almost every command that you type under the BGP process starts with the
word, "neighbor." You can see that right here. Now, you're used to neighbors, maybe from
OSPF and all that, but look at this. I'm going to hit the question mark here. Hang on, let me
just type something in there, hit the question mark here. Look at this. Oh yeah, just
completely dwarfs the amount of commands that even the Route BGP process has. Almost
everything starts with the word "neighbor." So the first one you always have to type-- and
usually in Cisco, the commands aren't order specific, but usually the first one that you'll type
is neighbor remote AS. Wait a sec, did I say-- no, always. Always the one that you have to type
first with BGP is neighbor remote AS. So I'm going to type in neighbor-- let me hit the question
mark because a little out of order here. Neighbor, and I type in their address. And I look, OK,
ISP1 is 150.1.1.1. That would also have to be documented, and I'd have to know that they
were coming from that. Because for instance, if they were using a loop back, maybe we had
that little scenario that I just showed you. I would need to know that they're coming from that
address. The neighbor IP has to match exactly what they're sending me. So I'm going to go in
and type in neighbor 150.1.1.1, and again, there's our laundry list of commands. The first one
that you must type, and then everything else can be whatever order, we'll do Remote AS, and
then it says, what is the remote autonomous system number? So I'm going to type in, in this
case, 1.1.1. Type that in. We now have a neighbor. Now, I'm going to jump out and do a Show
IP BGP Summary. This is, I would say, the number-- man, I missed it. You can see right there,
right before I hit the Enter key, it says BGP neighbor is up. This command, I would say, is the
MVP command of everything BGP. It gives you some stuff up here, it's like, yeah, yeah, yeah,
yadda, yadda. Ignore that. This is it. You want this. This is kind of like the Show IP Interface
Brief of BGP to where I'm going, OK, I've got a neighbor right here. Here's the remote
autonomous system. You can say, well, it's BGP Version Four. Everybody uses BGP Version
Four. Remote Autonomous System right here. This how many messages sent, received. This
right here is the big one. What is the current state? What you want to see here is a number.
State is the ones that I just showed you a moment ago, the Idle, the Active, the Open Sent,
Open Confirm, the Establish, all of these guys right here. The only reason that you would see
one of those states right here is actually one of two reasons. One, you're either really fast, like
you're sitting here doing Show IP BGP Summary with your up arrow again and again and again
to see it go through those states, or most commonly, something's wrong. If you go in and you
see State Idle-- let me show you right here. I'll Do Router BGP 500. By the way, once you go
into an autonomous system, you can't change that. It's going to say, whoa, sorry. BGP is
already in Autonomous System 500. You need to destroy the whole process before you go into
another autonomous system. So the router is a part of one autonomous system. It's not like
OSPF with the multi-area where you can kind of have one arm in each area. It's one
autonomous system for the whole router. So I'm going to go under here and type in neighbor,
let's just do 150.1.1.90, Remote AS, we'll just say 600, hit the Enter key. Do a Show IP BGP
Summary. And right there, now you can see, this is what I wanted to show you. Right here, it's
saying Idle. The neighbor is just kind of stuck on Idle. And it's going to say there. It's never
even going to go active. I'm hitting the up arrow, just to see if anything changes. Never going
to go Active because what it's saying is, I don't know how to get to that guy. Let me do a Show
IP Route right there, and I'm looking right here. I've got no routes to the 150.1.1.90 network.
I've got 150.1.0.0/30, I've got some little subnets right there, but nothing that will be able to
reach 90. So it's just going to sit there in Idle, and that's where you would see the word there,
and that's where it's showing the state. What you want to see is that number, which is the
number of prefixes you've received from that neighbor. Now in this case, it says I have
received six prefixes. Want to count them? One, two, three, four, five, six. That's literally the
number of routes that you've received from that neighbor. Now, they've all shown up here in
the routing table as BGP routes that we're able to see. I'm getting a little ahead of myself, but
for now, let's just know, OK, I've now formed a neighbor. He's sent me some routes. Let me go
back into the router, BGP 500. I'm going to first off, remove that bogus neighbor, get him out
of there, and also assign a description. Let's hit the up arrow a couple times, go back here. I
have that neighbor, 150.1.1.1. One of the things that I can type in there is description
because as you configure BGP on your router, you're going to start getting more neighbors
most likely, and you're going to want to be able to see real quick with a Show Run what this
guy is. So I'll say ISP1, and now that's added to the neighbor. And again, you're just going to
go down, down, down, typing in all kinds of different things associated with your neighbor.
Now, one of the things that you probably won't want to do-- we're going to see going
throughout this series, adding next hop self, maximum prefix, all these different criteria to the
neighbor. Let's say you want to take a neighbor down for testing. What you don't want to do is
type that in. No Neighbor 150.1.1.1. Because as you do that, what happens? All of the config,
you might have 12 different lines of a commands applied to that neighbor, and they're just
blown away out of the configuration, and now you've got to type them all back in there again.
So instead, what Cisco allows you to do is do a neighbor such and such shut down. So at that
point, let me do a Show Run Section Router BGP. Now I can see that the neighbor's config is
saved, everything I've typed about that neighbor, but it's shut down. So you can see it's now
gone into an Admin Down state. So that's kind of fun that you're able to see that. Now, looking
at the time, I've got to jump into another Nugget here, but last thing I want to show you is just
how the neighbors form. Let's do a Do Debug IP BGP, let's go All. We'll just kind of toss it all
out there. And I'm going to go out there and do a No Neighbor Shut Down, and that way, we're
able to see this neighbor form. So check it out. We've got immediately right here, went from
Idle to Active. That tells us that the router thinks it knows how to reach this next hop address,
the neighbor it's trying to form with. So it says, OK, I went Active, I'm talking to him from my
local address. Then I went from Active to Open Sent. Remember, that was one of the packets
that we saw. Open Sent, I sent my Open to him. So sending Open, my Version Four, here's my
autonomous system. Here's my Hold Time. Hold Time is how long you think until the other
neighbor's considered dead, meaning I need to hear something from you within 180 seconds
before I consider you dead. So you sent some messages, and then it says, wait a sec. I
received an Open. So he sent an Open back to me. He's running Version Four. His Hold Time is
180 seconds. Great, we can talk. Let's do this. Let's send some capabilities, start sending
some route refresh parameters-- which again, I'll save that until later-- which pretty much says
I don't have to destroy the neighbor to receive the routes, and they just kind of exchange all
their capabilities. Then they finally say, OK, Open Sent to Open Confirm. We're good after
we've sent all our open messages, I've received everything from them, and now we move
over to an established state. And right after that, you see the neighbor go up. Now, in a
production environment, that can take some time. For instance, if you're preparing for the
CCIE, it can take 30, 60 seconds from the moment that you type in the neighbor command
before the neighbor completely forms. And I say that because I've gone to the CCIE a couple
times, and I know how nerve wracking it is. You type in the neighbor statement, and you're
sitting here, and the seconds on the clock are like [TICKING NOISE], and you're like, [GASP],
something's wrong. It's not forming. And you're going into action, removing commands, and
all the time, it's kind of like, if you just grab the paper bag, breathe, [PANTS], and wait 30 to
60 seconds, you're going to be good. The neighbor's going to form and you're going to have
success. So that's the foundation. Let me stop there. I know we just kind of got started in the
config, but that's a good stopping point just with the connection to ISP1. In the next Nugget,
we'll bring up that connection to ISP2. I'm really saving that one because once we go there,
it's going to bring up a whole lot more discussion points, and BGP topology table and all of
that. So for now, we've talked about the BGP relationship, the facts of how it forms, looked at
the packets it sends. It's where you've got the Open message, the Keep Alive message, the
Update and the Notification message. And then the process it goes through when it forms, we
actually saw that happen before our eyes in the debug. And then I'll say we got a quarter way
through configuring what I would call core BGP process. So for now, I hope this has been
informative for you, and I'd like to thank you for viewing.