Static Routing - MCST-CS

Download Report

Transcript Static Routing - MCST-CS

Static Routing
Routing Protocols and
Concepts – Chapter 2
Sandra Coleman, CCNA, CCAI
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
1
Interfaces
 Examining Router Interfaces
-Show IP route– used to view routing table
-Show Interfaces command – used to show status of an
interface and details about it
-Show IP Interface brief command – BEST ONE to use to
quickly find the status of interfaces and IP addresses!
-Show running-config command – used to show configuration
file in RAM (can be show run)
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
2
Interfaces
 Configuring an Ethernet interface
-By default all serial and Ethernet interfaces are down
-To enable an interface use the No Shutdown command
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
3
Interfaces
 Verifying Ethernet interface
-Show interface fastEthernet 0/0 – command used to show
status of fast Ethernet
port
-Show ip interface brief – see status of lines and IP addresses
-Show running-config
 Ethernet interfaces participate in ARP
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
4
Interfaces
 Configuring a Serial interface
-Enter interface configuration mode
-Enter in the ip address and subnet mask
-Enter in the no shutdown command
 Example:
-R1(config)#interface serial 0/0
-R1(config-if)#ip address 172.16.2.1 255.255.255.0
-R1(config-if)#no shutdown
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
5
Routing Tables
 The main purpose of a routing table is to provide the
router with paths to different destination networks.
 Remember, routers need to know how to get to the
NETWORK the packet is on.
 It is the switch’s job to get to the exact IP address!
 To remove a directly connected network from a router,
use these two commands: shutdown and no ip
address.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
6
Debug commands
 Purpose of the debug ip routing command
Allows you to view changes that the router performs when
adding or removing routes
Example:
-R2#debug ip routing
-IP routing debugging is on
 Debug commands, especially the debug all command,
should be used sparingly. These commands can
disrupt router operations.
 Debug commands are useful when configuring or
troubleshooting a network; however, they can make
intensive use of CPU and memory resources.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
7
Routing Table
 When a router only has its interfaces configured & no
other routing protocols are configured then:
-The routing table contains only the directly connected networks
-Only devices on the directly connected networks are reachable
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
8
Routing Table
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
9
Reading routing tables (pg. 97-example)
 the address must match the number of left-most bits of
the network address as indicated by the prefix of the
route. For R2, all the routes have a /24 prefix, therefore,
the left-most 24 bits are checked for each route.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
10
Routing Table and CDP Protocol
 Checking each
route in turn
The ping
command is
used to check
end to end
connectivity
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
11
CDP – Cisco Discovery Protocol
 Cisco Discovery Protocol (CDP) is a powerful network
monitoring and troubleshooting tool.
 CDP is an information-gathering tool used by network
administrators to get information about directly connected
Cisco devices.
 CDP is a proprietary tool that enables you to access a
summary of protocol and address information about Cisco
devices that are directly connected.
 By default, each Cisco device sends periodic messages,
which are known as CDP advertisements, to directly
connected Cisco devices. These advertisements contain
information such as the types of devices that are connected,
the router interfaces they are connected to, the interfaces
used to make the connections, and the model numbers of the
devices.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
12
CDP Protocol
 Purpose of CDP
A layer 2 cisco proprietary tool used to gather information about
other directly connected Cisco devices.
 Concept of neighbors
-2 types of neighbors
Layer 3 neighbors
Layer 2 neighbors
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
13
Routing Table and CDP Protocol
 CDP show commands
Show cdp neighbors command
-Displays the following information:
Neighbor device ID
Local interface
Holdtime value, in seconds
Neighbor device capability code
Neighbor hardware platform
Neighbor remote port ID
Show cdp neighbors detail command
-Useful in determining if an IP address configuration error (I
have had to use this on the CCNA test several times to find
addresses to connecting devices that were not CLICKABLE)
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
14
Routing Table and CDP Protocol
 CDP starts up automatically and allows the device to
detect directly connected neighbors
 Devices can learn about each other REGARDLESS of
the routing protocol being used.
 Disabling CDP
To disable CDP globally use the following command
Router(config)#no cdp run
To stop CDP advertisements on a particular interface, use the
following command:
Router(config-if)#no cdp enable
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
15
Learning routes
 Static
Manually configured by network admin
 Dynamic
From a dynamic routing protocol (from a neighbor)
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
16
Static Routes
 Purpose of a static route
A manually configured route used when routing from a network
to a stub network (network accessed by a single route)
Only one way out of R1 for sending non-local traffic, so it would
be a waste of resources to run a routing protocol between R1
and R2 – set up a static route on R2 to the LAN on R1.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
17
Static Routes
 IP route command
To configure a static route use the following command: ip route
Example:
-Router(config)# ip route network-address subnet-mask {ipaddress | exit-interface }
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
18
Static Routes
 Dissecting static route syntax
