static routing - college of dupage · © 2007 cisco systems, inc. all rights reserved. cisco public...

80
© 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 02/10/2010

Upload: vuongkhue

Post on 27-Sep-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

© 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

02/10/2010

ITE PC v4.0

Chapter 1 2© 2007 Cisco Systems, Inc. All rights reserved. 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!

Tony Chen

College of DuPage

Cisco Networking Academy

ITE PC v4.0

Chapter 1 3© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Objectives Define the general role a router plays in networks.

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

ITE PC v4.0

Chapter 1 4© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

General Role of the Router Functions of a Router

Best Path Selections

Forwarding packets to destination

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.

– The routing table will ultimately determine the exit interface to forward the packet and the router will encapsulate that packet in the appropriated data link frame for that outgoing interface.

ITE PC v4.0

Chapter 1 5© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

General Role of the Router Introducing the Topology

– The figure shows the topology used in this chapter.

– 3 1800 series routers connected via WAN links

– Each router connected to a LAN represented by a switch and a PC

ITE PC v4.0

Chapter 1 6© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

General Role of the Router 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

ITE PC v4.0

Chapter 1 7© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

General Role of the Router in COD Smart Serial cables: DCE and DTE

-Use straight cable to connect between the DTE and DCE..

Ethernet cables:

Cross-over cable: RED cable

Roll-over cable: flat cables

Straight cable: all other cables

DCE and DTE Adapter

http://www.csdata.com/csdonline/customer/home.php

ITE PC v4.0

Chapter 1 8© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Serial Connectors

DTEDCE

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

ITE PC v4.0

Chapter 1 9© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Interfaces Examining Router Interfaces

-Show IP route command – used to view routing table

-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

-Show running-config command – used to show configuration file in RAM

ITE PC v4.0

Chapter 1 10© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Interfaces Configuring an Ethernet interface

-By default all serial and Ethernet interfaces are down

-To enable an interface use the No Shutdown command

•The show ip routecommand is used to display the routing table. •Initially, the routing table is empty if no interfaces have been configured.•Static routes and dynamic routes will not be added to the routing table until the appropriate local interfaces have been configured on the router.

ITE PC v4.0

Chapter 1 11© 2007 Cisco Systems, Inc. All rights reserved. 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

• You will notice that the show interfaces command does not show any IP addresses on R1's interfaces. The reason for this is because we have not yet configured IP addresses on any of the interfaces.

ITE PC v4.0

Chapter 1 12© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Interfaces Verifying Ethernet interface

– 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 –

-can be used to see a portion of the interface information in a condensed format.

ITE PC v4.0

Chapter 1 13© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Configuring an Ethernet interfaceBy 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)#ip address 172.16.3.1 255.255.255.0

R1(config-if)#no shutdown

The following message is returned from the IOS:

*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.

• However, WAN interfaces in a lab environment require clocking on one side of the link. If you do not correctly set the clock rate, then line protocol will not change to up.

ITE PC v4.0

Chapter 1 14© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Configuring an Ethernet interface

Unsolicited Messages from IOS

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.

In order to keep the unsolicited output separate from your input, enter line configuration mode for the consoled port and add the logging synchronous command, as shown. You will see that messages returned by IOS no longer interfere with your typing.

ITE PC v4.0

Chapter 1 15© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Interfaces Verifying Ethernet interface

-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

–The C at the beginning of the route indicates that this is a directly connected network. In other words, R1 has an interface that belongs to this network.

–The /24 subnet mask for this route is displayed in the line above the actual route.

ITE PC v4.0

Chapter 1 16© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Interfaces Reading the Routing Table

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.

–The routing table could contain all 254 individual host IP addresses for the 172.16.3.0/24 network, but that is an inefficient way of storing addresses.

ITE PC v4.0

Chapter 1 17© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Interfaces Verifying Ethernet interface

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.

ITE PC v4.0

Chapter 1 18© 2007 Cisco Systems, Inc. All rights reserved. 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.

–If a router has a packet destined for a device on a directly connected Ethernet network, it checks the ARP table for an entry with that destination IP address in order to map it to the MAC address.

ITE PC v4.0

Chapter 1 19© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

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/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 20© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Interfaces R1(config)#interface serial 0/0/0

R1(config-if)#ip address 172.16.2.1 255.255.255.0

R1(config-if)#no shutdown

