Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Angelo Coiro
Laboratorio
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Packet Tracer
Cisco Packet Tracer is an academic software
that allows to emulate Cisco devices
Packet Tracer can be used for
Creating networks composed of generic and/or
Cisco devices
Emulating the Command Line Interface (CLI) of
the Cisco IOS
Configuring network devices by means of GUI or
CLI and checking their state by creating a traffic
scenario and observing the network behaviour
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Network Devices
We can
Use real network devices (Cisco)
Create a new device
Available devices are categorized in:
Routers, Switches, Hubs (Repeaters),
Wireless Devices (Access Point), End Devices
(PCs, servers, printers,IPphone), WAN
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Select tool : select an
item on the workspace
Move tool: to move the
whole topology
Note tool: to add a
notice
Delete tool: to remove
links and devices
Empty device
2. Click on Device
1. Select generic
empty device, e.g.
Router
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Adding modules to an empty device
2. Choose the
interface you want to
install; e.g. Cable
Gigabit Ethernet (CGE),
Fiber Gigabit Ethernet
(FGE), etc…
1. Switch off the
device
3. Drag the module to
an available slot on the
device
4. To remove a module
drag it to the module
list
Connecting devices
To connect two devices we need to
choose:
a suitable transmission medium (wired or
wireless connection?)
Correct interfaces
Smart connection mode is also available:
Port Status
Red means that
the port is "down“:
it does not work!
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Port Labels
Put the mouse cursor over
the link to see which are
the ports that
Manual Connection
Choose the correct cable
Fiber if you want to use a Fiber Gigabit Ethernet
interface
Copper if you want to use a Copper Ethernet
interface
Copper Straight-Through if you are connecting an Ethernet
end-device (PC or Router) to a switch
Copper Cross-Over if you are directly connecting two
end-devices (PC or Router)
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Configuring devices with PT (1/2)
Configuring devices with PT (2/2)
Packet Tracer emulates the Command Line
Interface of Cisco-IOS
Same commands
of any Cisco
INFOCOM Dept
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
How to use AUX and Console ports
The console and AUX ports are used for management
operations
they are serial and asynchronous
one of them is required for the initial router
configuration (The console port is recommended)
not all routers have an AUX port
Once you have edited the initial configuration, the router
can be connected to the network
It is better to use the console port because it allows to
display by default router startup, debugging and error
messages
Connection configuration with console port
The console port is used to provide out-of-band access
(for management operations)
It is used for the initial configuration, troubleshooting, monitoring and
disaster recovery procedures.
To connect to a console port we have to use a rollover cable and a
RJ-45 to DB-9 adapter.
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Establishing a HyperTerminal session(1/2)
A console terminal is an ASCII terminal or a PC
running terminal emulation on the console port
The default parameters for the console port are 9600 baud, 8
data bits, no parity, 1 stop bit and no flow control, the console
port does not support hardware flow control
The steps required are
Connecting the terminal using a
rollover cable (using the appropriate adapter RJ-45 to DB-9)
1.
Configure the terminal
emulation on the PC with:
The appropriate COM port
9600 baud
8 data bits
No parity
1 stop bit
No flow control
2.
Connect the connector RJ-45 of
the rollover cable to the router
console port
3.
Connect the other end of
the cable to the adapter
RJ-45 to DB-9
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Terminal Session on PT (1/3)
2. Click on Console
1. Click on Connections
3. Connect the PC with
the Router
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Terminal Session on PT (3/3)
Now you are
connected with
the Router
You can use
Cisco IOS
A router or a switch cannot work without an
operating system
The Cisco IOS operating system is
the software architecture of
Cisco routers and Catalyst switches
The Cisco IOS provides the following services:
Basic functions of routing and switching
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
CLI (1/2)
The Cisco IOS uses a command line
interface (CLI)
Two possible ways of accessing
Console session
uses a low-speed serial connection or a modem
it is not necessary that the router has configured the
network services
Telnet session
To establish a Telnet session with a router at least
one interface must be configured with an IP address and
the virtual terminal must be configured for login and
CLI (2/2)
The CLI uses a hierarchical structure
Each level allows to accomplish certain tasks
The sessions EXEC (executive command, the interpreter of
IOS commands) supports two levels of access
User EXEC mode
Privileged EXEC mode or enable mode
The user EXEC mode allows only a limited number of basic
commands for monitoring functions ("view only" mode)
It does not allow any command that could change the router configuration
It is recognized for the prompt “>"
The Privileged EXEC mode allows to use the whole set of commands:
It is possible to set a password for accessing Privileged EXEC
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Levels of access to the commands (1/3)
Routers have two access levels
User EXEC mode
Privileged EXEC mode
To access the complete set of commands you must enter in
the Privileged EXEC mode
At the prompt "
>
" you have to write the command "
enable
“
The password to enter in the privileged mode can be
set using the commands "
enable password
" or "
enable secret
”
if you use both commands the latter has priority
The configuration via CLI for a Cisco router is
always done in
global configuration mode
Other configuration modes (not global) are accessible from
the global configuration mode
To access the global configuration mode you have to use the
command “configure terminal”
Router#configure terminal
Router(config)#
From the global configuration mode you can configure
Interfaces
Subinterfaces
Routing Protocols
Access-list
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
To return to the
USER EXEC mode you can
use the command
"
disable
" or "
exit
"
To return to the
privileged EXEC mode
from the global
configuration one use
“exit” o “Ctrl-Z”
This command can also
be used to return
directly to
the privileged
mode from anywhere
in the global
configuration mode
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Aid in the router CLI
Writing ”?” in the user EXEC or in the privileged mode it will be
displayed the list of available commands
After "-More-" at the end of the display, the screen will
display other commands
Pressing ENTER, we will see the next line, any other key causes the return
to the prompt
You can also enter in the privileged mode using the command "
ena
“
Example: Suppose that we have to set the clock and we don’t
know the command
Use "?" To find the command to set the clock
Check the syntax to change the time
Set the time using hours, minutes and seconds
Press "Ctrl-P" or "up arrow" to repeat the last command
The symbol ”^” indicates an error
Naming the router
A router should be named with a "unique”
name
To assign a name from the global config
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Reserved access (1/4)
The access to the router can be limited by configuring
passwords
Passwords can be configured to restrict the access:
1.
to the router from the console port
2.
to the router from a virtual terminal line (vty), eg. access
via Telnet
3.
to the Privileged EXEC mode
To configure a password for the access via console:
Router(config)#line console 0
Reserved access (2/4)
To configure a password for the access via
the virtual terminal line:
Router(config)#line vty 0 4
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Reserved access (3/4)
To configure a password for the access to the
Privileged EXEC mode:
There are two possible solutions:
1.
Using the command “enable password”
Router(config)#enable password <password>
Reserved access (4/4)
You can encrypt your password by enabling
the service password encryption:
Router(config)#service password-encryption
2.
Using the command “enable secret”
Router(config)#enable secret <password>
The password is encrypted in the configuration file
The encryption algorithm used by the
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
The command “show” (1/2)
It is used to display some information related to the router
It is available in User EXEC or in Privileged EXEC
(with different access levels to the information)
Examples:
“show interfaces” – shows all statistics of the interfaces
“show controllers serial” – displays specific information about the
hardware of the interface
“show clock” – shows the time set in the router
“show hosts” – shows the cached list of host names and addresses
“show users” – shows all users connected to the router
The command“show” (2/2)
“show flash”
– shows information on flash memory and on
flies sored on it
“show version”
– shows router and IOS information
“show ARP”
– shows the ARP table of the router
“show protocol”
– shows global and local (each interface)
states of Layer 3 protocols
“show startup-configuration”
– shows the configuration stored
in the NVRAM
“show running-configuration”
– shows the configuration
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Configuring an Ethernet interface
Router#configure terminal
Router(config)#interface gigabitEthernet 0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown
Enter in Global Configuration mode
Enter in the Specific Configuration mode
We want to configure the interface “gigabitEthernet 0/0”
Configure the IP address and the Subnet Mask
Enable the interface
Interface description (1/3)
It is useful to assign a description to an interface
The description does not affect interface operation
as it is just a comment.
The descriptions may include for example:
the name of the network connected to the interface
the location of the interface
Interface descriptions are inserted with the
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Interface description (3/3)
Steps of the procedure (from Privileged EXEC):
1.
Enter in global configuration mode with the
command "
configure terminal
“
2.
Enter in the specific mode interface with: (for example)
"Interface ethernet0“
3.
Use the command "
description
" followed by the
information that should be displayed
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Click on the PC and then
click on the Config tab
In GLOBAL Settings, you can
change the name of
the PC and insert the IP
address of the gateway.
Configuring the IP address of the PC
Click on FastEthernet in
INTERFACE to configure
the IP address and
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Configuration files
Running-config file: contains the current
configuration
Startup-config file: contains the last saved
configuration in the NVRAM (and reloaded after
the restart)
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Saving the configuration
To return to the previous configuration:
Disable the command with "no command_name“
Reload the original configuration file from the NVRAM
Reload a configuration file stored on a TFTP server
To remove the startup-config file use the
command "
erase startup-config
" and reboot the
router (you enter in the setup mode)
To save the changes (reloaded after the restart)
copy the configuration file in the NVRAM using the
command "copy running-config startup-config”
Checking Connectivity
Packet Tracer allows to check
network connectivity in different ways.
Realtime Mode: opening a command prompt
from the desktop PC and trying to ping as in
the real world.
Simulation Mode: It is possible to create a
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Chcking Connectivity in Realtime Mode
Ping the Default Gateway
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Configuring a router using a Telnet Session
Remote devices can be configured by means
of a Telnet session
The device must be reachable from your PC
Open the Command
Prompt
Opening a Telnet Session
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Changing the addressing scheme
We want to change the address of the
subnetwork from 192.168.1.0/24 to
192.168.2.0/24
When we change the address of “interface
GigabitEthernet 0/0” we will loose the
connection
Scenario 2
Open file Lesson1-Scenario2.pkt
You can only access PC Rome
Look at the configuration of the PC
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept
Discovering Network configuration
What is the IP address of Router Milan ?
Can Router Milan be reached from PC Rome?
Check by a ping…or…trace route
Why?
Telent bounce
Once you have
accessed a device, you
can open a telnet
session toward onther
device in the network,
and so on…
PC Rome can reach Router Rome but not
Router Milan
Fondamenti di Reti - Prof. Marco Listanti - A.A. 2010/2011 INFOCOM Dept