This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Routers perform packet forwarding by learning about
remote networks and maintaining routing information. – The routers primary forwarding decision is based on Layer 3information, the destination IP address.
– The router's routing table is used to find the best matchbetween the destination IP of a packet and a network addressin the routing table.
– The routing table will ultimately determine the exit interface toforward the packet and the router will encapsulate that packet inthe appropriated data link frame for that outgoing interface.
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 route
command is used todisplay the routing table.•Initially, the routing table isempty if no interfaces havebeen configured. •Static routes and dynamicroutes will not be added tothe routing table until theappropriate local interfaceshave been configured onthe router.
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 froma switch or the hub. This condition may also be due to the fact that the interface is in shutdownmode
• You will notice that the show interfaces command does not show any IP addresses on R1'sinterfaces. The reason for this is because we have not yet configured IP addresses on any of theinterfaces.
– Show run – • command displays the current configuration file thatthe router is using. Configuration commands aretemporarily stored in the running configuration fileand implemented immediately by the router.
•However, using show running-config is notnecessarily the best way to verify interface
configurations.
-Show ip interface brief –
-can be used to see a portion of the interfaceinformation in a condensed format.
Configuring an Ethernet interfaceBy default, all router interfaces are shutdown. To enable thisinterface, 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: InterfaceFastEthernet0/0, changed state to up
*Mar 1 01:16:09.214: %LINEPROTO-5-UPDOWN: Lineprotocol 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 firstmessage, be sure that the interface is properly connected toa carrier signal from switch or a hub.
–The second changed state to up message indicates that theData Link layer is operational.
• However, WAN interfaces in a lab environment requireclocking on one side of the link. If you do correctly set the
clock rate, then line protocol will not change to up.
Unsolicited Messages from IOS The IOS often sends unsolicited messages.
As you can see in the figure, sometimes thesemessages will occur when you are in the middleof typing a command, such as configuring adescription 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 separatefrom your input, enter line configuration modefor the consoled port and add the logging synchronous command, as shown. You will seethat messages returned by IOS no longerinterfere with your typing.
–Having a single route represent an entirenetwork of host IP addresses makes therouting table smaller, with fewer routes,which results in faster routing table
lookups.•It means that this route matches allpackets with a destination addressbelonging to this network.
–The routing table could contain all 254individual host IP addresses for the172.16.3.0/24 network, but that is an
Ethernet Interfaces Participate in ARP A router's Ethernet interface participates
in a LAN network just like any otherdevice on that network.
–This means that these interfaces have aLayer 2 MAC address, as shown in the figure.The show interfaces command displays theMAC address for the Ethernet interfaces.
–If a router has a packet destined for adevice on a directly connected Ethernetnetwork, it checks the ARP table for an entrywith that destination IP address in order tomap it to the MAC address.
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 samenetwork, 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 thatthe 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 beenconfigured 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 clocksignal.
– There is still one more command that we need to enter, the clock rate command, on therouter with the DCE cable. The clock rate command will set the clock signal for the link.
For serial links that are directly interconnected, as in alab environment, one side of a connection must beconsidered 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 DCEcable has a female connector .
–2) If a cable is connected between the two routers, youcan use the show controllers command to determinewhich end of the cable is attached to that interface.
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, are1200, 2400, 9600, 19200, 38400, 56000, 64000,72000, 125000, 148000, 500000, 800000,1000000, 1300000, 2000000, and 4000000.
–Some bit rates might not be available on certainserial interfaces.
R1(config)#interface serial 0/0
R1(config-if)#clock rate 64000
01:10:28: %LINEPROTO-5-UPDOWN: Line protocol onInterface Serial0/0, changed state to up
Note: If a router's interface with a DTE cable is configuredwith the clock rate command, the IOS will disregard thecommand and there will be no ill effects.
–Use the “show controllers serial 0/0/0” tofind out whether it is a DTE or DCE cable.
When a router only has its interfaces configured, and therouting table contains the directly connected networks butno other routes, only devices on those directly connectednetworks are reachable.
–R1 can communicate with any device on the 172.16.3.0/24and 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/24and 192.168.2.0/24 networks.
Purpose of CDP –Cisco Discovery Protocol (CDP) is a powerfulnetwork monitoring and troubleshooting tool.
•CDP runs at the Data Link layer connecting the physicalmedia to the upper-layer protocols (ULPs).
•Because CDP operates at the Data Link layer, two or moreCisco network devices, such as routers that support differentNetwork layer protocols (for example, IP and Novell IPX), canlearn about each other.
– A layer 2 cisco proprietary tool used to gather informationabout other directly connected Cisco devices.
•enables you to access a summary of protocol and addressinformation about Cisco devices that are directly connected.
Routing Table and CDP Protocol Concept of neighbors
-2 types of neighbors
Layer 3 neighbors
At Layer 3, routing protocols consider neighbors to bedevices that share the same network address space.
R1 and R2 are neighbors. Both are members of the172.16.1.0/24 network.
R2 and R3 are also neighbors because they both sharethe 192.168.1.0/24 network.
But R1 and R3 are not neighbors because they do notshare any network address space.
Layer 2 neighbors
CDP operates at Layer 2 only. Therefore, CDP
neighbors are Cisco devices that are directlyconnected 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 andLayer 3 neighbors. The switches are notneighbors to the routers at Layer 3, becausethe switches are operating at Layer 2 only.However, the switches are Layer 2 neighbors
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 stubnetwork
• A stub network is a network accessed by a single route.
•For an example, here we see that anynetwork 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 astub network and R1 is a stub router.•Running a routing protocol between R1and R2 is a waste of resources
Principle 1: "Every router makes its decision alone, based on the information it hasin its own routing table.“
R1 has three static routes in its routing table and makes forwarding decisionsbased 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 thenetwork administrator.
Principle 2: "The fact that one router has certain information in its routing table doesnot mean that other routers have the same information.“
The network administrator would be responsible for ensuring that the next-hoprouter 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 notprovide routing information about the reverse, or return path.“
Most of the communication over networks is bidirectional. This means thatpackets 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.
Resolving to an Exit Interface-Recursive route lookup - Occurs when the router has to perform multiplelookups in the routing table before forwarding a packet. A static route thatforwards all packets to the next-hop IP address goes through the followingprocess (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 route192.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 thedirectly connected network 172.16.2.0/24 with the exit interface of Serial 0/0/0.
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
–The routing table can resolve the exit interfacein a single search instead of 2 searches
If the static route cannot be resolved to an
exit interface, the static route is removed fromthe routing table
–Notice from the debug output that all threestatic routes were deleted when the Serial 0/0/0interface 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'srunning configuration. If the interface comesback up (is enabled again with no shutdown),the IOS routing table process will reinstall thesestatic routes back into the routing table.
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 withthe left-most bit.
3. Work your way to the right, finding all the bits thatmatch 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 becomesyour subnet mask for the summarized route, /22 or 255.255.252.0
6. To find the network address for summarization, copythe matching 22 bits and add all 0 bits to the end tomake 32 bits.
By following these steps, we can discover that the 3static routes on R3 can be summarized into a singlestatic route, using the summary network address of 172.16.0.0 255.255.252.0:
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 therouting 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. ThisIP 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 matchwill be used.
Like route summarization this will help reducethe size of the routing table
Default static routes are used: –When no other routes in the routing table match thepacket's destination IP address. A common use iswhen connecting a company's edge router to the ISPnetwork.
–When a router has only one other router to which itis connected. This condition is known as a stubrouter.
Configuring a default static route
Similar to configuring a static route. Exceptthat destination IP address and subnet maskare all zeros
-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 DCELANs
Straight through cables or cross over cables are used toconnect to fastethernet port. (The type of cable used dependson what devices are being connected)
Cisco Discovery Protocol
A layer 2 proprietary protocol
Used to discover information about directly connected Ciscodevices