R2(config)#interface serial 0/0/0

R2(config-if)#ip address 172.16.2.2 255.255.255.0

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.

– There is still one more command that we need to enter, the clock rate command, on the router with the DCE cable. The clock rate command will set the clock signal for the link.

ITE PC v4.0

Chapter 1 21© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Interfaces

Nothing is configured

Setup IP but not “no shut”

Setup “no shut”

Configured the clock rate

Step 1

Step 2

Step 3

Step 4

ITE PC v4.0

Chapter 1 22© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Examining Router Interfaces

-Physically connecting a WAN Interface.

-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

Cisco 1-Port T1/Fractional T1

DSU/CSU WAN Interface Card

(WIC-1DSU-T1-V2=)

ITE PC v4.0

Chapter 1 23© 2007 Cisco Systems, Inc. All rights reserved. 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

Hardware is PowerQUICC MPC860

DCE V.35, no clock

<output omitted>

- What is the significant of the information 1?

ITE PC v4.0

Chapter 1 24© 2007 Cisco Systems, Inc. All rights reserved. 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 the “show controllers serial 0/0/0” to find out whether it is a DTE or DCE cable.

ITE PC v4.0

Chapter 1 25© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

TestingVerifying the Serial Interface ConfigurationR1#show interfacesR1#show ip interface briefR1#ping 172.16.2.2R1#show ip route

ITE PC v4.0

Chapter 1 26© 2007 Cisco Systems, Inc. All rights reserved. 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:

– Can R1 ping R2?

– Can PC1 ping PC2?

ITE PC v4.0

Chapter 1 27© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Routing Table Concepts 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

enable debugging with the debug ip routing command

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

Never use the debug all command on the production router.

ITE PC v4.0

Chapter 1 28© 2007 Cisco Systems, Inc. All rights reserved. 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: Whypings

failed?

The output in this figure verifies that all configured interfaces are "up" and "up".

ITE PC v4.0

Chapter 1 29© 2007 Cisco Systems, Inc. All rights reserved. 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.

–R1 can communicate with any device on the 172.16.3.0/24 and 172.16.2.0/24 networks.

–R2 can communicate with any device on the 172.16.1.0/24, 172.16.2.0/24, and 192.168.1.0/24 networks.

–R3 can communicate with any device on the 192.168.1.0/24 and 192.168.2.0/24 networks.

ITE PC v4.0

Chapter 1 30© 2007 Cisco Systems, Inc. All rights reserved. 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

•192.168.1.0/24, matches the first 24 bits of the destination IP address

ITE PC v4.0

Chapter 1 31© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Routing Table and CDP Protocol 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 32© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Routing Table and CDP Protocol Concept of neighbors

-2 types 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.

Notice the difference between Layer 2 and Layer 3 neighbors. The switches are not neighbors to the routers at Layer 3, because the switches are operating at Layer 2 only. However, the switches are Layer 2 neighbors to their directly connected routers.

ITE PC v4.0

Chapter 1 33© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Routing Table and CDP Protocol CDP is on by default.

–CDP exchanges hardware and software device information with its directly connected CDP neighbors.

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

-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

– IOS version

– Platform

– …………

ITE PC v4.0

Chapter 1 34© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Routing Table and CDP Protocol 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

ITE PC v4.0

Chapter 1 35© 2007 Cisco Systems, Inc. All rights reserved. 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. •Therefore, network 172.16.3.0 is a stub network and R1 is a stub router. •Running a routing protocol between R1 and R2 is a waste of resources

ITE PC v4.0

Chapter 1 36© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

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 {ip-address | exit-interface }

ITE PC v4.0

Chapter 1 37© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static route operation Example: Fly from Chicago to LA

Chicago

Los

Angeles

Chicago O’Hare Airport Los Angeles

RTR(config)# ip route prefix mask {address | interface}

O’Hare

O’HareLos

Angeles

ITE PC v4.0

Chapter 1 38© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static route operation Example: Fly from Chicago to LA

Chicago O’Hare Airport Los Angeles

Midway Airport

RTR(config)# ip route prefix mask {address | interface}

O’HareLos

Angeles

ChicagoO’Hare

Midway

Los

Angeles

ITE PC v4.0

Chapter 1 39© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static route operation Example: Fly from Chicago to LA

RTR(config)# ip route prefix mask {address | interface}

O’HareLos

Angeles