ip route - Static route command
172.16.1.0 – Destination network address
255.255.255.0 - Subnet mask of destination network
172.16.2.2 - Serial 0/0/0 interface IP address on R2, which is
the "next-hop" to this network
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
19
Static Routes
 Configuring routes to 2 or more remote networks
 (on test…choose correct command)
Use the following commands for R1
-R1(config)#ip route 192.168.1.0 255.255.255.0 172.16.2.2
-R1(config)#ip route 192.168.2.0 255.255.255.0 172.16.2.2
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
20
Static routes
Referring to the graphic, you can see that static routes
have an administrative distance of 1 and a metric of 0
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
21
Static Routes
 Zinin’s 3 routing principles
Principle 1: "Every router makes its decision alone, based on
the information it has in its own routing table.“
Principle 2: "The fact that one router has certain information in
its routing table does not mean that other routers have the same
information.“
Principle 3: "Routing information about a path from one
network to another does not provide routing information about
the reverse, or return path."
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
22
Static Routes with Exit Interfaces

Using Zinin’s 3 routing principles, how would you
answer the following?
-Would packets from PC1 reach their destination?
Yes, packets destined for 172.16.1.0/24 and 192.168.1.0/24
networks would reach their destination.
-Does this mean that any packets from these networks destined
for 172.16.3.0/24 network will reach their destination?
No, because neither R2 nor R3 router has a route to the
172.16.3.0/24 network.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
23
Static Routes with Exit Interfaces
 Configuring a Static route with an Exit Interface
-Static routes configured with an exit interface are more efficient
because the routing table can resolve the exit interface in a
single search instead of 2 searches NO RECURSIVE
LOOKUPS REQUIRED!
-Example of syntax require to configure a static route with an
exit interface
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
24
Resolving an exit interface
 What if an interface goes down?
 If the static route can NOT be resolved, it is REMOVED
from the routing table!
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
25
Static routes
 Find this line in the routing table:
S 192.168.2.0/24 is directly connected, Serial0/0/0
 Now, when the routing table process has a match for a packet and
this static route, it will be able to resolve the route to an exit
interface in a single lookup. As you can see in the figure, the other
two static routes still must be processed in two steps, resolving to
the same Serial 0/0/0 interface.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
26
Static Routes
 Modifying Static routes
Existing static routes cannot be modified. The old static route
must be deleted by placing no in front of the ip route
Example:
-no ip route 192.168.2.0 255.255.255.0 172.16.2.2
A new static route must be rewritten in the configuration
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
27
When to alter routes!
 A network admin might need to alter a static route if
A destination network no longer exists
Next-hop address or exit interface becomes inaccessible
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
28
Static Routes with Exit Interfaces
 Verifying the Static Route Configuration
-Use the following commands
Step 1 show running-config
Step 2 verify static route has been entered correctly
Step 3 show ip route
Step 4 verify route was configured in routing table
Step 5 issue ping command to verify packets can reach
destination and that Return path is working
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
29
Static Routes with Exit Interfaces
 Ethernet interfaces and ARP.
– If a static route is configured on an Ethernet link
-If the packet is sent to the next-hop router then…
the destination MAC address will be the
address of the next hop’s Ethernet interface
A router CANNOT determine the next-hop MAC
address for a frame without a next-hop address on
the Static route
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
30
Solution to Ethernet interfaces
 Is there any way to configure a static route over an Ethernet
network so that it does not have to use the recursive lookup of the
next-hop IP address? Yes - this can be done by configuring the
static route to include both the exit interface and the next-hop IP
address.
 As you can see in the previous figure, the exit interface would be
FastEthernet 0/1 and the next-hop IP address would be
172.16.2.2.
 R1(config)#ip route 192.168.2.0 255.255.255.0 fastethernet 0/1
172.16.2.2
 The routing table entry for this route would be:
 S 192.168.2.0/24 [1/0] via 172.16.2.2 FastEthernet0/1
 The routing table process will only need to perform a single lookup
to get both the exit interface and the next-hop IP address.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
31
Summary and Default Route
 Summarizing routes reduces the size of the routing
table.
 Route summarization is the process of combining a
number of static routes into a single static route.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
32
Calculating Summary routes (on test!)
 1. Write out the networks that you want to summarize in
binary.
 2. To find the subnet mask for summarization, start with the
left-most bit.
 3. Work your way to the right, finding all the bits that match
consecutively.
 4. When you find a column of bits that do not match, stop.
You are at the summary boundary.
 5. Now, count the number of left-most matching bits, which
in our example is 22. This number becomes your subnet
mask for the summarized route, /22 or 255.255.252.0
 6. To find the network address for summarization, copy the
matching 22 bits and add all 0 bits to the end to make 32
bits.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
33
Summary and Default Route
 Configuring a summary route
You will have
Step 1: Delete the current static route
to do this on
Step 2: Configure the summary static route the Chapter
2 onlineTest!
Step 3: Verify the new static route
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
34
Summary and Default Route
 Default Static Route
