arp -a
Interface: 172.16.10.2 --- 0x3
Internet Address Physical Address Type
172.16.10.1 00-15-05-06-31-b0 dynamic
172.16.20.1 00-15-05-06-31-b0 dynamic
Did you notice that the hardware (MAC) address that Host_A uses to get
to Host_B is the Lab_A E0 interface? Hardware addresses are always
local, and they never pass through a router’s interface. Understanding
this process is as important as air to you, so carve this into your memory!
The Cisco Router Internal Process
One more thing before we get to testing your understanding of my 36
steps of IP routing. I think it’s important to explain how a router forwards
packets internally. For IP to look up a destination address in a routing
table on a router, processing in the router must take place, and if there
are tens of thousands of routes in that table, the amount of CPU time
would be enormous. It results in a potentially overwhelming amount of
overhead—think about a router at your ISP that has to calculate millions
of packets per second and even subnet to find the correct exit interface!
Even with the little network I’m using in this book, lots of processing
would need to be done if there were actual hosts connected and sending
data.
Cisco uses three types of packet-forwarding techniques.
Process switching This is actually how many people see routers to this
day, because it’s true that routers actually did perform this type of bare-
bones packet switching back in 1990 when Cisco released their very first
router. But those days when traffic demands were unimaginably light are
long gone—not in today’s networks! This process is now extremely
complex and involves looking up every destination in the routing table
and finding the exit interface for every packet. This is pretty much how I
just explained the process in my 36 steps. But even though what I wrote
was absolutely true in concept, the internal process requires much more
than packet-switching technology today because of the millions of
packets per second that must now be processed. So Cisco came up with
some other technologies to help with the “big process problem.”
Fast switching This solution was created to make the slow performance
of process switching faster and more efficient. Fast switching uses a cache
to store the most recently used destinations so that lookups are not
required for every packet. By caching the exit interface of the destination
device, as well as the layer 2 header, performance was dramatically
improved, but as our networks evolved with the need for even more
speed, Cisco created yet another technology!
Cisco Express Forwarding (CEF) This is Cisco’s newer creation, and
it’s the default packet-forwarding method used on all the latest Cisco
routers. CEF makes many different cache tables to help improve
performance and is change triggered, not packet triggered. Translated,
this means that when the network topology changes, the cache changes
along with it.
To see which packet switching method your router interface is
using, use the command
show ip interface
.
Testing Your IP Routing Understanding
Since understanding IP routing is super-important, it’s time for that little
test I talked about earlier on how well you’ve got the IP routing process
down so far. I’m going to do that by having you look at a couple of figures
and answer some very basic IP routing questions based upon them.
Figure 9.4
shows a LAN connected to RouterA that’s connected via a
WAN link to RouterB. RouterB has a LAN connected with an HTTP
server attached.
FIGURE 9.4
IP routing example 1
The critical information you want to obtain by looking at this figure is
exactly how IP routing will occur in this example. Let’s determine the
characteristics of a frame as it leaves HostA. Okay—we’ll cheat a bit. I’ll
give you the answer, but then you should go back over the figure and see
if you can answer example 2 without looking at my three-step answer!
1. The destination address of a frame from HostA would be the MAC
address of Router A’s Fa0/0 interface.
2. The destination address of a packet would be the IP address of the
HTTP server’s network interface card (NIC).
3. The destination port number in the segment header would be 80.
That was a pretty simple, straightforward scenario. One thing to
remember is that when multiple hosts are communicating to a server
using HTTP, they must all use a different source port number. The source
and destination IP addresses and port numbers are how the server keeps
the data separated at the Transport layer.
Let’s complicate matters by adding another device into the network and
then see if you can find the answers.
Figure 9.5
shows a network with
only one router but two switches.
FIGURE 9.5
IP routing example 2
The key thing to understand about the IP routing process in this scenario
is what happens when HostA sends data to the HTTPS server? Here’s
your answer:
1. The destination address of a frame from HostA would be the MAC
address of RouterA’s Fa0/0 interface.
2. The destination address of a packet is the IP address of the HTTPS
server’s network interface card (NIC).
3. The destination port number in the segment header will have a value
of 443.
Did you notice that the switches weren’t used as either a default gateway
or any other destination? That’s because switches have nothing to do with
routing. I wonder how many of you chose the switch as the default
gateway (destination) MAC address for HostA? If you did, don’t feel bad
—just take another look to see where you went wrong and why. It’s very
important to remember that the destination MAC address will always be
the router’s interface—if your packets are destined for outside the LAN,
as they were in these last two examples!
Before moving on into some of the more advanced aspects of IP routing,
let’s look at another issue. Take a look at the output of this router’s
routing table:
Corp#
sh ip route
[output cut]
R 192.168.215.0 [120/2] via 192.168.20.2, 00:00:23, Serial0/0
R 192.168.115.0 [120/1] via 192.168.20.2, 00:00:23, Serial0/0
R 192.168.30.0 [120/1] via 192.168.20.2, 00:00:23, Serial0/0
C 192.168.20.0 is directly connected, Serial0/0
L 192.168.20.1/32 is directly connected, Serial0/0
C 192.168.214.0 is directly connected, FastEthernet0/0
L 192.168.214.1/32 is directly connected, FastEthernet0/0
What do we see here? If I were to tell you that the corporate router
received an IP packet with a source IP address of 192.168.214.20 and a
destination address of 192.168.22.3, what do you think the Corp router
will do with this packet?
If you said, “The packet came in on the FastEthernet 0/0 interface, but
because the routing table doesn’t show a route to network 192.168.22.0
(or a default route), the router will discard the packet and send an ICMP
destination unreachable message back out to interface FastEthernet 0/0,”
you’re a genius! The reason that’s the correct answer is because that’s the
source LAN where the packet originated from.
Now, let’s check out the next figure and talk about the frames and packets
in detail. We’re not really going over anything new here; I’m just making
sure you totally, completely, thoroughly, fully understand basic IP
routing! It is the crux of this book, and the topic the exam objectives are
geared toward. It’s all about IP routing, which means you need to be all
over this stuff! We’ll use
Figure 9.6
for the next few scenarios.
FIGURE 9.6
Basic IP routing using MAC and IP addresses
Referring to
Figure 9.6
, here’s a list of all the answers to questions you
need inscribed in your brain:
1. In order to begin communicating with the Sales server, Host 4 sends
out an ARP request. How will the devices exhibited in the topology
respond to this request?
2. Host 4 has received an ARP reply. Host 4 will now build a packet, then
place this packet in the frame. What information will be placed in the
header of the packet that leaves Host 4 if Host 4 is going to
communicate to the Sales server?
3. The Lab_A router has received the packet and will send it out Fa0/0
onto the LAN toward the server. What will the frame have in the
header as the source and destination addresses?
4. Host 4 is displaying two web documents from the Sales server in two
browser windows at the same time. How did the data find its way to
the correct browser windows?
The following should probably be written in a teensy font and put upside
down in another part of the book so it would be really hard for you to
cheat and peek, but since I’m not that mean and you really need to have
this down, here are your answers in the same order that the scenarios
were just presented:
1. In order to begin communicating with the server, Host 4 sends out an
ARP request. How will the devices exhibited in the topology respond
to this request? Since MAC addresses must stay on the local network,
the Lab_B router will respond with the MAC address of the Fa0/0
interface and Host 4 will send all frames to the MAC address of the
Lab_B Fa0/0 interface when sending packets to the Sales server.
2. Host 4 has received an ARP reply. Host 4 will now build a packet, then
place this packet in the frame. What information will be placed in the
header of the packet that leaves Host 4 if Host 4 is going to
communicate to the Sales server? Since we’re now talking about
packets, not frames, the source address will be the IP address of Host
4 and the destination address will be the IP address of the Sales
server.
3. Finally, the Lab_A router has received the packet and will send it out
Fa0/0 onto the LAN toward the server. What will the frame have in
the header as the source and destination addresses? The source MAC
address will be the Lab_A router’s Fa0/0 interface, and the
destination MAC address will be the Sales server’s MAC address
because all MAC addresses must be local on the LAN.
4. Host 4 is displaying two web documents from the Sales server in two
different browser windows at the same time. How did the data find its
way to the correct browser windows? TCP port numbers are used to
direct the data to the correct application window.
Great! But we’re not quite done yet. I’ve got a few more questions for you
before you actually get to configure routing in a real network. Ready?
Figure 9.7
shows a basic network, and Host 4 needs to get email. Which
address will be placed in the destination address field of the frame when
it leaves Host 4?
FIGURE 9.7
Testing basic routing knowledge
The answer is that Host 4 will use the destination MAC address of the
Fa0/0 interface on the Lab_B router—you knew that, right? Look at
Figure 9.7
again: What if Host 4 needs to communicate with Host 1—not
the server, but with Host 1. Which OSI layer 3 source address will be
found in the packet header when it reaches Host 1?
Hopefully you’ve got this: At layer 3, the source IP address will be Host 4
and the destination address in the packet will be the IP address of Host 1.
Of course, the destination MAC address from Host 4 will always be the
Fa0/0 address of the Lab_B router, right? And since we have more than
one router, we’ll need a routing protocol that communicates between
both of them so that traffic can be forwarded in the right direction to
reach the network that Host 1 is connected to.
Okay—one more scenario and you’re on your way to being an IP routing
machine! Again, using
Figure 9.7
, Host 4 is transferring a file to the email
server connected to the Lab_A router. What would be the layer 2
destination address leaving Host 4? Yes, I’ve asked this question more
than once. But not this one: What will be the source MAC address when
the frame is received at the email server?
Hopefully, you answered that the layer 2 destination address leaving Host
4 is the MAC address of the Fa0/0 interface on the Lab_B router and that
the source layer 2 address that the email server will receive is the Fa0/0
interface of the Lab_A router.
If you did, you’re ready to discover how IP routing is handled in a larger
network environment!
Configuring IP Routing
It’s time to get serious and configure a real network.
Figure 9.8
shows
three routers: Corp, SF, and LA. Remember that, by default, these routers
only know about networks that are directly connected to them. I’ll
continue to use this figure and network throughout the rest of the
chapters in this book. As I progress through this book, I’ll add more
routers and switches as needed.
FIGURE 9.8
Configuring IP routing
As you might guess, I’ve got quite a nice collection of routers for us to
play with. But you don’t need a closet full of devices to perform most, if
not all, of the commands we’ll use in this book. You can get by nicely with
pretty much any router or even with a good router simulator.
Getting back to business, the Corp router has two serial interfaces, which
will provide a WAN connection to the SF and LA router and two Fast
Ethernet interfaces as well. The two remote routers have two serial
interfaces and two Fast Ethernet interfaces.
The first step for this project is to correctly configure each router with an
IP address on each interface. The following list shows the IP address
scheme I’m going to use to configure the network. After we go over how
the network is configured, I’ll cover how to configure IP routing. Pay
attention to the subnet masks—they’re important! The LANs all use a /24
mask, but the WANs are using a /30.
Corp
Serial 0/0: 172.16.10.1/30
Serial 0/1: 172.16.10.5/30
Fa0/0: 10.10.10.1/24
SF
S0/0/0: 172.16.10.2/30
Fa0/0: 192.168.10.1/24
LA
S0/0/0: 172.16.10.6/30
Fa0/0: 192.168.20.1/24
The router configuration is really a pretty straightforward process since
you just need to add IP addresses to your interfaces and then perform a
no shutdown
on those same interfaces. It gets a tad more complex later on,
but for right now, let’s configure the IP addresses in the network.
Corp Configuration
We need to configure three interfaces to configure the Corp router. And
configuring the hostnames of each router will make identification much
easier. While we’re at it, let’s set the interface descriptions, banner, and
router passwords too because it’s a really good idea to make a habit of
configuring these commands on every router!
To get started, I performed an
erase startup-config
on the router and
reloaded, so we’ll start in setup mode. I chose
no
when prompted to enter
setup mode, which will get us straight to the username prompt of the
console. I’m going to configure all my routers this same way.
Here’s how what I just did looks:
--- System Configuration Dialog ---
Would you like to enter the initial configuration dialog? [yes/no]:
n
Press RETURN to get started!
Router>
en
Router#
config t
Router(config)#
hostname Corp
Corp(config)#
enable secret GlobalNet
Corp(config)#
no ip domain-lookup
Corp(config)#
int f0/0
Corp(config-if)#
desc Connection to LAN BackBone
Corp(config-if)#
ip address 10.10.10.1 255.255.255.0
Corp(config-if)#
no shut
Corp(config-if)#
int s0/0
Corp(config-if)#
desc WAN connection to SF
Corp(config-if)#
ip address 172.16.10.1 255.255.255.252
Corp(config-if)#
no shut
Corp(config-if)#
int s0/1
Corp(config-if)#
desc WAN connection to LA
Corp(config-if)#
ip address 172.16.10.5 255.255.255.252
Corp(config-if)#
no shut
Corp(config-if)#
line con 0
Corp(config-line)#
password console
Corp(config-line)#
logging
Corp(config-line)#
logging sync
Corp(config-line)#
exit
Corp(config)#
line vty 0 ?
<1-181> Last Line number
Corp(config)#
line vty 0 181
Corp(config-line)#
password telnet
Corp(config-line)#
login
Corp(config-line)#
exit
Corp(config)#
banner motd # This is my Corp Router #
Corp(config)#
^Z
Corp#
copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
Corp# [OK]
Let’s talk about the configuration of the Corp router. First, I set the
hostname and enable secret, but what is that
no ip domain-lookup
command? That command stops the router from trying to resolve
hostnames, which is an annoying feature unless you’ve configured a host
table or DNS. Next, I configured the three interfaces with descriptions
and IP addresses and enabled them with the
no shutdown
command. The
console and VTY passwords came next, but what is that
logging sync
command under the console line? The logging synchronous command
stops console messages from writing over what you are typing in,
meaning it’s a sanity-saving command that you’ll come to love! Last, I set
my banner and then saved my configs.
If you’re having a hard time understanding this configuration
process, refer back to Chapter 6, “Cisco's Internetworking Operating
System (IOS).”
To view the IP routing tables created on a Cisco router, use the command
show ip route
. Here’s the command’s output:
Corp#
sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B
- BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS
level-2
ia - IS-IS inter area, * - candidate default, U - per-user
static route
o - ODR, P - periodic downloaded static route, H - NHRP, l -
LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 1 subnets
C 10.10.10.0 is directly connected, FastEthernet0/0
L 10.10.10.1/32 is directly connected, FastEthernet0/0
Corp#
It’s important to remember that only configured, directly connected
networks are going to show up in the routing table. So why is it that only
the FastEthernet 0/0 interface shows up in the table? No worries—that’s
just because you won’t see the serial interfaces come up until the other
side of the links are operational. As soon as we configure our SF and LA
routers, those interfaces should pop right up!
But did you notice the
C
on the left side of the output of the routing table?
When you see that there, it means that the network is directly connected.
The codes for each type of connection are listed at the top of the
show ip
route
command, along with their descriptions.
For brevity, the codes at the top of the output will be cut in
the rest of this chapter.
SF Configuration
Now we’re ready to configure the next router—SF. To make that happen
correctly, keep in mind that we have two interfaces to deal with: Serial
0/0/0 and FastEthernet 0/0. So let’s make sure we don’t forget to add
the hostname, passwords, interface descriptions, and banners to the
router configuration. As I did with the Corp router, I erased the
configuration and reloaded since this router had already been configured
before.
Here’s the configuration I used:
R1#
erase start
% Incomplete command.
R1#
erase startup-config
Erasing the nvram filesystem will remove all configuration files!
Continue? [confirm]
[enter]
[OK]
Erase of nvram: complete
R1#
reload
Proceed with reload? [confirm]
[enter]
[output cut]
%Error opening tftp://255.255.255.255/network-confg (Timed out)
%Error opening tftp://255.255.255.255/cisconet.cfg (Timed out)
--- System Configuration Dialog ---
Would you like to enter the initial configuration dialog? [yes/no]:
n
Before we move on, let’s talk about this output for a second. First, notice
that beginning with IOS 12.4, ISR routers will no longer take the
command
erase start
. The router has only one command after
erase
that starts with s, as shown here:
Router#
erase s?
startup-config
I know, you’d think that the IOS would continue to accept the command,
but nope—sorry! The second thing I want to point out is that the output
tells us the router is looking for a TFTP host to see if it can download a
configuration. When that fails, it goes straight into setup mode. This gives
you a great picture of the Cisco router default boot sequence we talked
about in Chapter 7, “Managing a Cisco Internetwork.”
Let’s get back to configuring our router:
Press RETURN to get started!
Router#
Dostları ilə paylaş: |