O’HareMidway

Chicago

Los

Angeles

Chicago O’Hare Airport Los Angeles

Midway Airport

ITE PC v4.0

Chapter 1 40© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static route operation Example: Fly from Chicago to LA

RTR(config)# ip route prefix mask {address | interface}

O’HareLos

Angeles

O’HareMidway

ChicagoLos

Angeles

Chicago O’Hare Airport Los Angeles

Midway Airport

ITE PC v4.0

Chapter 1 41© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static route operation Example: Fly from Chicago to LA

RTR(config)# ip route prefix mask {address | interface}

O’HareLos

Angeles

O’HareMidway

ChicagoLos

Angeles

Chicago O’Hare Airport Los Angeles

Midway Airport

ITE PC v4.0

Chapter 1 42© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static route operation Example: Fly from Chicago to LA

Chicago O’Hare Airport Los Angeles

Midway Airport

RTR(config)# ip route prefix mask {address | interface}

ChicagoO’Hare

Midway

Los

Angeles

S 0/0/0

11.11.11.1 /24

S 0/0/1

11.11.11.2 /24

20.20.20.0 /245.5.5.0 /24

RTR(config)# ip route 20.20.20.0 255.255.255.0 11.11.11.2

Or

RTR(config)# ip route 20.20.20.0 255.255.255.0 s 0/0/0

Los Angeles20.20.20.0 /24 O’Hare

MidwayLos Angeles20.20.20.0 /24

ITE PC v4.0

Chapter 1 43© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static route operation Example: Fly from Chicago to LA

RTR(config)# ip route prefix mask {address | interface}

O’Hare

Midway

Chicago

Los

Angeles

Chicago O’Hare Airport Los Angeles

Midway Airport

S 0/0/0

11.11.11.1 /24

S 0/0/1

11.11.11.2 /24

RTR(config)# ip route 20.20.20.0 255.255.255.0 11.11.11.2

Or

RTR(config)# ip route 20.20.20.0 255.255.255.0 s 0/0/0

Los Angeles20.20.20.0 /24 O’Hare

MidwayLos Angeles20.20.20.0 /24

ITE PC v4.0

Chapter 1 44© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static route operation Example: Fly from Chicago to LA

RTR(config)# ip route prefix mask {address | interface}

O’Hare

Midway

ChicagoLos

Angeles

Chicago O’Hare Airport Los Angeles

Midway Airport

S 0/0/0

11.11.11.1 /24

S 0/0/1

11.11.11.2 /24

RTR(config)# ip route 20.20.20.0 255.255.255.0 11.11.11.2

Or

RTR(config)# ip route 20.20.20.0 255.255.255.0 s 0/0/0

Los Angeles20.20.20.0 /24 O’Hare

MidwayLos Angeles20.20.20.0 /24

ITE PC v4.0

Chapter 1 45© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static route operation Example: Fly from Chicago to LA

RTR(config)# ip route prefix mask {address | interface}

O’HareMidway

ChicagoLos

Angeles

Chicago O’Hare Airport Los Angeles

Midway Airport

S 0/0/0

11.11.11.1 /24

S 0/0/1

11.11.11.2 /24

RTR(config)# ip route 20.20.20.0 255.255.255.0 11.11.11.2

Or

RTR(config)# ip route 20.20.20.0 255.255.255.0 s 0/0/0

Los Angeles20.20.20.0 /24 O’Hare

MidwayLos Angeles20.20.20.0 /24

ITE PC v4.0

Chapter 1 46© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static Routes Remember R1 knows about its directly

connected networks.

–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

ITE PC v4.0

Chapter 1 47© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

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

show ip route output

–S - Routing table code for static route

–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

ITE PC v4.0

Chapter 1 48© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static Routes

show ip route output

–S - Routing table code for static route

–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

ITE PC v4.0

Chapter 1 49© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static Routes Configuring routes to 2 or more remote networks

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 50© 2007 Cisco Systems, Inc. All rights reserved. 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.

Using Principle 3 as guidance, we will configure proper static routes on the other routers to make sure they have routes back to the 172.16.3.0/24 network.

ITE PC v4.0

Chapter 1 51© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static Routes

ITE PC v4.0