This is a route that will match all packets. Stub routers that
have a number of static routes all exiting the same interface are
good candidates for a default route.
-Like route summarization this will help reduce the size of the
routing table
 Configuring a default static route (know this!)
Similar to configuring a static route. Except that destination IP
address and subnet mask are all zeros
Example:
-Router(config)#ip route 0.0.0.0 0.0.0.0 [exit-interface | ipaddress ]
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
35
Summary and Default Route
 Static routes and subnet masks
The routing table lookup process will use the most specific
match (the one with the MOST # of bits in common with the
packet – look at the CIDR notation to see which one is the
closest match – that’s what determines how many bits must
match) when comparing destination IP address and subnet
mask
 Default static routes and subnet masks
Since the subnet mask used on a default static route is 0.0.0.0
all packets will match.
Default routes are VERY COMMON. Instead of having to store
many routes for all the networks on the Internet, the can store a
single default route to represent ANY network not in the routing
table.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
36
Finding the BEST route in the routing table
 It is possible that the destination IP address of a packet will match multiple
routes in the routing table. For example, what if we had the following two
static routes in the routing table:
 172.16.0.0/24 is subnetted, 3 subnets
 S 172.16.1.0 is directly connected, Serial0/0/0 and
 S 172.16.0.0/16 is directly connected, Serial0/0/1
 Consider a packet with the destination IP address 172.16.1.10. This IP
address matches both routes.
 The routing table lookup process will use the most-specific match.
Because 24 bits match the 172.16.1.0/24 route, and only 16 bits of the
172.16.0.0/16 route match, the static route with the 24 bit match will be
used. This is the longest match.
 The packet will then be encapsulated in a Layer 2 frame and sent via the
Serial 0/0/0 interface. Remember, the subnet mask in the route entry is
what determines how many bits must match the packet's destination IP
address for this route to be a match.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
37
Static Routes and Packet Forwarding
 Packet forwarding
with static routes.
(recall Zinin’s 3
routing principles)
 Router 1
Packet arrives on R1’s
Fastethernet 0/0
interface
R1 does not have a
route to the
destination
network,
192.168.2.0/24
R1 uses the default
static route.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
38
Static Routes and Packet Forwarding
 Packet forwarding with static routes. (recall Zinin’s 3
routing principles)
 Router 2
The packet arrives on the Serial 0/0/0 interface on R2.
R2 has a static route to 192.168.2.0/24 out Serial0/0/1.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
39
Static Routes and Packet Forwarding
 Packet forwarding with static routes. (recall Zinin’s 3
routing principles)
 Router 3
The packet arrives on the Serial0/0/1 interface on R3.
R3 has a connected route to 192.168.2.0/24 out Fastethernet
0/1.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
40
Static Routes and Packet Forwarding
 Troubleshooting a Missing Route
 Tools that can be used to isolate routing problems
include:
-Ping– tests end to end connectivity
-Traceroute– used to discover all of the hops (routers) along the
path between 2 points
-Show IP route– used to display routing table & ascertain
forwarding process
-Show ip interface brief- used to show status of router interfaces
-Show cdp neighbors detail– used to gather configuration
information about directly connected neighbors
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
41
Static Routes and Packet Forwarding
 Solving a Missing Route
 Finding a missing or mis-configured route requires
methodically using the correct tools
-Start with PING. If ping fails then use traceroute to determine
where packets are failing to arrive
 Issue: show ip route to examine routing table.
-If there is a problem with a mis-configured static route remove
the static route then reconfigure the new static route
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
42
Static Routes and Packet Forwarding
 Solving a Missing Route
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
43
Static Routes and Packet Forwarding
 Solving a Missing Route
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
44
Ch. 2 is history, Now let’s have some fun in the labs!
•
Study Guide – Homework
•
Labs –
•
•
•
Pg. 86-91 – Calculating Summary Route Exercises Summary Route exercise #1,
2, 4, 5, 6
Lab 2-2, pg. 119 – we will subnet this FIRST in the lab today, then you can do it
on the actual equipment next class meeting.
Lab 2-1, page 98-119, do this on packet tracer, filename is LSG02-Lab281.pka
•
There are LOTS of packet tracer activities in the textbook and in the lab book… if you
don’t understand, for HEAVEN’s sake…use these. I wish we had time during class to
do EVERY ONE of them.. We just don’t. I highly recommend you use them.
•
Online test – Take the online test by Sunday, Jan 27, 2013 midnight!
•
Test – TBD – we’ll see how the labs go.
• For extra credit,
•
ITE PC v4.0
Chapter 1
Packet Tracer Skills Integration Challenge on page 134 in the lab book.
Do this on your own time. You can email me or show me the answer
100% complete. I will use this to take the place of another lab grade
that you may be missing (now or in the future!)
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
45