It010 707 (Reference) Internetworking Lab
It010 707 (Reference) Internetworking Lab
AND TECHNOLOGY
Department of Information Technology
July-October 2013
Semester VII
INTERNETWORKING LAB
Familiarization of Network hardware such as NIC, Hub, Bridge, Switch, Router etc.
Design, Configure and implement a WAN scenario which explains all concepts discussed
above.
Router#show history
The routers Command Line Interface (CLI) maintains by default the last 10 commands you
have entered in memory .
You can retrieve previous commands by pressing UP Arrow Key
You can retrieve next commands by pressing Down Arrow Key
Router#show protocols
Use this command to view the status of the current layer 3 routed protocols running on your
router
Router#show version
Cisco IOS Software, 1841 Software (C1841-ADVIPSERVICESK9-M), Version
12.4(15)T1,
RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Wed 18-Jul-07 04:52 by pt_team
Use this command to know about running routing protocols. This will give the complete status
about routing protocols likes on which interface its receiving updates and on which interface
its broadcasting update what is time intervals
press enter to get back router prompt
Router>
You are now in User mode. Type ? to view all the available commands at this prompt.
Router>?
From privilege mode you can enter in configuration mode by typing configure terminal you
can exit configuration mode type exit or <CTL>+z
Router>enable
Router#config terminal
Router(config)#exit
Router#
To view all commands available from this mode type: ? and press: enter This will give you the
list of all available commands for the router in your current mode. You can also use the
question mark after you have started typing a command. For example if you want to use a
show command but you do not remember which one it uses 'show ?' will output all commands
that you can use with the show command.
Router#show ?
access-expression List access expression
access-lists List access lists
backup Backup status
cdp CDP information
clock Display the system clock
cls DLC user information
compress Show compression statistics
configuration Contents of Non-Volatile memory
Click inside the Router and select CLI and press Enter to get started. Setup mode start
automatically if there is no startup configuration present. The answer inside the square
brackets [ ], is the default answer. If this is the answer you want, just press enter.
Pressing CTRL+C at any time will end the setup process, shut down all interfaces, and take
you to user mode(Router>).
You cannot use setup mode to configure an entire router. It does only the basics. For
example, you can only turn on either RIPv1 or Interior Gateway Routing Protocol (IGRP), but
not Open Shortest Path First Protocol (OSPF) or Enhanced Interior Gateway Routing Protocol
(EIGRP). You cannot create access control lists (ACL) here or enable Network Address
Translation (NAT). You can assign an IP address to an interface, but not to a subinterface. All
in all, setup mode is very limiting.
--- System Configuration Dialog --- Continue with configuration
dialog? [yes/no]:
Write no and press enter. To get router prompt
You are now connected to Router and are in user mode prompt. The prompt is broken down
into two parts, the hostname and the mode. "Router" is the
Router0's hostname and ">" means you are in user mode.
Press RETURN to get started
Router>
User mode is indicated with the '>' next to the router name. in this mode you can look at
settings but can not make changes.
In Privilege mode(indicated by the '#', you can do anything). To get into privilege mode the
keyword is enable.
Next type the command enable to get to the privileged mode prompt.
Router > enable
Router#
To get back to the user mode, simply type disable. From the user mode
type logout or exit to leave the router.
Router#disable
Router>
Router>exit
Router con0 is now available
Press RETURN to get started
press enter to get back router prompt
Router>
You are now in User mode. Type ? to view all the available commands at this prompt.
Router>?
From privilege mode you can enter in configuration mode by typing configure terminal you
can exit configuration mode type exit or <CTL>+z
Router>enable
Router#config terminal
Router(config)#exit
Router#
To view all commands available from this mode type ? and press enter This will give you the
list of all available commands for the router in your current mode. You can also use the
question mark after you have started typing a command. For example if you want to use
a show command but you do not remember which one it uses 'show ?' will output all
commands that you can use with the show command.
Router#show ?
access-expression List access expression
access-lists List access lists
backup Backup status
cdp CDP information
clock Display the system clock
cls DLC user information
compress Show compression statistics
configuration Contents of Non-Volatile memory
--More--
Basic Global Configurations mode Commands
Configuring a Router Name
This command works on both routers and switches
Router(config)#hostname Lucknow Lucknow(config)#
You could choose any descriptive name for your cisco devices
Configuring Passwords
This command works on both routers and switches
255.255.255.0 interface
Routing is the process of selecting paths in a network along which to send network
traffic and route is the path to send the network traffic. There are two ways a router
learn a route: static and dynamic. A static route is a route that is manually configured
on the router. Simply we can say a static route is a route that is created manually by a
network administrator. The information about the networks that are
directly connected to the active router interfaces is added to the routing table initially
and they are known as connected routes. The second way that the router can learn
static routes are by configuring the routes manually. Dynamic routes are routes that a
router learns by using a routing protocol. Routing protocols will learn about routes
from other neighbouring routers running the same routing protocol. Dynamic routing
protocols share network numbers a router knows about and how to reach these
networks. Through this sharing process, a router can learn about all of the reachable
network numbers in the network.
Set the clock rate for a router with a DCE cable to 64K Router(config-if)clock rate 64000
Shows all logs that the router has in its memory show log
View type of serial cable on s0 show controllers 0 (note the space between the 's' and
the '0')
Display access lists, this includes the number of displayed show access-lists
matches
Check the router can see the ISDN switch show isdn status
A static route is a manually configured route on your router. Static routes are typically
used in smaller networks and when few networks or subnets exist, or with WAN links
that have little available bandwidth. With a network that has hundreds of routes, static
routes are not scalable, since you would have to configure each route and any
redundant paths for that route on each router.
1841 Series Router0 (R1)
FastEthernet0/0 Serial0/0/0
IP address 10.0.0.1 20.0.0.1
Connected With Pc0 R2 on Serial 0/0
2811 Series Router0 (R4)
FastEthernet0/0 Serial0/0/0
IP address 50.0.0.1 40.0.0.2
Connected With Pc1 R3 on Serial 0/0
2621XM Series Router0 (R3)
FastEthernet0/0 Serial0/0/0
IP address 30.0.0.2 40.0.0.1
Connected R4 on Serial
FastEthernet0/0
With 0/0/0
2620XM Series Router1 (R2)
FastEthernet0/0 Serial0/0
IP address 30.0.0.1 20.0.0.2
Connected R3 on R1 on Serial
With FastEthernet0/0 0/0/0
PC-PT PC0
Default
FastEthernet0
Gateway
IP address 10.0.0.2 10.0.0.1
Connected R1 on
With FastEthernet0/0
PC-PT PC1
Default
FastEthernet0
Gateway
IP address 50.0.0.2 50.0.0.1
Connected R4 on
With FastEthernet0/0
To configure any router double click on it and select CLI.To configure this topology use this
step by step guide.
(1841Router0) Hostname R1
To configure and enable static routing on R1 follow these commands exactly.
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#interface fastethernet 0/0
R1(config-if)#ip address 10.0.0.1 255.0.0.0
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0,
changed state to up
R1(config-if)#exit
R1(config)#interface serial 0/0/0
R1(config-if)#ip address 20.0.0.1 255.0.0.0
R1(config-if)#clock rate 64000
R1(config-if)#bandwidth 64
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
R1(config-if)#exit
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
R1(config)#ip route 30.0.0.0 255.0.0.0 20.0.0.2
R1(config)#ip route 40.0.0.0 255.0.0.0 20.0.0.2
R1(config)#ip route 50.0.0.0 255.0.0.0 20.0.0.2
(2620XM-Router1) Hostname R2
To configure and enable static routing on R2 follow these commands exactly.
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#interface serial 0/0
R2(config-if)#ip address 20.0.0.2 255.0.0.0
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed
state to up
R2(config-if)#exit
R2(config)#interface fastethernet 0/0
R2(config-if)#ip address 30.0.0.1 255.0.0.0
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
R2(config-if)#exit
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0,
changed state to up
R2(config)#ip route 10.0.0.0 255.0.0.0 20.0.0.1
R2(config)#ip route 40.0.0.0 255.0.0.0 30.0.0.2
R2(config)#ip route 50.0.0.0 255.0.0.0 30.0.0.2
(2620XM-Router2)Hostname R3
To configure and enable static routing on R3 follow these commands exactly.
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R3
R3(config)#interface fastethernet 0/0
R3(config-if)#ip address 30.0.0.2 255.0.0.0
R3(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0,
changed state to up
R3(config-if)#interface serial 0/0
R3(config-if)#ip address 40.0.0.1 255.0.0.0
R3(config-if)#clock rate 64000
R3(config-if)#bandwidth 64
R3(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0, changed state to down
R3(config-if)#exit
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed
state to up
R3(config)#ip route 10.0.0.0 255.0.0.0 30.0.0.1
R3(config)#ip route 20.0.0.0 255.0.0.0 30.0.0.1
R3(config)#ip route 50.0.0.0 255.0.0.0 40.0.0.2
(2811Router3) Hostname R4
To configure and enable static routing on R4 follow these commands exactly.
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 40.0.0.2 255.0.0.0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed
state to up
Router(config-if)#exit
Router(config)#interface fastethernet 0/0
Router(config-if)#ip address 50.0.0.1 255.0.0.0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0,
changed state to up
Router(config-if)#exit
Router(config)#ip route 10.0.0.0 255.0.0.0 40.0.0.1
Router(config)#ip route 20.0.0.0 255.0.0.0 40.0.0.1
Router(config)#ip route 30.0.0.0 255.0.0.0 40.0.0.1
PC-1
PC>ipconfig
IP Address......................: 10.0.0.2
Subnet Mask.....................: 255.0.0.0
Default Gateway.................: 10.0.0.1
PC>ping 50.0.0.2
IP Address......................: 50.0.0.2
Subnet Mask.....................: 255.0.0.0
Default Gateway.................: 50.0.0.1
PC>ping 10.0.0.2
To test static routing do ping from pc1 to pc2 and vice versa.
Implementing dynamic routing using RIP
RIP Routing information protocol
Routing Information Protocol (RIP) is a standards-based, distance-vector, interior gateway
protocol (IGP) used by routers to exchange routing information. RIP uses hop count to
determine the best path between two locations. Hop count is the number of routers the packet
must go through till it reaches the destination network. The maximum allowable number of
hops a packet can traverse in an IP network implementing RIP is 15 hops.
it has a maximum allowable hop count of 15 by default, meaning that 16 is deemed
unreachable. RIP works well in small networks, but it's inefficient on large networks with slow
WAN links or on networks with a large number of routers installed.
In a RIP network, each router broadcasts its entire RIP table to its neighboring routers every
30 seconds. When a router receives a neighbor's RIP table, it uses the information provided
to update its own routing table and then sends the updated table to its neighbors.
RIP Timers
RIP uses four different kinds of timers to regulate its performance:
Route update timer
Sets the interval (typically 30 seconds) between periodic routing updates in which the router
sends a complete copy of its routing table out to all neighbors.
Route invalid timer
Determines the length of time that must elapse (180 seconds) before a router determines that
a route has become invalid. It will come to this conclusion if it hasn’t heard any updates about
a particular route for that period. When that happens, the router will send out updates to all its
neighbors letting them know that the route is invalid.
Holddown timer
This sets the amount of time during which routing information is suppressed. Routes will enter
into the holddown state when an update packet is received that indicated the route is
unreachable. This continues either until an update packet is received with a better metric or
until the holddown timer expires. The default is 180 seconds.
Route flush timer
Sets the time between a route becoming invalid and its removal from the routing table (240
seconds). Before it's removed from the table, the router notifies its neighbors of that route's
impending failure. The value of the route invalid timer must be less than that of the route flush
timer. This gives the router enough time to tell its neighbors about the invalid route before the
local routing table is updated.
RIP is a dynamic, distance vector routing protocol based around the Berkely BSD application routedand
was developed for smaller IP based networks. RIP uses UDP port 520 for route updates. RIP calculates
the best route based on hop count. Like all distance vector routing protocols, RIP takes some time to
converge. While RIP requires less CPU power and RAM than some other routingprotocols, RIP does
have some limitations:
Metric: Hop Count
Since RIP calculates the best route to a destination based solely on how many hops it is to the
destination network, RIP tends to be inefficient in network using more than one LANprotocol, such as
Fast Ethernet and serial orToken Ring. This is because RIP prefers paths with the shortest hop count.
The path with the shortest hop count might be over the slowest link in the network.
Hop Count Limit
RIP cannot handle more than 15 hops. Anything more than 15 hops away is considered unreachable by
RIP. This fact is used by RIP to prevent routing loops.
Classful Routing Only
RIP is a classful routing protocol. RIP cannot handle classless routing. RIP v1 advertises allnetworks it
knows as classful networks, so it is impossible to subnet a network properly viaVLSM if you are running
RIP v1, which
However, it must be pointed out that RIP is the only routing protocol that all routing devices and
software support, so in a mixed equipment environment, RIP may be your only option fordynamic
routing. This is changing with the widespread use of OSPF.
RIP is a relatively old but still commonly used interior gateway protocol created for use in small,
homogeneous networks. It is a classical distance-vector routing protocol. RIP is documented in
RFC 1058.
RIP uses broadcast User Datagram Protocol (UDP) data packets to exchange routing information.
Cisco IOS software sends routing information updates every 30 seconds, which is termed advertising. If
a router does not receive an update from another router for 180 seconds or more, it marks the routes
served by the nonupdating router as being unusable. If there is still no update after 240 seconds, the
router removes all routing table entries for the nonupdating router.
The metric that RIP uses to rate the value of different routes is hop count. The hop count is the number
of routers that can be traversed in a route. A directly connected network has a metric of zero; an
unreachable network has a metric of 16. This small range of metrics makes RIP an unsuitable routing
protocol for large networks.
A router that is running RIP can receive a default network via an update from another router that is
running RIP, or the router can source (generate) the default network itself with RIP. In both cases, the
default network is advertised through RIP to other RIP neighbors.
Cisco IOS software will source the default network with RIP if one of the following conditions is met:
• The ip default-network command is configured.
• The default-information originate command is configured.
• The default route is learned via another routing protocol or static route and then redistributed into
RIP.
RIP sends updates to the interfaces in the specified networks. If the network of an interface network is
not specified, it will not be advertised in any RIP update.
The Cisco implementation of RIP Version 2 supports plain text and Message Digest 5 (MD5)
authentication, route summarization, classless interdomain routing (CIDR), and variable-length subnet
masks (VLSMs).
RIP is a relatively old but still commonly used interior gateway protocol created for use in small,
homogeneous networks. It is a classical distance-vector routing protocol. RIP is documented in
RFC 1058.
RIP uses broadcast User Datagram Protocol (UDP) data packets to exchange routing information.
Cisco IOS software sends routing information updates every 30 seconds, which is termed advertising. If
a router does not receive an update from another router for 180 seconds or more, it marks the routes
served by the nonupdating router as being unusable. If there is still no update after 240 seconds, the
router removes all routing table entries for the nonupdating router.
The metric that RIP uses to rate the value of different routes is hop count. The hop count is the number
of routers that can be traversed in a route. A directly connected network has a metric of zero; an
unreachable network has a metric of 16. This small range of metrics makes RIP an unsuitable routing
protocol for large networks.
A router that is running RIP can receive a default network via an update from another router that is
running RIP, or the router can source (generate) the default network itself with RIP. In both cases, the
default network is advertised through RIP to other RIP neighbors.
Cisco IOS software will source the default network with RIP if one of the following conditions is met:
• The ip default-network command is configured.
• The default-information originate command is configured.
• The default route is learned via another routing protocol or static route and then redistributed into
RIP.
RIP sends updates to the interfaces in the specified networks. If the network of an interface network is
not specified, it will not be advertised in any RIP update.
The Cisco implementation of RIP Version 2 supports plain text and Message Digest 5 (MD5)
authentication, route summarization, classless interdomain routing (CIDR), and variable-length subnet
masks (VLSMs).
RIP TIMERS
TIMER DEFAULT CONTROLS
Timeout 180 sec. Interval a route should stay 'live' in the routing table. This
counter is reset every time the router hears an update for
this route.
Flush 120 sec. How long to wait to delete a route after it has timed out.
The routing-update timer controls the time between routing updates. Default is
usually 30 seconds, plus a small random delay to prevent all RIP routers from
sending updates simultaneously.
The route-timeout timer controls when a route is no longer available. The
default is usually180 seconds. If a router has not seen the route in an update
during this specified interval, it is dropped from the router's announcements. The
route is maintained long enough for therouter to advertise the route as down
(hop count of 16).
The route-flush timer controls how long before a route is completely flushed
from therouting table. The default setting is usually 120 seconds.
Enabling RIP
To enable RIP, use the following commands beginning in global configuration mode:
Command Purpose
Step 1 Router(config)# router rip Enables a RIP routing process,
which places you in router
configuration mode.
To control the set of interfaces with which you want to exchange routing updates, you can disable the
sending of routing updates on specified interfaces by configuring the passive-interface router
configuration command. See the discussion on filtering in the "Filter Routing Information" section in the
"Configuring IP Routing Protocol-Independent Features" chapter.
Adjusting Timers
Routing protocols use several timers that determine such variables as the frequency of routing updates,
the length of time before a route becomes invalid, and other parameters. You can adjust these timers to
tune routing protocol performance to better suit your internetwork needs. You can make the following
timer adjustments:
• The rate (time in seconds between updates) at which routing updates are sent
• The interval of time (in seconds) after which a route is declared invalid
• The interval (in seconds) during which routing information regarding better paths is suppressed
• The amount of time (in seconds) that must pass before a route is removed from the routing table
• The amount of time for which routing updates will be postponed
It also is possible to tune the IP routing support in the software to enable faster convergence of the
various IP routing algorithms, and, hence, quicker fallback to redundant routers. The total effect is to
minimize disruptions to end users of the network in situations where quick recovery is essential.
In addition, an address family can have explicitly specified timers that apply to that address-family (or
VRF) only. The timers basic command must be specified for an address family or the system defaults
for the timers basic command are used regardless of what is configured for RIP routing. The VRF does
not inherit the timer values from the base RIP configuration. The VRF will always use the system default
timers unless explicitly changed using the timers basic command.
To adjust the timers, use the following command in router configuration mode:
Command Purpose
Router(config-router)# timers basic update Adjusts routing
invalid holddown flush[sleeptime] protocol timers.
The preceding task controls the default behavior of RIP. You can override that behavior by configuring a
particular interface to behave differently. To control which RIP version an interface sends, use the
following commands in interface configuration mode, as needed:
:
Command Purpose
Router(config-if)# ip rip Configures an interface to send only RIP
send version 1 Version 1 packets.
Similarly, to control how packets received from an interface are processed, use the
following commands in interface configuration mode, as needed:
Command Purpose
Router(config-if)# ip rip Configures an interface to accept only
receive version 1 RIP Version 1 packets.
An example of Rip Routing configurations. We will use four different series router so you can
get familiar with all different platform. Create a topology as shown in figure.
IP RIP comes in two different versions: 1 and 2. Version 1 is a distance vector protocol and is
defined in RFC 1058. Version 2 is a hybrid protocol and is defined in RFCs 1721 and 1722.
The CCNA exam now primarily focuses on version 2. There are no major differences between
RIPv1 or RIPv2 so far configurations concern.
IP Address......................: 10.0.0.2
Subnet Mask.....................: 255.0.0.0
Default Gateway.................: 10.0.0.1
PC>ping 50.0.0.2
IP Address......................: 50.0.0.2
Subnet Mask.....................: 255.0.0.0
Default Gateway.................: 50.0.0.1
PC>ping 10.0.0.2
Router(config-router)#no network w.x.y.z Removes network w.x.y.z from the RIP routing process.
Router(config-router)#version 2 RIP will now send and receive RIPv2 packets globally.
Router(config-router)#version 1 RIP will now send and receive RIPv1 packets only
Router(config-router)#passive-interface s0/0/0 RIP updates will not be sent out this interface.
Router(config-router)#timers basic 30 90 180 270 90 = Invalid timer (in seconds) 180 = Hold-down timer (in
Advantages
1. It will run on most routers, since it is based on an open standard.
3. It provides fast convergence with triggered, incremental updates via Link State Advertisements
(LSAs).
4. It is a classless protocol and allows for a hierarchical design with VLSM and route
summarization.
Disadvantages:
1. It requires more memory to hold the adjacency (list of OSPF neighbors), topology and routing
tables.
2. To provide scalability OSPF supports two important concepts: autonomous systems and areas.
3. Synchronous serial links, no matter what the clock rate of the physical link is, the bandwidth
always defaults to 1544 Kbps.
4. OSPF uses cost as a metric, which is the inverse of the bandwidth of a link.
Autonomous System
The autonomous system (AS) is a collection of networks, under the same administrative control, that
share the same routing information with each other. An AS is also referred to as a routing
domain. Figure 4-1 shows two ASs: AS A and AS B. An AS can consist of one or more OSPF areas.
Areas
Areas allow the subdivision of an AS into smaller, more manageable networks or sets of adjacent
networks. As shown in Figure 4-1, AS A consists of three areas: area 0.0.0.0, 1.1.1.1, and 1.1.1.2.
OSPF hides the topology of an area from the rest of the AS. An area's network topology is visible only to
routers inside that area; it is not visible to routers outside that area. When OSPF routing is within an
area, it is called intra-area routing. This routing limits the amount of link-state information flooding onto
the network, thereby reducing routing traffic. It also reduces the size of the topology information in each
router, which conserves processing and memory requirements in each router.
Conversely, the routers within an area cannot see detailed network structures outside the area.
Because of this restriction of topological information, you can control traffic flow between areas and
reduce routing traffic when the entire autonomous system is a single routing domain.
Backbone Area
A backbone area is responsible for distributing routing information between the areas of an autonomous
system. When OSPF routing occurs outside of an area, it is called inter-area routing.
The backbone itself has all the properties of an area. It consists of area border routers, and routers and
networks only on the backbone. As shown in Figure 4-1, area 0.0.0.0 is an OSPF backbone area. Note
that any OSPF backbone area has a reserved ID of 0.0.0.0.
Area Border Routers
Area border routers (ABRs) are routers with multiple interfaces that connect directly to networks in two
or more areas. An ABR runs a separate copy of the OSPF algorithm and maintains separate routing
data for each area that is connected to it, including the backbone area. Area border routers also send
configuration summaries for their attached areas to the backbone area, which distributes this
information to other OSPF areas in the autonomous system. In Figure 4-1, there are two ABRs. ABR 1
interfaces area 1.1.1.1 to the backbone area. ABR 2 interfaces the backbone area to area 1.1.1.2, a
stub area.
Note ABRs are always backbone routers. You must configure them to the backbone area.
Stub Area
A stub area is an area that does not accept or distribute detailed network information external to the
area. A stub area has only one router that interfaces the area to the rest of the AS. The area border
router attached to the stub area advertises a single default external route into the area. Routers within a
stub area use this route for destinations outside the autonomous system, as well as for inter-area
routes. This relationship conserves link-state advertisement (LSA) database space that would otherwise
be used to store external LSAs flooded into the area. In Figure 4-1, area 1.1.1.2 is a stub area that is
reached only through area border router 2.
Link-State Databases
OSPF routers advertise routes using LSAs. The link-state database stores the link-state advertisements
from routers throughout the area. The advertisements depict the topology of the autonomous system.
They could include:
• Router links that describe the state and cost of each router's interface to an area
• Network links from the designated router that describe all routes on a segment for multi-access
segments with more than one attached router
• Summarized links from ABRs, that describe networks in the AS but outside an area
• External links from ASBRs that describe destinations external to the AS
All routers that are connected to an area maintain identical routing databases about the area. Routers
that are connected to multiple areas maintain a separate routing database for each attached area.
Instead of each router sending routing information to every other router on the network, OSPF routers
establish adjacencies among neighboring routers. When the link-state databases of two neighboring
routers are synchronized, they are considered adjacent.
OSPF routers collect raw topological data from the LSAs that they receive. Each router then prunes this
data down to a tree of the shortest network paths centered on itself. The router examines the total cost
to reach each router or network node in its domain. By discarding all but the lowest-cost path to each
destination, the router builds a shortest-path tree to each destination, which it uses until the network
topology changes. It is possible to have multiple lowest-cost paths to a destination.
OSPF offers the following features, that are found in a
number of routing protocols:
Start the OSPF routing process and specify your process number.
The process number is an arbitrary number. It is recommended
that the number match on all routers but it is not required. The
process ID number does not have to be the AS number, although
many people confuse that it is.
Configuration Examples
Here is an example of a router configured with the OSPF routing
protocol:
IP Address......................: 10.0.0.2
Subnet Mask.....................: 255.0.0.0
Default Gateway.................: 10.0.0.1
PC>ping 50.0.0.2
IP Address......................: 50.0.0.2
Subnet Mask.....................: 255.0.0.0
Default Gateway.................: 50.0.0.1
PC>ping 10.0.0.2
R4#
You can use show ip route command to troubleshoot ospf network. If you did not see
information about any route checks the router attached with that network.
R4#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B -
BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS
inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Commands Descriptions
Starts OSPF process 1. The process ID is any positive integer value between 1
Router(config)#router ospf 1
and 65,535.
Router(config-router)#network OSPF advertises interfaces, not networks. Uses the wildcard mask to determin
Router(config-if)#ip ospf
Changes the Hello Interval timer to 20 seconds.
hellointerval timer 20
Router(config-if)#ip ospf
Changes the Dead Interval timer to 80 seconds.
deadinterval 80
NOTE: Hello and Dead Interval timers must match for routers to become neighbors
Router#show ip protocol Displays parameters for all protocols running on the router
Router#show ip ospf neighbor Lists all OSPF neighbors and their states
Router#show ip ospf neighbor
Displays a detailed list of neighbors
detail
Router#debug ip ospf adjacency Displays various OSPF states and DR/ BDR election between adjacent routers
Fast convergence
Loop-free topology
EIGRP uses the Diffusing Update Algorithm (DUAL) to update the routing table.
One really unique feature of EIGRP is that it supports three routed protocols: IP, IPX, and
AppleTalk
Hello packets are generated every five seconds on LAN interfaces as multicasts (224.0.0.10).
For EIGRP routers to become neighbors, the following information must match:
The AS number
The K-values (these enable/disable the different metric components)
When two routers determine whether they will become neighbors, they go through the following
process:
The first router generates a Hello with configuration information.
If the configuration information matches, the second router responds with an Update message
with topology information.
The first router responds with an ACK message, acknowledging the receipt of the second's
ACK.
The first router sends its topology to the second router via an Update message.
The second router responds back with an ACK.
You must specify the AS number when configure EIGRP. Even though EIGRP is classless, you must
configure it as a classful protocol when specifying your network numbers with the network command.
EIGRP Terms
Term Definition
Successor The best path to reach a destination within the topology table.
The best backup path to reach a destination within the topology table—multiple successors can
Feasible successor
be feasible for a particular destination.
This is all of the successor routes from the topology table. There is a separate routing table for
Routing table
each routed protocol.
Advertised distance The distance (metric) that a neighboring router is advertising for a specific route.
The distance (metric) that your router has computed to reach a specific route: the advertised
Feasible distance
distance from the neighboring router plus the local router's interface metric.
Contains a list of the EIGRP neighbors and is similar to the adjacencies that are built in OSPF
Neighbor table between the designated router/backup DR and the other routers on a segment. Each routed
protocol (IP, IPX, and AppleTalk) for EIGRP has its own neighbor table.
Similar to OSPF's database, contains a list of all destinations and paths the EIGRP router
Topology table learned—it is basically a compilation of the neighboring routers' routing tables. A separate
IP Address......................: 10.0.0.2
Subnet Mask.....................: 255.0.0.0
Default Gateway.................: 10.0.0.1
PC>ping 50.0.0.2
IP Address......................: 50.0.0.2
Subnet Mask.....................: 255.0.0.0
Default Gateway.................: 50.0.0.1
PC>ping 10.0.0.2
Note:- All routers in the same autonomous system must use the same autonomous system number.
Router(config-router)#network
Specifies which network to advertise in EIGRP.
10.0.0.0
TIP: The bandwidth command is used for metric calculations only. It does not change interface performance.
Router(config-router)#no network
Removes the network from the EIGRP process.
10.0.0.0
Router(config-router)#auto-
Enables auto-summarization for the EIGRP process.
summary
Router(config-router)#no
Turns off the auto-summarization feature.
autosummary
include routes with a metric less than or equal to n times the minimum
Router(config-router)#variance n metric route for that destination, where n is the number specified by the
variance command
NOTE: If a path is not a feasible successor, it is not used in load balancing. EIGRP supports up to six unequal-
cost paths.
Router(config)#interface serial
Enters interface configuration mode.
0/0
Sets the bandwidth of this interface to 256 kilobits to allow EIGRP to make
Router(config-if)#bandwidth 256
a better metric calculation.
Router#show ip eigrp traffic Shows the number and type of packets sent and received
Router#show ip route eigrp Shows a routing table with only EIGRP entries
Router (config-if)# bandwidth XX
Where the "AS" in the above-mentioned command stands for Autonomous System
number. This number should be the same on all routers.
3. Once you are through this stage, next step is to instruct the router in order to
advertise the networks that are directly linked to it. You can do it with the help of
command
Where X.X.X.X is the network id of a network that is linked directly to the router. You
should enter this command for each network directly attached to the router. However, you
can, in a single statement, enter the supernet of a group of subnets. When you do that,
the router will automatically identify the subnets.
Optionally, you can configure the amount of WAN link bandwidth
that an EIGRP router will use with this command:
Router# show ip route
Notice the "D" on the left side of the output. All "D" routes are
EIGRP routes.
Enabling EIGRP
To create an EIGRP routing process, use the following commands beginning in global
configuration mode:
Command Purpose
Step 1 Router(config)# router Enables an EIGRP routing
eigrpautonomous-system process in global configuration
mode.
EIGRP sends updates to the interfaces in the specified networks. If you do not specify the network of an
interface, the interface will not be advertised in any EIGRP update.
To adjust the EIGRP metric weights, use the following command in router
configuration mode:
Command Purpose
Router(config-router)# met Adjusts the EIGRP metric or K value. EIGRP
ric weights tos k1 k2 k3 uses the following formula to determine the
k4 k5 total metric to the network:
metric = [K1*bandwidth + (K2*bandwidth)/(256
- load) + K3*delay] * [K5/(reliability + K4)]
By default, the EIGRP composite metric is a 32-bit quantity that is a sum of the segment delays and the
lowest segment bandwidth (scaled and inverted) for a given route. For a network of homogeneous
media, this metric reduces to a hop count. For a network of mixed media (FDDI, Ethernet, and serial
lines running from 9600 bits per second to T1 rates), the route with the lowest metric reflects the most
desirable path to a destination.
Mismatched K Values
Mismatched K values (EIGRP metrics) can prevent neighbor relationships from being established and
can negatively impact network convergence. The following example explains this behavior between 2
EIGRP peers (ROUTER-A and ROUTER-B).
The following error message is displayed in the console of ROUTER-B because the K values are
mismatched:
*Apr 26 13:48:41.811: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 10.1.1.1 (Ethernet0/0) is
down: K-value mismatch
There are two scenarios where this error message can be displayed:
• The two routers are connected on the same link and configured to establish a neighbor relationship.
However, each router is configured with different K values.
The following configuration is applied to ROUTER-A. The K values are changed with the metric
weights command. A value of 2 is entered for the k1 argument to adjust the bandwidth calculation.
The value of 1 is entered for the k3 argument to adjust the delay calculation.
hostname ROUTER-A!
interface serial 0
ip address 10.1.1.1 255.255.255.0
exit
router eigrp 100
network 10.1.1.0 0.0.0.255
metric weights 0 2 0 1 0 0
The following configuration is applied to ROUTER-B. However, the metric weights command is not
applied and the default K values are used. The default K values are 1, 0, 1, 0, and 0.
hostname ROUTER-B!
interface serial 0
ip address 10.1.1.2 255.255.255.0!
exit
router eigrp 100
network 10.1.1.0 0.0.0.255
The bandwidth calculation is set to 2 on ROUTER-A and set to 1 (by default) on ROUTER-B. This
configuration prevents these peers from forming a neighbor relationship.
• The K-value mismatch error message can also be displayed if one of the two peers has transmitted
a "goodbye" message, and the receiving router does not support this message. In this case, the
receiving router will interpret this message as a K-value mismatch.
A Cisco router that runs a software release that does not support the goodbye message can
misinterpret the message as a K-value mismatch and display the following message:
*Apr 26 13:48:41.811: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 10.1.1.1
(Ethernet0/0) is down: K-value mismatch
Note The receipt of a goodbye message by a nonsupporting peer does not disrupt normal network operation.
The nonsupporting peer will terminate session when the hold timer expires. The sending and receiving
routers will reconverge normally after the sender reloads.
The configuration of the default summary route on Router-B sends a 0.0.0.0/0 summary route to Router-
C and blocks all other routes, including the 10.1.1.0/24 route, from being advertised to Router-C.
However, this also generates a local discard route on Router-B, a route for 0.0.0.0/0 to the null 0
interface with an administrative distance of 5. When this route is created, it overrides the EIGRP learned
default route. Router-B will no longer be able to reach destinations that it would normally reach through
the 0.0.0.0.0/0 route.
This problem is resolved by applying a floating summary route to the interface on Router-B that
connects to Router-C. The floating summary route is applied by applying an administrative distance to
the default summary route on the interface of Router-B with the following statement:
Router(config-if)# ip summary-address eigrp 100 0.0.0.0 0.0.0.0 250
The administrative distance of 250, applied in the above statement, is now assigned to the discard route
generated on Router-B. The 0.0.0.0/0, from Router-A, is learned through EIGRP and installed in the
local routing table. Routing to Router-C is restored.
If Router-A loses the connection to Router-B, Router-B will continue to advertise a default route to
Router-C, which allows traffic to continue to reach destinations attached to Router-B. However, traffic
destined to networks to Router-A or behind Router-A will be dropped when it reaches Router-B.
Figure 47 shows a network with two connections from the core, Router-A and Router-D. Both routers
have floating summary routes configured on the interfaces connected to Router-C. If the connection
between Router-E and Router-C fails, the network will continue to operate normally. All traffic will flow
from Router-C through Router-B to the hosts attached to Router-A and Router-D.
Figure 47
Basic switch configuration
Basic Switch configurations commands
You will need to logon to a switch and become familiar with the different levels of access on
the switch.
User vs. Privileged Mode
User mode is indicated with the > next to the switch name. You can look at settings but can
not make changes from user mode. In Privilege mode, indicated by the #, you can do
anything. To get into privilege mode the keyword is enable.
HELP
To view all commands available from this mode type:?This will give you the list of all available
commands for the switch in your current mode. You can also use the question mark after you
have started typing a command. For example if you want to use a show command but you do
not remember which one it is, use the ? as this will output all commands that you can use with
the show command.
Configuration Mode
From privilege mode you can enter configuration mode by typing config term command you
can exit configuration mode type type end or <CTL>+z
Configuration of Cisco 2960 Switch
To practically implement these command either create a simple topology
[Output is omitted]
Three command can be used to logout from terminal.
Switch>enable
Switch#disable
Switch>exit
[Output is omitted]
show mac address Command will show all detected mac address dynamically and manually
Switch#show mac-address-table
Mac Address Table
-------------------------------------------
[Output is omitted]
To view startup configuration [ Stored in NVRAM] use show startup-config command
Switch#show startup-config
Current configuration : 925 bytes
version 12.2
no service password-encryption
!
hostname Switch
[Output is omitted]
To get information about VLAN configuration use show vlan command
Switch#show vlan
[Output is omitted]
delete command is used to delete all vlan configuration from switch Don’t add space between
flash and vlan.dat Run this exactly shown here adding a space could erase flash entirely
leaving switch blank
Switch#delete flash:vlan.dat
Delete filename [vlan.dat]?
Delete flash:/vlan.dat? [confirm]
%deleting flash:/vlan.dat
Startup configuration can be removed by erase commands
Switch#erase startup-config
Erasing the nvram filesystem will remove all configuration files!
Continue? [confirm]
[OK]
Erase of nvram: complete
%SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
Basic Switch Configuration Step by Step
use configure terminal command to go in global configuration mode
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Now change default switch name to switch 1
Switch(config)#hostname Switch1
Set enable password to vinita and secret to nikki
Switch1(config)#enable password vinita
Switch1(config)#enable secret nikki
Set console password to vinita and enable it by login command. Order of command is
important. Set password before you enable it.
Switch1(config)#line console 0
Switch1(config-line)#password vinita
Switch1(config-line)#login
Switch1(config-line)#exit
Enable 5 telnet session [ vty0 - vty4] for router and set their password to vinita
Switch1(config)#line vty 0 4
Switch1(config-line)#password vinita
Switch1(config-line)#login
Switch1(config-line)#exit
Now set switch ip address to 192.168.0.10 255.255.255.0 and default gateway to 192.168.0.5
Switch1(config)#interface vlan1
Switch1(config-if)#ip address 192.168.0.10 255.255.255.0
Switch1(config-if)#exit
Switch1(config)#ip default-gateway 192.168.0.5
Set a description finance VLAN to interface fast Ethernet 1
Switch1(config)#interface fastEthernet 0/1
Switch1(config-if)#description finance VLAN
By default switch automatically negotiate speed and duplex but you can adjust it manually
Switch1(config-if)#duplex full
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1,
changed state to downSwitch1
(config-if)#duplex auto
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
Switch1(config-if)#duplex half
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1,
changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
Switch1(config-if)#duplex auto
Switch1(config-if)#speed 10
Switch1(config-if)#speed 100
Switch1(config-if)#speed auto
Switch1(config-if)#exit
Switch1(config)#exit
mac address table can be wiped out by clear commands
Switch1#show
Switch1#show mac-address-table
Mac Address Table
-------------------------------------------
The ? works here the same as in a router Used to get the list of all
switch>?
available commands
Displays information about flash memory (will work only for the
switch#show flash:
2900/2950 series).
Creates a locally significant host name of the switch. This is the same
Switch(config)#hostname Switch1
command as the router.
Switch1(config)#
To Set Passwords
Switch(config)#enable password
Vinita Sets the enable password to vinita
Switch(config-line)#line vty 0 4 Enters line vty mode for all five virtual ports
Switch(config)#
Switch(config)#interface vlan1 Enters the virtual interface for VLAN 1, the default VLAN on the switch
Switch(config-if)#ip address Sets the IP address and netmask to allow for remote access to the
192.168.0.10 255.255.255.0
switch
Switch(config-if)#exit
Switch(config)#ip default-gateway
192.168.0.5 Allows IP information an exit past the local network
Switch(config)#interface
fastethernet 0/1 Enters interface configuration mode
Switch(config-if)#description
Finance VLAN Adds a description of the interface
Switch(config)#interface
fastethernet 0/1 Moves to interface configuration mode
Switch(config)#interface
fastethernet 0/1
switch#clear mac address-table Deletes all entries from current MAC address forwarding table
Command descriptions
switch>? The ? works here the same as in a router Used to get the list of all
available commands
switch#show flash: Displays information about flash memory (will work only for the
2900/2950 series).
switch#show interfaces Displays the interface configuration and status of line: up/up, up/down,
admin down.
switch#show interface Displays setting of virtual interface VLAN 1, the default VLAN on the
vlan1 switch.
Switch(config)#hostname Creates a locally significant host name of the switch. This is the same
Switch1 command as the router.
Switch1(config)#
To Set Passwords
Switch(config)#
Switch(config)#interface Enters the virtual interface for VLAN 1, the default VLAN on the switch
vlan1
Switch(config-if)#ip Sets the IP address and netmask to allow for remote access to the switch
address 192.168.0.10
255.255.255.0
Switch(config-if)#exit
Switch(config)#interface
fastethernet 0/1
switch#clear mac address- Deletes all entries from current MAC address forwarding table
table
Trunk Tagging[important]
For VLANs to span across multiple switches, you obviously need to connect the switches to
each other. Although it is possible to simply plug one switch into another using an Access port
just as you would plug in a host or a hub, doing so kills the VLAN-spanning feature and a
bunch of other useful stuff too. A switch-to-switch link must be set up as a trunk link in order
for the VLAN system to work properly. A trunk link is a special connection; the key difference
between an ordinary connection (an Access port) and a Trunk port is that although an Access
port is only in one VLAN at a time, a Trunk port has the job of carrying traffic for all VLANs
from one switch to another. Any time you connect a switch to another switch, you want to
make it a trunk.
Trunking methods create the illusion that instead of a single physical connection between
the two trunking devices, a separate logical connection exists for each VLAN between them.
When trunking, the switch adds the source port's VLAN identifier to the frame so that the
device (typically a switch) at the other end of the trunk understands what VLAN originated this
frame and the destination switch can make intelligent forwarding decisions on not just the
destination MAC address, but also the source VLAN identifier. Since information is added to
the original Ethernet frame, normal NICs will not understand this information and will typically
drop the frame. Therefore, you need to ensure that when you set up a trunk connection on a
switch's interface, the device at the other end also supports the same trunking protocol and
has it configured. If the device at the other end doesn't understand these modified frames or
is not set up for trunking, it will, in most situations, drop them. The modification of these
frames, commonly called tagging.
By default, all VLANs are permitted across a trunk link. Switch-to-Switch trunk links
always require the use of a crossover cable, never a straight-through cable.
Key feature about DTP
A trunk can be created only on a Fast Ethernet or Gigabit Ethernet connection; 10Mb
Ethernet ports are not fast enough to support the increased traffic from multiple VLANs, so
the commands are not available for a regular Ethernet port.
By default, traffic from all VLANs is allowed on a trunk. You can specify which VLANs
are permitted (or not) to cross a particular trunk if you have that requirement, but these
functions are not covered in the CCNA exam.
Switches (whether trunked or not) are always connected with crossover cables, not
straight-through cables.
Dynamic Trunk Protocol (DTP) DTP supports five trunking modes
On or Trunk interface always assumes the connection is a trunk, even if the remote
end does not support trunking.
Desirable the interface will generate DTP messages on the interface, but it make the
assumption that the other side is not trunk-capable and will wait for a DTP message from the
remote side. In this state, the interface starts as an access-link connection. If the remote side
sends a DTP message, and this message indicates that trunking is compatible between the
two switches, a trunk will be formed and the switch will start tagging frames on the interface. If
the other side does not support trunking, the interface will remain as an access-link
connection
Auto-negotiate interface passively listens for DTP messages from the remote side
and leaves the interface as an access-link connection. If the interface receives a DTP
message, and the message matches trunking capabilities of the interface, then the interface
will change from an access-link connection to a trunk connection and start tagging frames
No-negotiate, interface is set as a trunk connection and will automatically tag frames
with VLAN information; however, the interface will not generate DTP messages: DTP is
disabled. This mode is typically used when connecting trunk connections to non-Cisco
devices that don't understand Cisco's proprietary trunking protocol and thus won't understand
the contents of these messages.
Off If an interface is set to off, the interface is configured as an access link. No DTP
messages are generated in this mode, nor are frames tagged.
Create VLAN
PC0 10.0.0.2 VLAN10 Switch1 on F0/1 F0/1 With PC0 VLAN10 Access OK
PC1 20.0.0.2 VLAN20 Switch1 on F0/2 F0/2 With PC1 VLAN20 Access OK
F0/1 With PC0 VLAN10 Access OK F0/1 With PC0 VLAN10 Access OK
F0/2 With PC1 VLAN20 Access OK F0/2 With PC1 VLAN20 Access OK
Spanning-Tree Protocol
In this configuration STP will block these ports F0/24 of S1 , F0/23 and F0/24 of S2 and F0/24
of S3 to avoid loop at layer to two. Verify those ports blocked due to STP functions
Verify STP ports
Switch 2
S2#show spanning-tree active
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0002.174D.7794
Cost 4
Port 26(GigabitEthernet1/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Router on Stick
At this point of configuration you have two successfully running VLAN but they will not
connect each other. To make intra VLAN communications we need to configure router . To do
this double click on router and select CLI.
Configure intra VLAN
Router
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastEthernet 0/0
Router(config-if)#no ip address
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface fastEthernet 0/0.10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 10.0.0.1 255.0.0.0
Router(config-subif)#exit
Router(config)#interface fastEthernet 0/0.20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 20.0.0.1 255.0.0.0
Router(config-subif)#exit
To test connectivity between different vlan do ping form any pc to all reaming pc. it should be
ping successfully.
VLAN VTP Server STP DTP command reference sheet
Switch(config-vlan)#name Assigns a name to the VLAN. The length of the name can be from 1 to 32
Sales
characters.
Switch(config)#interface
fastethernet 0/1 Moves to interface configuration mode
Switch(config-if)#switchport
mode access Sets the port to access mode
Switch(config-if)#switchport
access vlan 10 Assigns this port to VLAN 10
Switch#show vlan name sales Displays information about VLAN named sales only
Switch#show interfaces vlan x Displays interface characteristics for the specified VLAN
Make sure there is no space between the colon (:) and the characters
Switch#delete flash:vlan.dat
Delete filename [vlan.dat]? vlan.dat. You can potentially erase the entire contents of the flash with this
Delete flash:vlan.dat? [confirm]
command if the syntax is not correct. Make sure you read the output from
Switch#
the switch. If you need to cancel, press ctrl+c to escape back to privileged
mode:
Switch(config)#interface
fastethernet 0/5 Moves to interface configuration mode.
Switch(config-if)#no switchport
access vlan 5 Removes port from VLAN 5 and reassigns it to VLAN 1—the default VLAN.
Switch#copy running-config
startupconfig Saves the configuration in NVRAM
Switch(config-if) #switchport Puts the interface into permanent trunking mode and negotiates to convert
mode trunk
the link into a trunk link.
Switch(config)#vtp mode
server Changes the switch to VTP server mode.
Switch(config)#vtp mode
transparent Changes the switch to VTP transparent mode.
Switch(config)#no vtp mode Returns the switch to the default VTP server mode.
Switch(config)#vtp domain Configures the VTP domain name. The name can be from 1 to 32
domain-name
characters long.
Switch#show vtp counters Displays the VTP counters for the switch
VTP, VTP pruning
Home → Workbooks → CCNA → Transparent VTP and VTP Pruning
Real World Application & Core Knowledge
Unlike VTP Server/Client, Transparent mode does not participate in the VTP domain at all however it
transparent mode will pass VTP frame from one switch to the next.
Transparent switches are a perfect solution when placing a managed Cisco switch in the transit path of
two VTP enabled switches, this way The VTP Server and VTP client(s) can still communicate through
the transparent switch and operate correctly
The downfall to transparent switches is that they must have the same VLAN’s IF they are a transit
switch in a VTP domain. A common implementation with a transparent switch in the transit path of
two VTP enabled switches is the requirement for security. The transparent switch needs to have a
specific layer2 or layer 3 enabled VLAN that cannot be anywhere else on the network but still need
access to all other VLAN’s.
Another example being a simple edge transparent switch that is considered strictly an access switch and
does not trunk nor participate in VTP.
For an example lets say you have a three tier network with Core/Distro/Access layers and you have the
VTP server configured on the distribution switches and the VLAN information propagates down to 24
access switches. To get more detailed lets say a twelve floor building with two access switches per
floor. Lets say VLAN 112 is configured on the twelfth floor however due to VTP propagating the
VLAN information to every single access switch, even switches on the first floor will have VLAN 112.
So the big question is, when a host on VLAN 112 sends broadcast traffic, does every single switch
receive the broadcast? The simple answer is yes, as the distro will forward the broadcast out every
trunk link to every access switch except the one it was received on. If you think about it, that is a big
waste of resources. However VTP addresses this issue by a feature called VTP Pruning.
VTP Pruning will “prune” VLAN traffic on inter-switch trunk links if the neighboring switch is not
requesting any traffic destined to that switch. If a switch does not have any ports in VLAN 401, why
does it need the broadcast traffic from 401?, the simple answer is that it doesn’t and when it receive
such traffic; its just a waste of switch resources.
Familiarize yourself with the following commands;
Command Description
This command is executed in global configuration mode on a Cisco Catalyst switch and sets the switch
vtp mode transparent to transparent mode so it does not participate in VTP at all but it does however pass VTP traffic.
This command is executed in global configuration mode on on a Catalyst switch to configure the VTP
server to enable the VTP Pruning feature through out the VTP Domain, this setting is also propagated
vtp pruning to all VTP clients in the domain.
This command can be executed in user or privileged mode to view the current pruning list on a per link
show interface basis.
This command can be executed from user or privileged mode to view the current settings configured
show vtp status for VTP.
This command can be executed from user or privileged mode to view which VLAN’s are being
show interface trunk forwarded down the trunk links and not pruned.
To configure SW2 as a VTP transparent switch you’ll use the vtp mode transparent command in
global configuration; to verify your configuration change you’ll use the show vtp status command in
user or privileged mode as shown below;
SW2 con0 is now available
SW2>enable
SW2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)#vtp mode transparent
SW2(config)#vtp version 2
Setting device to VTP TRANSPARENT mode.
SW2(config)#end
SW2#show vtp status
SW2#show vtp status
VTP Version : running VTP2
Configuration Revision : 0
Maximum VLANs supported locally : 1005
Number of existing VLANs : 8
VTP Operating Mode : Transparent
VTP Domain Name :
VTP Pruning Mode : Disabled
VTP V2 Mode : Enabled
VTP Traps Generation : Disabled
MD5 digest : 0x06 0x97 0x82 0xDA 0x39 0x52 0x1E
0xF2
Configuration last modified by 192.168.255.252 at 0-0-00 00:00:00
SW2#
Step 2. – Configure VTP Pruning on the VTP server verify and that the configuration was propagated
to the VTP Client.
To configure VTP pruning you’ll use the vtp pruning command in global configuration on the VTP
Server only. this setting gets propagated to all VTP clients in the same VTP domain as shown below;
SW1 con0 is now available
SW1>enable
SW1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#vtp pruning
Pruning switched on
SW1(config)#end
SW1#show vtp status
VTP Version : 2
Configuration Revision : 2
Maximum VLANs supported locally : 36
Number of existing VLANs : 8
VTP Operating Mode : Server
VTP Domain Name : CISCO
VTP Pruning Mode : Enabled
VTP V2 Mode : Enabled
VTP Traps Generation : Disabled
MD5 digest : 0x2E 0x9F 0x5E 0x57 0xE3 0x87 0x46
0xFA
Configuration last modified by 10.1.5.1 at 3-1-02 00:10:56
Local updater ID is 10.1.5.1 on interface Vl5 (lowest numbered VLAN
interface found)
SW1#
Show below is the verification that VTP Pruning is being properly propagated to SW3 from the VTP
Server (SW1);
Step 3. – Verify that VTP Pruning is functioning properly by viewing the pruning list on SW1.
To view this information you can use the show interface trunk command in user or privileged mode
as shown below;
SW3#show interface trunk
As shown above from the SW3 show interface trunk output you can see that on port Fa1/13 the
VLAN’s that are forwarding and not pruned on that trunk link are VLAN’s 1 and 10.
When having a transparent switch in a VTP Transit path you obviously must have IP connectivity.
Keep in mind for traffic to pass through the transparent switch, the transparent switch must have the
VLAN configure for the traffic. For example, Traffic from SW1 VLAN 10 going to SW2 VLAN 20,
SW3 must have VLAN10 configured on it or the traffic would get dropped.
You can verify this by pinging SW3′s VLAN 10 interface from SW1 as shown below;
SW1#ping 10.10.13.3
The ping is successful because VLAN 10 is already configured on SW2 as per the lab prerequisites.
However if you remove VLAN 10 from SW2 and try to ping SW3′s VLAN10 interface from SW1
again it will fail as shown below;
SW2#configure terminal
SW2(config)#no vlan 10
SW2(config)#end
SW2#
SW1#ping 10.10.13.3
VTP is a Layer 2 messaging protocol that maintains VLAN configuration consistency by managing the
addition, deletion, and renaming of VLANs on a network-wide basis. VTP minimizes misconfigurations
and configuration inconsistencies that can cause several problems, such as duplicate VLAN names,
incorrect VLAN-type specifications, and security violations.
Before you create VLANs, you must decide whether to use VTP in your network. Using VTP, you can
make configuration changes centrally on one or more switches and have those changes automatically
communicated to all the other switches in the network. Without VTP, you cannot send information about
VLANs to other switches. VTP configuration information is saved in the VTP VLAN database. VTP
learns about the normal-range VLANs (VLAN IDs 1 to 1005).
This section contains information about these VTP parameters:
• The VTP Domain
• VTP Modes
• VTP Advertisements
• VTP Version 2
• VTP Pruning
Caution Before adding a VTP client switch to a VTP domain, always verify that its VTP configuration revision
number is lower than the configuration revision number of the other switches in the VTP domain.
Switches in a VTP domain always use the VLAN configuration of the switch with the highest VTP
configuration revision number. If you add a switch that has a revision number higher than the revision
number in the VTP domain, it can erase all VLAN information from the VTP server and VTP domain.
When you make a change to the VLAN configuration on a VTP server, the change is propagated to all
switches in the VTP domain. VTP advertisements are sent over all IEEE 802.1Q trunk connections. VTP
maps VLANs dynamically across multiple LAN types with unique names and internal index associates.
Mapping eliminates excessive device administration required from network administrators.
If you configure a switch for VTP transparent mode, you can create and modify VLANs, but the changes
are not sent to other switches in the domain, and they affect only the individual switch. However,
configuration changes made when the switch is in this mode are saved in the switch running
configuration and can be saved to the switch startup configuration file.
VTP Modes
You can configure a supported switch to be in one of the VTP modes listed in Table 14-1.
VTP
Mode Description
VTP server In VTP server mode, you can create, modify, and delete VLANs and
specify other configuration parameters (such as the VTP version) for
the entire VTP domain. VTP servers advertise their VLAN
configurations to other switches in the same VTP domain and
synchronize their VLAN configurations with other switches based on
advertisements received over trunk links.
In VTP server mode, VLAN configurations are saved in nonvolatile
RAM (NVRAM). VTP server is the default mode.
VTP client A VTP client behaves like a VTP server, but you cannot create,
change, or delete VLANs on a VTP client.
In VTP client mode, VLAN configurations are not saved in NVRAM.
When the network is configured with the maximum four VLANs, the switch automatically changes from
VTP server or client mode to VTP transparent mode. The switch then operates with the VLAN
configuration that preceded the one that sent it into transparent mode.
VTP Advertisements
Each switch in the VTP domain sends periodic global configuration advertisements from each trunk port
to a reserved multicast address. Neighboring switches receive these advertisements and update their
VTP and VLAN configurations as necessary.
Note Because trunk ports send and receive VTP advertisements, you must ensure that at
least one trunk port is configured on the switch and that this trunk port is connected to
the trunk port of a second switch. Otherwise, the switch cannot receive any VTP
advertisements.
VTP advertisements distribute this global domain information:
• VTP domain name
• VTP configuration revision number
• Update identity and update timestamp
• MD5 digest VLAN configuration, including maximum transmission unit (MTU) size for each VLAN.
• Frame format
VTP advertisements distribute this VLAN information for each configured VLAN:
• VLAN IDs
• VLAN name
• VLAN type
• VLAN state
• Additional VLAN configuration information specific to the VLAN type
VTP Version 2
If you use VTP in your network, you must decide whether to use version 1 or version 2. By default, VTP
operates in version 1.
VTP version 2 supports these features not supported in version 1:
• Token Ring support—VTP version 2 supports Token Ring Bridge Relay Function (TrBRF) and
Token Ring Concentrator Relay Function (TrCRF) VLANs.
• Unrecognized Type-Length-Value (TLV) support—A VTP server or client propagates configuration
changes to its other trunks, even for TLVs it is not able to parse. The unrecognized TLV is saved in
NVRAM when the switch is operating in VTP server mode.
• Version-Dependent Transparent Mode—In VTP version 1, a VTP transparent switch inspects VTP
messages for the domain name and version and forwards a message only if the version and
domain name match. Because VTP version 2 supports only one domain, it forwards VTP messages
in transparent mode without inspecting the version and domain name.
• Consistency Checks—In VTP version 2, VLAN consistency checks (such as VLAN names and
values) are performed only when you enter new information through the CLI, the Cluster
Management Software (CMS), or SNMP. Consistency checks are not performed when new
information is obtained from a VTP message or when information is read from NVRAM. If the MD5
digest on a received VTP message is correct, its information is accepted.
Enabling VTP pruning on a VTP server enables pruning for the entire management domain. Making
VLANs pruning-eligible or pruning-ineligible affects pruning eligibility for those VLANs on that device
only (not on all switches in the VTP domain). See the "Enabling VTP Pruning" section. VTP pruning
takes effect several seconds after you enable it. VTP pruning does not prune traffic from VLANs that are
pruning-ineligible. VLAN 1 and VLANs 1002 to 1005 are always pruning-ineligible; traffic from these
VLANs cannot be pruned.
VTP pruning is not designed to function in VTP transparent mode. If one or more switches in the
network are in VTP transparent mode, you should do one of these:
• Turn off VTP pruning in the entire network.
• Turn off VTP pruning by making all VLANs on the trunk of the switch upstream to the VTP
transparent switch pruning ineligible.
To configure VTP pruning on an interface, use the switchport trunk pruning vlan interface
configuration command (see the "Changing the Pruning-Eligible List" section). VTP pruning operates
when an interface is trunking. You can set VLAN pruning-eligibility, whether or not VTP pruning is
enabled for the VTP domain, whether or not any given VLAN exists, and whether or not the interface is
currently trunking.
Configuring VTP
This section includes guidelines and procedures for configuring VTP. These sections are included:
• Default VTP Configuration
• VTP Configuration Options
• VTP Configuration Guidelines
• Configuring a VTP Server
• Configuring a VTP Client
• Disabling VTP (VTP Transparent Mode)
• Enabling VTP Version 2
• Enabling VTP Pruning
• Adding a VTP Client Switch to a VTP Domain
Introduction
VLANs divide broadcast domains in a LAN environment. Whenever hosts in one VLAN need to
communicate with hosts in another VLAN, the traffic must be routed between them. This is known as
inter-VLAN routing. On Catalyst switches it is accomplished by creating Layer 3 interfaces (Switch
virtual interfaces (SVI) ). This document provides the configuration and troubleshooting steps applicable
to this capability.
Note: This document uses a Catalyst 3550 as an example. However, the concepts can also be applied
to other Layer 3 switches that run Cisco IOS® (for example, Catalyst 3560, 3750, Catalyst 4500/4000
Series with Sup II+ or later, or Catalyst 6500/6000 Series that run Cisco IOS System software).
Prerequisites
Requirements
Catalyst switch models 3560, 3750, Catalyst 4500/4000 Series with Sup II+ or later, or Catalyst
6500/6000 Series that run Cisco IOS system software support basic InterVLAN routing features in all
their supported software versions. Before you attempt this configuration on a 3550 series switch, ensure
that you meet these prerequisites:
This document assumes that Layer 2 has been configured and that the devices within the
same VLAN connected to the 3550 communicate with one another. If you need information on
configuring VLANs, access ports and trunking on the 3550, refer to Creating Ethernet VLANs on
Catalyst Switches or the Catalyst 3550 Software Configuration Guide for the specific IOS version
you run on the switch.
Components Used
The information in this document is based on these software and hardware versions:
Catalyst 3550-48 that runs Cisco IOS Software Release 12.2(44)SE6 EMI
The information presented in this document was created from devices in a specific lab environment. All
of the devices used in this document started with a cleared (default) configuration. If you are working in
a live network, ensure that you understand the potential impact of any command before using it.
Conventions
For more information on document conventions, refer to the Cisco Technical Tips Conventions.
This logical diagram explains a simple interVLAN routing scenario. The scenario can be expanded to
include a multi-switch environment by first configuring and testing inter-switch connectivity across the
network before configuring the routing capability.
Step-by-Step Instructions
Complete these steps to configure a switch to perform interVLAN routing.
1. Enable routing on the switch by using the ip routing command. Even if IP routing was
previously enabled, this step ensures that it is activated.
2. Switch(config)#ip routing
Note: If the switch does not accept the ip routing command, upgrade to either SMI image
Cisco IOS Software Release12.1(11)EA1 or later, or an EMI image, and repeat this step.
hostname Switch
!
!
ip subnet-zero
ip routing
!
vtp domain Cisco
vtp mode transparent
3. Make note of the VLANs that you want to route between. In this example, you want to route
traffic between VLANs 2, 3 and 10.
4. Use the show vlan command to verify that the VLANs exist in the VLAN database. If they do
not exist, add them on the switch. This is an example of adding VLANs 2, 3, and 10 to the
switch VLAN database
5. Switch#vlan database
6. Switch(vlan)#vlan 2
7. VLAN 2 added:
8. Name: VLAN0002
9. Switch(vlan)#vlan 3
10. VLAN 3 added:
11. Name: VLAN0003
12. Switch(vlan)#vlan 10
13. VLAN 10 added:
14. Name: VLAN0010
15. Switch(vlan)#exit
16. APPLY completed.
Exiting....
Tip: You can use VLAN Trunking Protocol (VTP) to propagate these VLANs to other switches.
17. Determine the IP addresses you want to assign to the VLAN interface on the switch. For the
switch to be able to route between the VLANs, the VLAN interfaces must be configured with an
IP address. When the switch receives a packet destined for another subnet/VLAN, the switch
looks at the routing table to determine where to forward the packet. The packet is then passed
to the VLAN interface of the destination. It is in turn sent to the port where the end device is
attached.
18. Configure the VLAN interfaces with the IP address identified in step 4.
24. Configure the interface to the default router. In this scenario you have a Layer 3 FastEthernet
port.
25. Switch(config)#interface FastEthernet 0/1
26. Switch(config-if)#no switchport
27. Switch(config-if)#ip address 200.1.1.1 255.255.255.0
28. Switch(config-if)#no shutdown
The no switchport command makes the interface Layer 3 capable. The IP address is in the
same subnet as the default router.
Note: This step can be omitted if the switch reaches the default router through a VLAN. In its
place, configure an IP address for that VLAN interface.
From the diagram in the Task section, note that the IP address of the default router is
200.1.1.2. If the switch receives a packet for a network not in the routing table, it forwards it to
the default gateway for further processing. From the switch, verify that you can ping the default
router.
31. Configure your end devices to use the respective Catalyst 3550 VLAN interface as their default
gateway. For example, devices in VLAN 2 should use the interface VLAN 2 IP address as its
default gateway. Refer to the appropriate client configuration guide for more information on
how to designate the default gateway.
Verify
This section provides the information to confirm that your configuration works properly.
Note that the routing table has an entry for each VLAN interface subnet. Therefore, devices in
VLAN 3 can communicate with devices in VLAN 10, VLAN 2 and vice versa. The default route
with the next hop 200.1.1.2 allows the switch to forward traffic to the gateway of last resort (for
traffic the switch cannot route).
show ip interface brief - Lists a brief summary of an interface's IP information and status. This
command is used to verify that the VLAN interfaces and ports on the switch are up/up.
If a switch supports multiple VLANs but has no Layer 3 capability to route packets between those VLANs, the
switch must be connected to a router external to the switch. This setup is accomplished most efficiently by
providing a single trunk link between the switch and the router that can carry the traffic of multiple VLANs and
which, in turn, can be routed by the router. This single physical link must be Fast Ethernet or greater to
support Inter-Switch Link (ISL) encapsulation, but 802.1Q is supported on 10-Mbps Ethernet router interfaces.
In Figure , the clients on VLAN10 need to establish sessions with a server that is in VLAN20, which requires
that traffic be routed between the VLANs. Figure describes the actions necessary for traffic to be routed
between VLANs using an external router.
With inter-VLAN routing, the router receives frames from the switch with the source VLAN tagged (for example
VLAN10). It associates the frames with the proper subinterface and then decodes the frame payload (the IP
packet). The router then performs Layer 3 processing based on the destination network address contained in
the IP packet to determine which subinterface should forward the IP packet. The IP packet is now
encapsulated in a dot-1Q (or ISL) frame that is tagged with the VLAN identification (for example VLAN20) of
the forwarding subinterface and transmitted across the trunk toward the switch.
In Figure , the router can receive packets on one VLAN and forward them to another. To perform inter VLAN
routing functions, the router must know how to reach all VLANs that are being interconnected. The router must
have a separate logical connection (subinterface) for each VLAN and ISL or 802.1Q trunking must be enabled
on the single physical interface between the router and the switch. The routing table lists all the subnets
associated with the VLANs that are configured on the router subinterfaces as directly connected. The router
must learn routes to networks that are not configured on directly connected interfaces through dynamic routing
protocols or static routes.
Implementation is simple.
Layer 3 services are not required on the switch.
o Latency is higher than on a Layer 3 switch.
You can configure inter-VLAN routing using an external router over either ISL or 802.1Q trunks. The
commands for configuring the trunk interface on the router are shown in Figure . Figure provides a
description of the commands.
A router interface providing inter-VLAN routing on a trunk link must be configured with a subinterface for each
VLAN that will be serviced across the link. Each subinterface on the physical link must then be configured with
the same trunk encapsulation protocol. That protocol, either 802.1Q or ISL, is typically determined by what
was configured on the switch side of the link.
Since traffic on the native VLAN is not tagged, all native VLAN frames are received as normal Ethernet
frames, so it is not necessary to define a specific encapsulation tag for those networks. Some versions of
Cisco IOS allow for the creation of a subinterface for the native VLAN. If the native VLAN is configured as a
subinterface, you should use the encapsulation dot1q native command. All other non-native VLANs have an
802.1Q tag inserted into their frames. These non-native VLANs should always be configured as subinterfaces
on the router, and the VLANs must be defined as 802.1Q tagged frames and have the VLAN associated to
them identified. The subinterface command encapsulation dot1q accomplishes this task.
The VLAN subnets are directly connected to the router. Routing between these subnets does not require a
dynamic routing protocol, because the subnets are directly connected. Routes to the subnets associated with
each VLAN appear in the routing table as directly connected interfaces.
The native keyword is not used with the encapsulation ISL subinterface command, because ISL does not
have the concept of a native VLAN.
Figure describes the actions needed to perform ISL encapsulation on external routers.
After the router is properly configured and connected to the network, the router or the switch can communicate
with other nodes on the network.
Switch#ping destination-ip-address
Step 1 From the router, ping a host address on each VLAN to verify router connectivity.
Step 2 From a host on a particular VLAN, ping a host on another VLAN to verify routing across the external
router.
Destination unreachable: This response occurs if the default gateway cannot reach the specified
network or is being blocked.
Network or host unreachable: This response occurs if the Time to Live (TTL) times out. The
default is 2 seconds.
Use show commands to display the current (running) configuration, IP routing information, and IP protocol
information to verify whether the routing table represents the subnets of all VLANs.
Router#show vlans
Virtual LAN ID: 10 (Inter Switch Link Encapsulation)
vLAN Trunk Interface: FastEthernet0/0.10
Protocols Configured: Address: Received: Transmitted:
IP 10.10.1.1 0 20
Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 2 subnets
C 10.10.1.0 is directly connected, FastEthernet0/0.10
C 10.20.1.0 is directly connected, FastEthernet0/0.20
Traditionally, a switch makes forwarding decisions by looking at the Layer 2 header, whereas a router makes
forwarding decisions by looking at the Layer 3 header.
A multilayer switch combines the functionality of a switch and a router into one device, therefore enabling the
device to switch traffic when the source and destination are in the same VLAN and to route traffic when the
source and destination are in different VLANs (that is, different subnets).
In Figure , traffic between PC A and PC B are switched at Layer 2, whereas traffic between PC B and PC C
are switched at Layer 3.
Multilayer switches forward frames and packets at wire speed by using application-specific integrated circuit
(ASIC) hardware. Specific Layer 2 and Layer 3 components, such as routing tables or access control lists
(ACLs), are cached into hardware. These tables are stored in content-addressable memory (CAM) and ternary
content-addressable memory (TCAM).
Layer 2 forwarding in hardware is based on the destination MAC address. The Layer 2 switch learns and
records the source MAC addresses from all frames that it receives. The MAC address table lists MAC
addresses paired with the associated VLANs and interfaces. When a frame is received on an interface, the
switch determines which VLAN the frame originated from, searches all interfaces that belong to that VLAN for
the destination MAC, and forwards the frame out the appropriate interface.
Frame Rewrite
Figure shows how the frame and packet header would be altered if CEF is used to forward frames. When
frames are received on an interface, the trailer checksum is first calculated to verify accurate delivery of the
frame. The frame is discarded if the calculation is not accurate. Next the payload is extracted. The IP header
checksum is tested to verify that it is an accurate IP header. Once the packet is processed, IP unicast packets
are rewritten on the output interface as follows:
The source MAC address changes from the sender MAC address to the router MAC address.
The destination MAC address changes from the router MAC to the next-hop MAC address.
The TTL is decremented by one and, as a result, the IP header checksum is recalculated.
Routing, switching, ACL, and QoS tables are stored in a high-speed table memory so that forwarding
decisions and restrictions can be made in high-speed hardware. Cisco Catalyst switches create and use two
primary table architectures:
CAM table: Primary table used to make Layer 2 forwarding decisions. The table is built by recording
the source address and inbound port of all frames. When a frame arrives at the switch with a
destination MAC address of an entry in the CAM table, the frame is forwarded out only through the
port associated with that specific MAC address.
TCAM table: Stores ACL, QoS, and other information generally associated with upper-layer
processing.
Table lookups are done with efficient search algorithms. A “key” is created to compare the frame to the table
content. For example, the destination MAC address and VLAN ID (VID) of a frame constitute the key for a
Layer 2 table lookup. This key is fed into a hashing algorithm, which produces a pointer into the table. The
system uses the pointer to access a smaller specific area of the table without requiring searching the entire
table.
In a Layer 2 table, all bits of all information are significant for frame forwarding (for example, VLANs,
destination MAC addresses, and destination protocol types). However, in more complicated tables associated
with upper-layer forwarding criteria, some bits of information may be too inconsequential to analyze. For
example, an ACL may require a match on the first 24 bits of an IP address, but the last 8 bits may be
insignificant information.
In specific high-end switch platforms, the TCAM is a portion of memory designed for rapid, hardware-based
table lookups of Layer 3 and Layer 4 information. In the TCAM, a single lookup provides all Layer 2 and Layer
3 forwarding information for frames, including CAM and ACL information.
Figure displays the ACL information stored in the TCAM table that would result in a packet being permitted
or denied.
TCAM matching is based on three values: 0, 1, or X (where X is either number), hence the term “ternary.” The
memory structure is broken into a series of patterns and masks. Masks are shared among a specific number
of patterns and are used as wildcards in some content fields.
The following two ACL entries are referenced in Figure , which shows how their values are stored in the
TCAM:
The TCAM table entries in Figure consist of the following types of regions:
Longest match region: Each longest match region consists of groups of Layer 3 address entries
(“buckets”) organized in decreasing order by mask length. All entries within a bucket share the same
mask value and key size. The buckets can change their size dynamically by borrowing address
entries from neighboring buckets. Although the size of the whole protocol region is fixed, you can
reconfigure it. The reconfigured size of the protocol region takes effect only after the next system
reboot.
First-match region: The first-match region consists of ACL entries. Lookup stops after the first
match of the entry.
Backup and recovery of configuration files of
a router using TFTP server
Use TFTP to Backup your Cisco Router
Configurations
Just like any important server on your network, Cisco routers and switches need to be
periodically backed up. You don’t want your router to crash one day, get a replacement,
and spend days trying to recreate the configuration file. To prevent this, make sure you
backup your configurations with TFTP. Let’s find out how to do this.
What is TFTP?
TFTP stands for Trivial File Transfer Protocol. TFTP uses UDP, not
TCP for transferring of files (like FTP does). Because it uses UDP
and UDP is connectionless, TFTP file transfers are not meant for
networks with a lot of latency, like the Internet. However,
because UDP doesn’t use any kind of acknowledgements, it is
also faster than TCP.
You can make a Cisco router a TFTP server and copy files from
other routers to that router. However, storing your backups on a
router isn’t the best idea. You really want your Cisco device
backups on a PC or server that can be backed up to tape. So,
let’s find out how to obtain a Windows TFTP server.
Now that the TFTP server is running, go to the router that you
want to backup the configuration from.
Step 1
Make sure that you can ping the IP address shown on the TFTP
server application from the router. If you cannot, you have a
networking issue and you need to resolve that before you
continue.
Step 2
Step 3
When asked for the name of the TFTP server, type the IP address
shown on the TFTP server console application, like this:
Step 4
When asked for the name of the destination file, you can take the
default by pressing enter, like this:
You should see exclamation points scroll across the screen and a
message that the file was copied, like this:
!!!!!!!!!!
44647 bytes copied in 1.692 secs (26387 bytes/sec)
Router#
You can also back up your router’s IOS file by using a command
like this:
On the TFTP server console, you should see a record that the
transfer completed, like this:
How To Back Up and Restore
Configuration on CISCO Devices
Performing backups often is importnat but also testing them can be invaluable because
you need to make sure that you can rely on them when needed. So let’s start by learning
how to connect to a Cisco router by using telnet and console access. Then we will see
how to perform configuration backup to a TFTP server and how to restore the backup in
case it is needed.
Connecting to a Cisco Router Using Console
Step 1: Attach a console cable to the console port (Rj-45) located at the back of the
router.
Step 2: Open a new HyperTerminal instance from Start-All Programs-Accessories-
Communications-HyperTerminal, enter a random name to this connection and choose
the com port to use for connecting to the router. Adjust the following port settings to the
com port:
Bits per second: 9600
Data bits: 8
Parity: none
Stop bits: 1
Flow control: Hardware
Step 3: After pressing [Enter] a few times you will see the Router> prompt. Go to menu
view-font of the hyperterminal and select courier font with font size 14.
Write enable to enter into privileged mode (after issuing the correct enable secret). Here
are the steps:
[Router name]>
[Router name]>enable
Password: ……….
[Router name]#
Connecting to a Cisco Router Using Telnet
Note that in order to be able to telnet onto a router, a telnet password must have been
configured on the router and also telnet access should not be disabled on the specific
router.
Before installing a new router you must provide a password for the telnet access on the
router, otherwise you will not be able to telnet to it.
Use the console to connect to the router:
[Router name] enable
Password: ……….[insert enable secret here]
[Router name]# sh run
Press [enter] until you see a sentence like: line vty 0 4 (see the example below). Below
this sentence you should see a password. If not then you should provide a password. If a
password is set but no exec line is seen like in the example below, then telnet is blocked
and you shouldunblock it.
Example:
Line vty 0 4
Password surpass
No exec
a. To Provide a telnet Password
Router#config t
Router(Config)#line vty 0 4
Router(Config)#login
Router(Config)#password [password name]
Press [Ctrl][z] and issue sh run to ensure that password has been set
b. To Unblock telnet Access on Router
Router#config t
Router(Config)#line vty 0 4
Router(Config)#exec
C:\>telnet 10.176.100.2
Password: ……….
[Router name]>enable
Password: ……….
[Router name]#
Backing Up Router Configuration
To copy the configuration from the router to the TFTP server you can use the copy run
tftpcommand. It will backup the router configuration thats stored in DRAM. Then you will
be asked to enter the address of the TFTP server and the name of the destination file on
TFTP server like this:
[Router name] #copy run tftp — to copy the running configuration to TFTP server
Address or name of remote host []? 172.16.10.2 — the ip address of TFTP server
Destination filename [routername-confg]? /Backup/Router01.cfg — the folder path on
the server where the configuration file will be stored)
[router name]#copy tftp run — to copy the configuration file from TFTP server to the
running configuration of the router
An ACL should have at least one permit statement; otherwise, all traffic will be
dropped because of the hidden implicit deny statement at the end of every ACL.
No matter what type of ACL you use, though, you can have only one ACL per
protocol, per interface, per direction. For example, you can have one IP ACL inbound
on an interface and another IP ACL outbound on an interface, but you cannot have
two inbound IP ACLs on the same interface.
Access List Ranges
Type Range
IP Standard 1–99
IP Extended 100–199
Configuration Guidelines
Order of statements is important: put the most restrictive statements at the top of the
list and the least restrictive at the bottom.
ACL statements are processed top-down until a match is found, and then no more
statements in the list are processed.
If no match is found in the ACL, the packet is dropped (implicit deny).
Each ACL needs either a unique number or a unique name.
The router cannot filter traffic that it, itself, originates.
You can have only one IP ACL applied to an interface in each direction (inbound and
outbound)—you can't have two or more inbound or outbound ACLs applied to the same
interface. (Actually, you can have one ACL for each protocol, like IP and IPX, applied to an
interface in each direction.)
Applying an empty ACL to an interface permits all traffic by default: in order for an
ACL to have an implicit deny statement, you need at least one actual permit or deny
statement.
Remember the numbers you can use for IP ACLs.Standard ACLs can use numbers
ranging 1–99 and 1300–1999, and extended ACLs can use 100–199 and 2000–2699.
Wildcard mask is not a subnet mask. Like an IP address or a subnet mask, a wildcard
mask is composed of 32 bits when doing the conversion; subtract each byte in the subnet
mask from 255.
There are two special types of wildcard masks:
0.0.0.0 and 255.255.255.255
A 0.0.0.0 wildcard mask is called a host mask
255.255.255.255. If you enter this, the router will cover the address and mask to the keyword
any.
Placement of ACLs
Standard ACLs should be placed as close to the destination devices as possible.
Extended ACLs should be placed as close to the source devices as possible.
Commands for Checking (Standard)Access control list in
routers:
A-L 10 deny host
1. A-L 10 deny 10.0.0.2
2. A-L 10 permit any
3. interface e0
4. ip access-group 10 out
A-L 10 deny network
1. A-L 10 deny 10.0.0.0 255.0.0.0
Commands for Checking (Extended)Access control list in
routers:
A-L 111 deny tcp any host
1. A-L 111 permit ip any any
2. interface e0/0
3. IP access-group 111 in
Configuring PPP
Before you actually configure PPP on a serial interface, we will look at the
commands and the syntax of these commands as shown below. This series of
examples shows you how to configure PPP and some of the options.
1: How to enable PPP on an Interface
To set PPP as the encapsulation method used by a serial or ISDN interface, use
the encapsulation ppp interface configuration command.
R1#config t
R1(config)#interface se 0/0/0
R1(config-if)#encapsulation ppp
R1(config-if)#end
2: How to configure Compression
One of the primary functions of LCP when establishing a PPP session includes
testing of a link to determine whether the link quality is sufficient to use Layer 3
protocols. The command ppp quality{percentage} ensures that the link meets
the quality requirement you set; otherwise, the link closes down.
The percentages are calculated for both incoming and outgoing directions. The
outgoing quality is calculated by comparing the total number of packets and bytes
sent to the total number of packets and bytes received by the destination node.
The incoming quality is calculated by comparing the total number of packets and
bytes received to the total number of packets and bytes sent by the destination
node.
If the link quality percentage is not maintained, the link is deemed to be of poor
quality and is taken down. Link Quality Monitoring (LQM) implements a time lag
so that the link does not bounce up and down.
Use the configuration commands below to monitor the data traffic on the link and
avoids frame looping:
Multilink PPP (also referred to as MP, MPPP, MLP, or Multilink) provides a method
for spreading traffic across multiple physical WAN links while providing packet
fragmentation and reassembly, proper sequencing, multivendor interoperability,
and load balancing on inbound and outbound traffic.
Use the following commands to perform load balancing across multiple links:
R1#config t
R1(config)#interface se0/0/0
R1(config-if)#encapsulation ppp
R1(config-if)#ppp multilink
R1(config-if)#end
The multilink command has no arguments. To disable PPP multilink, use the no
ppp multilinkcommand.
How to Configure PPP on a Cisco Router
When would you need this: When you are creating a WAN link. And also when the other
end of a WAN link is NOT a Cisco router. Point-to-Point Protocol can be used in synchronous,
asynchoronous, HSSI, and ISDN links.
Special Requirements: None.
1. Get to the interface configuration mode and issue the following command,
Router(config-if)#encapsulation ppp
2. If you want to configure authentication (which is almost always the case), go through the
following steps:
a. Choose the authentication type; Password Authentication Protocol (PAP), or
Challenge Handshake Authentication Protocol (CHAP).
Router(config-if)#ppp authentication XXX
where XXX is the authentication type which can be: pap, chap, pap chap, orchap
pap. The last two choices are to use the other authentication type when the first one
fails.
CHAP is strongly recommended over PAP for two reasons. First, PAP sends the
username and password in plaintext, while CHAP sends hashed challenges only.
Second is that CHAP does an operation similar to periodic re-authentication in the
middle of the communication session such that it provides more security than PAP.
b. Set a username and a password that the remote router would use to connect to your
local router. You can define many username-password pairs for many PPP
connections to the same router.
Router(config)#username USER password PASS
where USER is the host name of the remote router, and PASS is its password. Issue
this command once for each PPP connection. For example if you are connecting
RouterA to RouterB and RouterC, on RouterA issue this command once for each
remote router.
How to configure HDLC and PPP step by step guide and
example
In this article I will demonstrate how can you configure wan encapsulation protocols. HDLC is
the default encapsulation for synchronous serial links on Cisco routers. You should only use
the encapsulation hdlc command to return the link to its default state.
For practical example of HDLC PPP create a simple topology as shown in figure or download
this pre configured topology and load it in packet tracer.
Pre configured topology for PPP and HDLC
Configuration of PPP
Now we will configure PPP encapsulations on both router. We will also authenticate it with
CHAP. Hostname of Router are R1 and R2 and password is vinita.
Double Click on R1 and configure it
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#username R2 password vinita
R1(config)#interface serial 0/0/0
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication chap
R1(config-if)#exit
R1(config)#
Now configure R2 for PPP
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#username R1 password vinita
R2(config)#interface serial 0/0/0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp authentication chap
R2(config-if)#exit
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0,
changed state to up
R2(config)#
Router(config-if)#encapsulation hdlc Sets the encapsulation mode for this interface to HDLC
Router(config-if)#ppp authentication
pap Turns on Password Authentication Protocol (PAP) authentication only
Router(config-if)#ppp authentication Defines that the link will use PAP authentication, but will try CHAP if
pap chap
PAP fails or is rejected by other side.
Router(config-if)#ppp authentication Defines that the link will use CHAP authentication, but will try PAP if
chap pap
CHAP fails or is rejected by other side.
Router(config-if)#ppp pap
This command must be set if using PAP in Cisco IOS Software
sentusername R1 password vinita
Release 11.1 or later
Tells you what type of cable (DCE/DTE) is plugged into your interface
Router#show controllers serial x
and whether a clock rate has been set
Router#debug serial interface Displays whether serial keepalive counters are incrementing
Router#debug ppp packet Displays PPP packets that are being sent and received
Router#debug ppp negotiation Displays PPP packets related to the negotiation of the PPP link