Chapter 1 52© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static Routes with next-hop IP address 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 (recursive 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

The next-hop IP address of the static route, 172.16.2.2, is matched to the directly connected network 172.16.2.0/24 with the exit interface of Serial 0/0/0.

ITE PC v4.0

Chapter 1 53© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static Routes with Exit Interfaces Configuring a Static route with an Exit

Interface

-Static routes configured with an exit interfaceare 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.

–They were deleted because all three static routes were resolved to Serial 0/0/0.

–However, the static routes are still in the R1's running configuration. If the interface comes back up (is enabled again with no shutdown), the IOS routing table process will reinstall these static routes back into the routing table.

ITE PC v4.0

Chapter 1 54© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static Routes with Exit Interfaces 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

R1(config)# no ip route 192.168.2.0 255.255.255.0 172.16.2.2R1(config)#ip route 192.168.2.0 255.255.255.0 serial 0/0/0

ITE PC v4.0

Chapter 1 55© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

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 56© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Static route operation

Both types of the routes all have distance of 1

and metric of 0.

ITE PC v4.0

Chapter 1 57© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

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

–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

ITE PC v4.0

Chapter 1 58© 2007 Cisco Systems, Inc. All rights reserved. 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

ITE PC v4.0

Chapter 1 59© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

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.

–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.

Multiple static routes can be summarized into a single static route if:

–The destination networks can be summarized into a single network address, and

–The multiple static routes all use the same exit-interface or next-hop IP address

ITE PC v4.0

Chapter 1 60© 2007 Cisco Systems, Inc. All rights reserved. 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:

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.

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

ITE PC v4.0

Chapter 1 61© 2007 Cisco Systems, Inc. All rights reserved. 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

Answer:

ITE PC v4.0

Chapter 1 62© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Example: Calculating a summary route

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

11000000 00000001 00000001 00000000

11000000 00000001 00000001 00100000

11000000 00000001 00000001 01000000

11000000 00000001 00000001 01010000

11000000 00000001 00000001 01100000

11000000 00000001 00000001 01101000

11000000 00000001 00000001 01110000

11000000 00000001 00000001 01111000

Answer:

ITE PC v4.0

Chapter 1 63© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Summary Route Configuring a summary route

–Step 1: Delete the current static routeR3(config)#no ip route 172.16.1.0 255.255.255.0 serial0/0/1

R3(config)#no ip route 172.16.2.0 255.255.255.0 serial0/0/1

R3(config)#no ip route 172.16.3.0 255.255.255.0 serial0/0/1

–Step 2: Configure the summary static 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

ITE PC v4.0

Chapter 1 64© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Summary Route Static routes and subnet masks

–The routing table lookup process will use the most specific matchwhen 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.

ITE PC v4.0

Chapter 1 65© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Default Route Default Static 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:

-Router(config)#ip route 0.0.0.0 0.0.0.0 [exit-interface | ip-address ]

ITE PC v4.0

Chapter 1 66© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Summary and Default Route R1 is a stub router.

–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

ITE PC v4.0

Chapter 1 67© 2007 Cisco Systems, Inc. All rights reserved. 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.

•A /0 mask indicates that zero or no bits are needed to match.

ITE PC v4.0

Chapter 1 68© 2007 Cisco Systems, Inc. All rights reserved. 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

-2 default static route

WinterPark(config)# ip route 0.0.0.0 0.0.0.0 192.168.146.1Altamonte(config)# ip route 10.0.234.0 255.255.255.0 192.168.146.2Altamonte(config)# ip route 0.0.0.0 0.0.0.0 s0/1

ITE PC v4.0

Chapter 1 69© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

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

Layer 3

Layer 2

ITE PC v4.0

Chapter 1 70© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

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

- Than trace route

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 71© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

LAB 1

172.16.3.0 /24

172.16.2.0 /24

172.16.1.0 /24

192.168.1.0 /24

192.168.2.0 /24

.1

.1

.2.2

.1

.10

.10

.10

1. On the R2 router, configure a static route to the 172.16.3.0 network using the Serial 0/0/0 interface of the R2 router as the Exit Interface.2. On the R2 router, configure a static route to the 192.168.2.0 network using the next hop IP address.

Configure the R1 router with a default route using the Serial 0/0/0 interface of R2 (IP address) as the next hop interface.

Configure the R3 router with a static route to reach all other networks.Choice 1: Configure 3 static routes (or)Choice 2: Configure a single summary static route using the next hop IP address

(This is the answer needed in the PT lab)

.1

.1

ITE PC v4.0

Chapter 1 72© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

LAB 1

ip route 172.16.0.0 255.255.252.0 192.168.1.2

ip route 192.168.2.0 255.255.255.0 192.168.1.1 ip route 172.16.3.0 255.255.255.0 Serial0/0/0

ip route 0.0.0.0 0.0.0.0 172.16.2.2

172.16.3.0 /24

172.16.2.0 /24

172.16.1.0 /24

192.168.1.0 /24

192.168.2.0 /24

.1

.1

.2.2

.1

.10

.10

.10.1

.1

ITE PC v4.0

Chapter 1 73© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

LAB 2

192.168.2.192 /26

192.168.2.128 /26

192.168.2.64 /26

209.165.201.0 /30

209.165.200.0 /27

.225

.1

.2

.65

.129

.254

.126

.254

1. Configure HQ a static route to the Branch LAN using the Serial 0/0/0 interface of HQ as the exit interface.2. Configure the HQ router with a default static route pointing to ISP using the “next-hop” IP address.

configure Branch with a default static route using the appropriate exit interface point to HQ.

Configure the R3 router with a static route to reach all other networks.Choice 1: Configure 3 static routes (or)Choice 2: Using the “next-hop” IP address, configure ISP with a summary static route that includes all of the subnets that are missing from the routing table

(This is the answer needed in the PT lab)

.130HQ

Branch ISP.193

ITE PC v4.0

Chapter 1 74© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

LAB 2

ip route 192.168.2.0 255.255.255.0 209.165.201.2

ip route 192.168.2.192 255.255.255.192 Serial0/0/0 ip route 0.0.0.0 0.0.0.0 209.165.201.1

ip route 0.0.0.0 0.0.0.0 Serial0/0/0

HQ

192.168.2.192 /26

192.168.2.128 /26

192.168.2.64 /26

209.165.201.0 /30

209.165.200.0 /27

.225

.1

.2

.65

.129

.254

.126

.254

.130

.193

ITE PC v4.0

Chapter 1 75© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

LAB 3

172.20.1.128 /25

172.20.1.0 /25

172.20.0.128 /25

192.168.38.252 /30

192.168.39.64 /26

.65

.253

.254

.129

.1

.135

.135

.70

1. HQ uses a static route to the Branch LAN using the “next-hop” IP address.2. HQ router with a static route (not default static route) pointing to ISP using the “next-hop” IP address.

Branch with a default static route using the “next-hop” IP address point to HQ.

Configure the R3 router with a static route to reach all other networks.Choice 1: uses 3 static routes (or)Choice 2: Using the “next-hop” IP address, configure ISP with a summary static route that includes all of the subnets that are missing from the routing table

(This is the answer needed in the PT lab)

.2HQ

Branch ISP.129

ITE PC v4.0

Chapter 1 76© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

LAB 3

172.20.1.128 /25

172.20.1.0 /25

172.20.0.128 /25

192.168.38.252 /30

192.168.39.64 /26

.65

.253

.254

.129

.1

.135

.135

.70

What is the summary address for: 172.20.0.128 /25172.20.1.0 /25172.20.1.128 /25

.2HQ

Branch ISP.129

10101100 00010100 00000000 10000000

10101100 00010100 00000001 00000000

10101100 00010100 00000001 10000000

ITE PC v4.0

Chapter 1 77© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

LAB 3

ip route 172.20.0.0 255.255.254.0 192.168.38.254

ip route 192.168.39.64 255.255.255.192 192.168.38.253 ip route 172.20.1.128 255.255.255.128 172.20.1.1

ip route 0.0.0.0 0.0.0.0 172.20.1.2

HQ.2

172.20.1.128 /25

172.20.1.0 /25

172.20.0.128 /25

192.168.38.252 /30

192.168.39.64 /26

.65

.253

.254

.129

.1

.135

.135

.70

.2

.129Branch ISP

ITE PC v4.0

Chapter 1 78© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Summary Routers

-Operate at layer 3

-Functions include best path selection & forwarding packets

Connecting Networks

WANs

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

A layer 2 proprietary protocol

Used to discover information about directly connected Cisco devices

ITE PC v4.0

Chapter 1 79© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Summary 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

-Show IP route

-Show ip interface brief

-Show cdp neighbors detail

ITE PC v4.0

Chapter 1 80© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public