ccna2 ch 2 cdp static route tonychen

65
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public ITE PC v4.0 Chapter 1 1 Static Routing Routing Protocols and Concepts – Chapter 2 Modified by Tony Chen 10/28/2008

Upload: matthewmccormick

Post on 08-Nov-2015

240 views

Category:

Documents


0 download

DESCRIPTION

uhv

TRANSCRIPT

Static RoutingCisco Public
*
Modified by Tony Chen
*
Cisco Public
Notes:
If you see any mistake on my PowerPoint slides or if you have any questions about the materials, please feel free to email me at [email protected] .
Thanks!
*
Cisco Public
Describe the directly connected networks, different router interfaces
Examine directly connected networks in the routing table and use the CDP protocol
Describe static routes with exit interfaces
Describe summary and default route
Examine how packets get forwarded when using static routes
Identify how to manage and troubleshoot static routes
*
*
Cisco Public
Functions of a Router
Routers perform packet forwarding by learning about remote networks and maintaining routing information.
The routers primary forwarding decision is based on Layer 3 information, the destination IP address.
The router's routing table is used to find the best match between the destination IP of a packet and a network address in the routing table.
*
*
Cisco Public
Introducing the Topology
3 1800 series routers connected via WAN links
*
*
Cisco Public
Connections of a Router for WAN
-A router has a DB-60 port that can support 5 different cabling standards
Newer routers support the smart serial interface that allows for more data to be forwarded across fewer cable pins.
Connections of a Router for Ethernet
-2 types of connectors can be used: Straight through and Cross-over
Straight through used to connect:
-Switch-to-Router, Switch-to-PC, Hub-to-PC, Hub-to-Server
Cross-over used to connect (pin 1 connected to pin 3, and pin 2 connected to pin 6):
-Switch-to-Switch, PC-to-PC, Switch-to-Hub, Hub-to-Hub, Router-to-Router, PC-Router
*
*
Cisco Public
Smart Serial cables: DCE and DTE
-Use straight cable to connect between the DTE and DCE..
Ethernet cables:
*
Cisco Public
Serial Connectors
DTE
DCE
DTE
DTE
In our labs we will use serial DTE/DCE cables (no CSU/DSU) with a DTE cable connected to one router and a DCE cable connected to the other router.
DCE
DCE
*
Cisco Public
-Show Interfaces command – used to show status of an interface
-Show IP Interface brief command – used to show a portion of the interface information on a condensed format
*
*
Cisco Public
-By default all serial and Ethernet interfaces are down
-To enable an interface use the No Shutdown command
The show ip route command is used to display the routing table.
Initially, the routing table is empty if no interfaces have been configured.
*
*
Cisco Public
Verifying Ethernet interface
- Show interfaces - command shows the status and gives a detailed description for all interfaces on the router
Show interfaces fastEthernet 0/0 – command used to show status of fast Ethernet port
R1#show interfaces fastethernet 0/0
FastEthernet0/0 is administratively down, line protocol is down
Administratively down means that the interface is currently in the shutdown mode, or turned off.
Line protocol is down means, in this case, that the interface is not receiving a carrier signal from a switch or the hub. This condition may also be due to the fact that the interface is in shutdown mode
*
*
Cisco Public
Show run –
command displays the current configuration file that the router is using. Configuration commands are temporarily stored in the running configuration file and implemented immediately by the router.
However, using show running-config is not necessarily the best way to verify interface configurations.
Show ip interface brief –
*
*
Cisco Public
Configuring an Ethernet interface
By default, all router interfaces are shutdown. To enable this interface, use the no shutdown command, which changes the interface from administratively down to up.
R1(config)#interface fastethernet 0/0
R1(config-if)#no shutdown
*Mar 1 01:16:08.212: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 1 01:16:09.214: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
The first changed state to up message indicates that, physically, the connection is good. If you do not get this first message, be sure that the interface is properly connected to a carrier signal from switch or a hub.
The second changed state to up message indicates that the Data Link layer is operational.
*
*
Cisco Public
The IOS often sends unsolicited messages.
As you can see in the figure, sometimes these messages will occur when you are in the middle of typing a command, such as configuring a description for the interface.
The IOS message does not affect the command, but it can cause you to lose your place when typing.
*
*
Cisco Public
-Show interfaces fastEthernet 0/0
Reading the Routing Table
Now look at routing table shown in the figure. Notice R1 now has a "directly connected" FastEthernet 0/0 interface a new network.
The interface was configured with the 172.16.3.1/24 IP address which makes it a member of the 172.16.3.0/24 network.
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.3.0 is directly connected, FastEthernet0/0
*
*
Cisco Public
172.16.0.0/24 is subnetted, 1 subnets
Having a single route represent an entire network of host IP addresses makes the routing table smaller, with fewer routes, which results in faster routing table lookups.
It means that this route matches all packets with a destination address belonging to this network.
*
*
Cisco Public
show interfaces fastethernet 0/0
show ip interface brief
The show interfaces fastethernet 0/0 command in the figure now shows
The interface is up, and the line protocol is up. The no shutdown command changed the interface from administratively down to up.
Notice that the IP address is now displayed.
The command show ip interface brief in the figure shows that the interface is up, and the line protocol is up. (in a condensed format)
Typically, the router's Ethernet or FastEthernet interface will be the default gateway IP address for any devices on that LAN.
For example, PC1 would be configured with a IP address belonging to the 172.16.3.0/24 network, with the default gateway IP address 172.16.3.1.
172.16.3.1 is router R1's FastEthernet IP address.
*
*
Cisco Public
Ethernet Interfaces Participate in ARP
A router's Ethernet interface participates in a LAN network just like any other device on that network.
This means that these interfaces have a Layer 2 MAC address, as shown in the figure. The show interfaces command displays the MAC address for the Ethernet interfaces.
*
*
Cisco Public
-Enter in the no shutdown command
Example:
-R1(config-if)#no shutdown
*
Cisco Public
R1(config-if)#no shutdown
R2(config-if)#no shutdown
There is no requirement that both ends of the serial link use the same interface, (0/0/0, 0/0/1, 0/1/0, 0/1/1, ….)
in this case, Serial 0/0/0. However, because both interfaces are members of the same network, they both must have IP addresses that belong to the 172.16.2.0/24 network.
If we now issue the show interfaces serial 0/0/0 command on either router, we still see that the link is up/down.
R2#show interfaces serial 0/0/0
Serial0/0/0 is up, line protocol is down
The physical link between R1 and R2 is up because both ends of the serial link have been configured correctly with an IP address/mask and enabled with the no shutdown command.
However, the line protocol is still down. This is because the interface is not receiving a clock signal.
*
*
Cisco Public
Setup “no shut”
*
Cisco Public
-A WAN Physical Layer connection has sides:
Data Circuit-terminating Equipment (DCE) – This is the service provider. CSU/DSU is a DCE device.
The CSU/DSU (DCE device) is used to convert the data from the router (DTE device) into a form acceptable to the WAN service provider.
a DCE device such as a CSU/DSU will provide the clock.
Data Terminal Equipment (DTE) – Typically the router is the DTE device.
Up-to-date technology
*
Use graphic 2.2.5.1….would suggest modifying graphic such that each component is identified prior to placing on slide
ITE PC v4.0 Chapter 1
*
Cisco Public
Interfaces
For serial links that are directly interconnected, as in a lab environment, one side of a connection must be considered a DCE and provide a clocking signal.
You can also distinguish DTE from DCE
1) by looking at the connector between the two cables. The DTE cable has a male connector, whereas the DCE cable has a female connector.
2) If a cable is connected between the two routers, you can use the show controllers command to determine which end of the cable is attached to that interface.
R1#show controllers serial 0/0/0
Interface Serial0/0/0
*
Use graphic 2.2.5.2 topology. If you can fit the router output that would be great but if not just use the topology
ITE PC v4.0 Chapter 1
*
Cisco Public
Interfaces
Once the cable is attached, the clock can now be set with the clock rate command.
The available clock rates, in bits per second, are 1200, 2400, 9600, 19200, 38400, 56000, 64000, 72000, 125000, 148000, 500000, 800000, 1000000, 1300000, 2000000, and 4000000.
Some bit rates might not be available on certain serial interfaces.
R1(config)#interface serial 0/0
R1(config-if)#clock rate 64000
01:10:28: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
Note: If a router's interface with a DTE cable is configured with the clock rate command, the IOS will disregard the command and there will be no ill effects.
*
Use graphic 2.2.5.2 topology. If you can fit the router output that would be great but if not just use the topology
ITE PC v4.0 Chapter 1
*
Cisco Public
R1#show interfaces
R1#ping 172.16.2.2
*
Use graphic 2.2.5.2 topology. If you can fit the router output that would be great but if not just use the topology
ITE PC v4.0 Chapter 1
*
Cisco Public
Routing Table Concepts
The show ip route command reveals the content of the routing table.
The main purpose of a routing table is to provide the router with paths to different destination networks.
The routing table consists of a list of "known" network addresses
directly connected,
configured statically,
learned dynamically.
POP Quiz:
ITE PC v4.0 Chapter 1
*
Cisco Public
Purpose of the debug ip routing command
Allows you to view changes that the router performs when adding or removing routes in real time
1
2
3
4
5
Check the routing table
Configuring the IP address and Subnet Mask
Disable debug ip routing by using either the “undebug ip routing” command or the “undebug all” command.
disable interfaces with the shutdown command.
Check the routing table
*
ITE PC v4.0 Chapter 1
*
Cisco Public
Routing Table and CDP Protocol
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
POP Quiz: Why
pings failed?
*
*
Cisco Public
Routing Table and CDP Protocol
When a router only has its interfaces configured, and the routing table contains the directly connected networks but no other routes, only devices on those directly connected networks are reachable.
*
*
Cisco Public
Routing Table and CDP Protocol
Checking each route in turn
The ping command is used to check end to end connectivity
Ping 172.16.3.1 failed
Route does not match any route in the routing table
Ping 192.168.1.1 succeed
*
*
Cisco Public
Purpose of CDP
Cisco Discovery Protocol (CDP) is a powerful network monitoring and troubleshooting tool.
CDP runs at the Data Link layer connecting the physical media to the upper-layer protocols (ULPs).
Because CDP operates at the Data Link layer, two or more Cisco network devices, such as routers that support different Network layer protocols (for example, IP and Novell IPX), can learn about each other.
A layer 2 cisco proprietary tool used to gather information about other directly connected Cisco devices.
enables you to access a summary of protocol and address information about Cisco devices that are directly connected.
the types of devices that are connected,
the interfaces they are connected to,
the interfaces used to make the connections,
the model numbers of the devices.
……..
*
ITE PC v4.0 Chapter 1
*
Cisco Public
Concept of neighbors
Layer 3 neighbors
At Layer 3, routing protocols consider neighbors to be devices that share the same network address space.
R1 and R2 are neighbors. Both are members of the 172.16.1.0/24 network.
R2 and R3 are also neighbors because they both share the 192.168.1.0/24 network.
But R1 and R3 are not neighbors because they do not share any network address space.
Layer 2 neighbors
CDP operates at Layer 2 only. Therefore, CDP neighbors are Cisco devices that are directly connected physically and share the same data link.
R1 and S1 are CDP neighbors.
R1 and R2 are CDP neighbors.
R2 and S2 are CDP neighbors.
R2 and R3 are CDP neighbors.
R3 and S3 are CDP neighbors.
*
ITE PC v4.0 Chapter 1
*
Cisco Public
CDP exchanges hardware and software device information with its directly connected CDP neighbors.
CDP show commands
Show cdp neighbors detail command
-It can also reveals the IP address of a neighboring device
knowing the IP address of the CDP neighbor is often allows you to telnet into that device.
and a lot more
*
Cisco Public
Disabling CDP
CDP be a security risk
Because some IOS versions send out CDP advertisements by default, it is important to know how to disable CDP.
If you need to disable CDP globally, for the entire device, use this command:
Router(config)#no cdp run
If you want to use CDP but need to stop CDP advertisements on a particular interface, use this command:
Router(config-if)#no cdp enable
*
Use router output graphic 2.3.4.1 (all 3) – this will cover this slide and the previous slide
ITE PC v4.0 Chapter 1
*
Cisco Public
Static Routes
A router can learn about remote networks in one of two ways:
Manually, from configured static routes
Automatically, from a dynamic routing protocol
Dynamic routing protocols are introduced in the next chapter.
Purpose of a static route
A manually configured route used when routing from a network to a stub network
A stub network is a network accessed by a single route.
For an example, here we see that any network attached to R1 would only have one way to reach other destinations, whether to networks attached to R2 or to destinations beyond R2.
*
*
Cisco Public
Static Routes
IP route command
To configure a static route use the following command: ip route
Example:
*
*
Cisco Public
Chicago
RTR(config)# ip route prefix mask {address | interface}
O’Hare
O’Hare
Los Angeles
*
Cisco Public
Static Routes
These are the routes currently in its routing table.
The remote networks that R1 does not know about are:
172.16.1.0/124 - The LAN on R2
192.168.1.0/24 - The serial network between R2 and R3
192.168.2.0/24 - The LAN on R3
*
*
Cisco Public
Static Routes
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
show ip route output
172.16.1.0 - Network address for the route
/24 - Subnet mask for this route; this is displayed in the line above, known as the parent route, and discussed in Chapter 8
[1/0] - Administrative distance and metric for the static route (explained in a later chapter)
via 172.16.2.2 - IP address of the next-hop router, the IP address of R2's Serial 0/0/0 interface
R1(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.2
*
*
Cisco Public
Static Routes
172.16.1.0 - Network address for the route
/24 - Subnet mask for this route; this is displayed in the line above, known as the parent route, and discussed in Chapter 8
[1/0] - Administrative distance and metric for the static route (explained in a later chapter)
via 172.16.2.2 - IP address of the next-hop router, the IP address of R2's Serial 0/0/0 interface
R1(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.2
*
*
Cisco Public
Static Routes
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
*
*
Cisco Public
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.“
R1 has three static routes in its routing table and makes forwarding decisions based solely upon the information in the routing table.
R1 does not consult the routing tables in any other routers.
Making each router aware of remote networks is the responsibility of the network administrator.
Principle 2: "The fact that one router has certain information in its routing table does not mean that other routers have the same information.“
The network administrator would be responsible for ensuring that the next-hop router also has a route to this network
Using Principle 2, we still need to configure the proper routing on the other routers (R2 and R3) to make sure that they have routes to these three networks.
Principle 3: "Routing information about a path from one network to another does not provide routing information about the reverse, or return path.“
Most of the communication over networks is bidirectional. This means that packets must travel in both directions between the end devices involved.
*
*
Cisco Public
Static Routes
*
Cisco Public
Resolving to an Exit Interface
-Recursive route lookup - Occurs when the router has to perform multiple lookups in the routing table before forwarding a packet. A static route that forwards all packets to the next-hop IP address goes through the following process (reclusive route lookup)
(Step 1) The router first must match static route’s destination IP address with the Next hop address
The packet's destination IP address is matched to the static route 192.168.2.0/24 with the next-hop IP address 172.16.2.2.
(Step 2) The next hop address is then matched to an exit interface
*
*
Cisco Public
Configuring a Static route with an Exit Interface
-Static routes configured with an exit interface are more efficient because the routing
The routing table can resolve the exit interface in a single search instead of 2 searches
If the static route cannot be resolved to an exit interface, the static route is removed from the routing table
Notice from the debug output that all three static routes were deleted when the Serial 0/0/0 interface was shut down.
*
*
Cisco Public
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:
A new static route must be rewritten in the configuration
R1(config)# no ip route 192.168.2.0 255.255.255.0 172.16.2.2
R1(config)#ip route 192.168.2.0 255.255.255.0 serial 0/0/0
*
*
Cisco Public
-Use the following commands
Step 1 show running-config
Step 3 show ip route
Step 4 verify route was configured in routing table
*
*
Cisco Public
Static route operation
*
*
Cisco Public
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
This is found by the router consulting the ARP table.
If an entry isn’t found then an ARP request will be sent out
R1(config)#ip route 192.168.2.0 255.255.255.0 fa 0/1
*
*
Cisco Public
Static Routes with Exit Interfaces
Best not to use only an exit interface with Ethernet interfaces.
Router will have difficulty determining the destination MAC address.
With Ethernet networks, many different devices can be sharing the same multiaccess network, including hosts and even multiple routers.
Router will not have sufficient information to determine which device is the next-hop device.
Use both the next-hop interface and the exit interface for Ethernet exit interfaces.
Only a single route lookup now needed.
R1(config)#ip route 192.168.2.0 255.255.255.0 fastethernet 0/1
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
*
*
Cisco Public
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.
For example, the networks 10.0.0.0/16, 10.1.0.0/16, 10.2.0.0/16, 10.3.0.0/16, 10.4.0.0/16, 10.5.0.0/16, all the way through 10.255.0.0/16 can be represented by a single network address: 10.0.0.0/8.
*
*
Cisco Public
Calculating a summary route
Here's the process of creating the summary route 172.16.1.0/22, as shown in the figure:
Write out the networks that you want to summarize in binary.
To find the subnet mask for summarization, start with the left-most bit.
Work your way to the right, finding all the bits that match consecutively.
When you find a column of bits that do not match, stop. You are at the summary boundary.
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
To find the network address for summarization, copy the matching 22 bits and add all 0 bits to the end to make 32 bits.
By following these steps, we can discover that the 3 static routes on R3 can be summarized into a single static route, using the summary network address of 172.16.0.0 255.255.252.0:
ip route 172.16.0.0 255.255.252.0 Serial0/0/1
*
*
Cisco Public
Example: Calculating a summary route
Which address can be used to summarize networks 172.168.0.0 /24 through 172.168.7.0 /24?
10101100 10101000 00000000 00000000
10101100 10101000 00000001 00000000
10101100 10101000 00000010 00000000
10101100 10101000 00000011 00000000
10101100 10101000 00000100 00000000
10101100 10101000 00000101 00000000
10101100 10101000 00000110 00000000
10101100 10101000 00000111 00000000
*
Cisco Public
Which address can be used to summarize networks
192.1.1.0/27
192.1.1.32/27
192.1.1.64/28
192.1.1.80/28
192.1.1.96/29
192.1.1.104/29
192.1.1.112/29
192.1.1.120/29
*
Cisco Public
Summary Route
R3(config)#ip route 172.16.0.0 255.255.252.0 serial0/0/1
Step 3: Verify the new static route
show ip route ping
*
Cisco Public
Summary Route
Static routes and subnet masks
The routing table lookup process will use the most specific match when comparing destination IP address and subnet mask
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.
*
*
Cisco Public
Default Route
This is a route that will match all packets.
Like route summarization this will help reduce the size of the routing table
Default static routes are used:
When no other routes in the routing table match the packet's destination IP address. A common use is when connecting a company's edge router to the ISP network.
When a router has only one other router to which it is connected. This condition is known as a stub router.
Configuring a default static route
Similar to configuring a static route. Except that destination IP address and subnet mask are all zeros
Example:
*
*
Cisco Public
It is only connected to R2.
Currently R1 has three static routes, which are used to reach all of the remote networks in our topology.
All three static routes have the exit interface Serial 0/0/0, forwarding packets to the next-hop router R2.
R1 is an ideal candidate to have all of its static routes replaced by a single default route.
First, delete the three static routes
Next, configure the single default static route using the same Serial 0/0/0 exit interface
R1(config)#ip route 0.0.0.0 0.0.0.0 serial 0/0/0
*
*
Cisco Public
Static Routes and Packet Forwarding
Verify the change to the routing table with the show ip route command
S* 0.0.0.0/0 is directly connected, Serial0/0/0
Note the * or asterisk next to the S.
As you can see from the Codes table in the figure, the asterisk indicates that this static route is a candidate default route.
The key to this configuration is the /0 mask.
We previously said that it is the subnet mask in the routing table that determines how many bits must match between the destination IP address of the packet and the route in the routing table.
*
*
Cisco Public
Self test: Static and static default route
Can you use both static and static default route to configure the communication between both LANS and the communication to the Internet.
Only 3 statement of static route needed to setup the network.
1 static route
*
*
Cisco Public
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
Layer 3
Layer 2
*
Cisco Public
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
- Than trace route
Issue: show ip route to examine routing table.
*
*
Cisco Public
Connecting Networks
Serial cables are connected to router serial ports.
In the lab environment clock rates must be configured for DCE
LANs
Straight through cables or cross over cables are used to connect to fastethernet port. (The type of cable used depends on what devices are being connected)
Cisco Discovery Protocol
Used to discover information about directly connected Cisco devices
*
*
Cisco Public
Static Routes
-This is a manually configured path that specifies how the router will get to a certain point using a certain path.
Summary static routes
-This is several static routes that have been condensed into a single static route.
Default route
-It is the route packets use if there is no other possible match for their destination in the routing table.
Forwarding of packets when static route is used
-Zinin’s 3 routing principles describe how packets are forwarded
Troubleshooting static routes may require some of the following commands:
-Ping
-Traceroute
*
Cisco Public