Вы находитесь на странице: 1из 64

Basic IOS - Review

Justinian Anatory

Router is a computer

Department of Computer and Systems Engineering

The ARPANET went into labor on


August 30, 1969, when BBN
delivered the first Interface Message
Processor (IMP) to Leonard
Kleinrock's Network Measurements
Center at University of California,
Los Angeles (UCLA). The IMP was
built from a Honeywell DDP 516
computer with 12K of memory,
designed to handle the ARPANET
network interface. In a famous piece
of Internet lore, on the side of the
crate, a hardware designer at BBN
named Ben Barker had written "Do it
to it, Truett", in tribute to the BBN
engineer Truett Thach who traveled
with the computer to UCLA on the
plane.

www.livinginternet.com/i/ii_arpan
et.htm
2

Router internal components

CPU
RAM
Flash
NVRAM

Department of Computer and Systems Engineering

Buses
ROM
Interfaces
Power Supply
3

Router physical characteristics

Department of Computer and Systems Engineering

Router external connections

Department of Computer and Systems Engineering

Accessing the Router

Directly using the console port


No configuration needed on the router
Telnet over the network
Network connection
Network configuration on both ends (IP address, subnet
mask, etc.)
Telnet password configured on router
Modem

Department of Computer and Systems Engineering

Accessing the
router directly

The console port on the router allows you to connect a dumb terminal
or a computer with terminal emulator software directly.
No IP addressing or other configurations needed on the router.
Used for:
Configuring a device that has never been configured.
Configuring a device directly, because you are physically located
where the device is.
Troubleshooting a device that you can no longer access remotely.
Performing password recovery.

Department of Computer and Systems Engineering

Management port Console Port connection


Department of Computer and Systems Engineering

Serial Port

Department of Computer and Systems Engineering

FYI Only! This is for connecting using a modem.

Management port AUX port connection


Department of Computer and Systems Engineering

10

Connecting console interfaces

When connected using the console interface, the computer is acting


as a dumb terminal.

<Router Output>

Department of Computer and Systems Engineering

11

Terminal Emulators

HyperTerminal: Comes with Windows


Teraterm: Free download (recommended)
Settings:
9600 Baud
8 Data Bits
1 Stop Bit
No Parity

Department of Computer and Systems Engineering

12

Using HyperTerminal

Settings

Match
serial port
on PC

Department of Computer and Systems Engineering

13

Teraterm

Department of Computer and Systems Engineering

14

Connecting console interfaces

<Router Output>

Department of Computer and Systems Engineering

15

Connecting LAN
interfaces

Department of Computer and Systems Engineering

16

Cisco 2500 Series (older routers)

Department of Computer and Systems Engineering

17

Connecting WAN interfaces

Department of Computer and Systems Engineering

18

Connecting WAN interfaces

Department of Computer and Systems Engineering

19

Connecting WAN interfaces

Department of Computer and Systems Engineering

20

Configuring the Router


Router# configuration terminal
Router(config)# interface fastethernet 0/0
Router(config-if)# ip add 172.30.1.1 255.255.255.0
Router(config-if)# end
Router#

Power-up the router No configuration


If the routers do not have a saved configuration.
After several lines of information on the screen you should eventually see:
Would you like to enter the initial configuration dialog? [yes/no]: n

Always answer n fo no.


We will never be using setup mode.
If you accidentally press y and enter Setup Mode, press and hold down the control key
and press C (CTRL-C).
Wait a few seconds, and then press Enter.

On some routers you may see the following message.


Would you like to terminate autoinstall? [yes/no]: y
<There will be several lines of output>
Router>

Department of Computer and Systems Engineering

22

Power-up the router Has Configuration


The router has a pre-existing configuration.
If after you power-up the router, instead of getting the previous message, you get:
Router>

Someone has saved a configuration on the router (startup-config).


Because it is always best to begin our labs without a previous router configuration, you
will need to erase the startup-config and reboot the router.

Router> enable
If you are prompted for a password type: class or if that does not work, type cisco

Router# erase startup-config


Turn off the router and then turn it back on.

Department of Computer and Systems Engineering

23

User Mode
Router>

User mode will allow you to view the state of the router, but
will not allow you to modify its configuration.
Dont confuse user mode with users of the network.
This is only for network techs, operators, engineers, etc.

Department of Computer and Systems Engineering

24

Getting Help
Router> ?
Exec commands:
access-enable
entry
access-profile
clear
<text omitted>
ping
ppp
(PPP)
--More--

Create a temporary Access-List


Apply user-profile to interface
Reset functions
Send echo messages
Start IETF Point-to-Point Protocol

Press the Space Bar to scroll a screens worth of more commands.


Press the Enter or Return key to scroll down just one line of the list.
Press any other key to halt the list output.

Department of Computer and Systems Engineering

25

Getting Help
Router> show ?
alps
backup
c2600
call
cca
ccm-manager
cdapi
cef
class-map
clock
<text omitted>
--More
Router> show

Alps information
Backup status
Show c2600 information
Show call
CCA information
Call Manager Application information
CDAPI information
Cisco Express Forwarding
Show QoS Class Map
Display the system clock

Starts you off where you finished.

Department of Computer and Systems Engineering

26

Getting Help
Router> show interfaces ?
Async
Async interface
BRI
ISDN Basic Rate
Interface
BVI
Bridge-Group Virtual
Interface
<text omitted>
Router> show interfaces

Starts you off where you finished.

Department of Computer and Systems Engineering

27

Privilege Mode
Router> enable
Router#

<user mode>
<privilege mode>

Router# disable

<privilege mode>

Router> enable
Router#

<user mode>
<privilege mode>

Allows the administrator to modify the router configuration

Department of Computer and Systems Engineering

28

Abbreviated commands
Router# sh inter
Same as
Router# show interfaces

Department of Computer and Systems Engineering

29

Router#show running-config
Current configuration : 542 bytes
!
version 12.2
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0
no ip address
shutdown
!
line con 0
line aux 0
line vty 0 4
!
end
Router#
Department of Computer and Systems Engineering

running-config

The running-config file is


the configuration in RAM
memory.
All changes are made to
the running-config file.
This is the configuration
that the router is
currently using.
The running-config is
lost when the router
loses power or reloads.
Privilege mode
command.

30

startup-config
Router#show startup-config
startup-config is not present
Router#

Department of Computer and Systems Engineering

The startup-config file is


the saved configuration
in NVRAM.
If there is a startupconfig file in NVRAM
when the router boots
up, this file will be copied
into running-config.
The running-config is
what the router will use.
Privilege mode
command.

31

Copy running-config to startup-config


Router#copy running-config startup-config
Destination filename [startup-config]? <Press Enter>
Building configuration...
[OK]
Router#show startup-config
Current configuration : 542 bytes
!
version 12.2
!
interface FastEthernet0/0
<text omitted>

The running-config should be periodically saved to startup-config when


you are satisfied with your changes and you do not want to lose them.
(Lab)
Production network, startup-config should always match running-config
in case of power failure, etc.
Privilege mode command.
Department of Computer and Systems Engineering

32

Erase startup-config
Router#erase startup-config
Erasing the nvram filesystem will remove all files!
Continue? [confirm] <Press Enter>
[OK]
Erase of nvram: complete
Router#

When you are done with the routers in the lab, please be
sure to erase the startup-config.
If you are starting a lab, and you do not get the message:

Would you like to enter the initial configuration dialog?


[yes/no]:

You will need to erase the startup-config and reboot.


Privilege mode command.

Department of Computer and Systems Engineering

33

copy running-config startup-config


Router# copy running-config startup-config
Or
Router# copy running startup
OR
Router# copy run start
OR
Any usage of the command or parameters, so that they are still uniquely
recognizable.

Department of Computer and Systems Engineering

34

copy running-config startup-config


WARNING
Using an incorrect configuration file name could overwrite the routers IOS in
flash, as the router believes you are trying to copy a blank file into flash.
Router#copy running-config start-up
Incorrect file name!
**** NOTICE ****
Flash load helper v1.0
This process will accept the copy options and then terminate
the current system image to use the ROM based image for the copy.
Routing functionality will not be available during that time.
If you are logged in via telnet, this connection will terminate.
Users with console access can see the results of the copy
operation.
---- ******** ---Proceed? [confirm]^C
Press <control> C
%Copy cancelled by user request.
Router#

Department of Computer and Systems Engineering

35

Executing adds, moves, and changes

running-config

startup-config

IOS (running)

Department of Computer and Systems Engineering

IOS

Bootup program
ios (partial)

36

copy running-config startup-config

During bootup

running-config

RAM
startup-config

Router# copy running-config startup-config

Changes to the router are automatically put in the running-config file.


If the router loses power or reboots, everything in RAM is lost including the runningconfig file.
To make sure the changes to the routers configuration remain saved, you must copy
the running-config from RAM into the startup-config into NVRAM:

Router# copy

running-config

Department of Computer and Systems Engineering

startup-config
37

Using exit, end and Control-Z

end
exit

Department of Computer and Systems Engineering

38

Router>ena
Router#configure terminal <Must be in privileged mode>
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#?
Configure commands:
access-list
Add an access list entry
<text omitted>
Router(config)#exit
00:03:20: %SYS-5-CONFIG_I: Configured from console by con
Router#config t
Enter configuration commands, one per line.

End with CNTL/Z.

Router(config)#exit
00:03:34: %SYS-5-CONFIG_I: Configured from console by console
Router#

Department of Computer and Systems Engineering

39

Hostname
Router#config t
Router(config)#hostname R1
R1(config)#

Changes the name, the prompt on the router.


Very important to do early on so you dont get confused
about which router you are configuring.

Department of Computer and Systems Engineering

40

Passwords

There are only two passwords we will use in our classes,


they are cisco and class. (both lowercase).
Of course this is something you would not do in a
production network, but so we do not have to do password
recovery on equipment and to make it easier for everyone,
we will use only these two passwords.
Console = cisco
VTY = cisco
Priviledge = class

Department of Computer and Systems Engineering

41

Console password = cisco


Router#conf t
R1(config)#line console 0
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
R1(config)#

The console password requires someone to enter a


password before accessing the router using the console
port.

Department of Computer and Systems Engineering

42

VTY password = cisco


R1(config)#line vty 0 4
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
R1(config)#

The vty password requires someone to enter a password


before accessing the router remotely using telnet.

Department of Computer and Systems Engineering

43

Privilege password = class


R1(config)#enable secret class
R1(config)#end
Test it:
R1#disable
R1>enable
Password:class
R1#

The privilege mode password requires someone to enter a


password when entering privilege mode with the enable
command.

Department of Computer and Systems Engineering

44

Configuring router passwords

Not recommended, clear text

Encrypts the passwords


above, but
Use this command instead, password is encryped

Router(config)#enable secret <password>


Department of Computer and Systems Engineering

45

service password-encryption command

WARNING
service password-encryption uses a Cisco Level 7
encryption which is very easy to decrypt.
For the GetPass! software www.boson.com
However, the enable secret <password> uses a stronger
encryption method and cannot be easily hacked.
Department of Computer and Systems Engineering

46

enable secret <password> command

Doesnt work for enable secret!

More later!

Department of Computer and Systems Engineering

47

Interfaces
Router#show ip interface brief
Interface
FastEthernet0/0
Serial0/0
BRI0/0
BRI0/0:1
BRI0/0:2
Serial0/1
Router#

IP-Address
unassigned
unassigned
unassigned
unassigned
unassigned
unassigned

OK?
YES
YES
YES
YES
YES
YES

Method
unset
unset
unset
unset
unset
unset

Status
administratively
administratively
administratively
administratively
administratively
administratively

Protocol
down down
down down
down down
down down
down down
down down

Quick look at interfaces.

Department of Computer and Systems Engineering

48

Configuring an Ethernet interface


Router#conf t
Enter configuration commands, one per line. End with
CNTL/Z.
Router(config)#inter fastethernet 0/0
Router(config-if)#ip add 172.30.1.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#end
Router#

Your interfaces may differ!


Adding an IP address and subnet mask
no shutdown turns on the interface.

Department of Computer and Systems Engineering

49

Configuring a serial interface


R1(config)#inter serial 0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit

Your interfaces may differ!


Adding an IP address and subnet mask
no shutdown turns on the interface

Department of Computer and Systems Engineering

50

Configuring routing protocols


R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router ?
bgp
Border Gateway Protocol (BGP)
egp
Exterior Gateway Protocol (EGP)
eigrp
Enhanced Interior Gateway Routing
Protocol (EIGRP)
igrp
Interior Gateway Routing Protocol
(IGRP)
isis
ISO IS-IS
iso-igrp
IGRP for OSI networks
mobile
Mobile routes
odr
On Demand stub Routes
ospf
Open Shortest Path First (OSPF)
rip
Routing Information Protocol (RIP)
static
Static routes
traffic-engineering Traffic engineered routes

Department of Computer and Systems Engineering

51

Configuring routing protocols


R1(config)#router rip
R1(config-router)#end

Configuring RIP.

Department of Computer and Systems Engineering

52

Using exit, end and Control-Z

end
exit

Department of Computer and Systems Engineering

53

A brief look at some other


commands we will discuss later

Examining the show commands

show interfaces Displays all the statistics for all the interfaces on the
router. To view the statistics for a specific interface, enter the show
interfaces command followed by the specific interface and port number.
show controllers serial Displays information-specific to the interface
hardware
show clock Shows the time set in the router
show hosts Displays a cached list of host names and addresses
show users Displays all users who are connected to the router
show history Displays a history of commands that have been entered
show flash Displays information about flash memory and what IOS files
are stored there
show version Displays information about the router and the IOS that is
running in RAM
show ARP Displays the ARP table of the router
show protocol Displays the global and interface specific status of any
configured Layer 3 protocols
show startup-configuration Displays the saved configuration located
in NVRAM
show running-configuration Displays the configuration currently
running in RAM

Department of Computer and Systems Engineering

55

show interfaces <interface> command


MAC Address
Router>show interface ethernet 0
Status
Ethernet0 is administratively down, line protocol is down , using hub 0
Hardware is Lance, address is 0010.7b3a.cf84 (bia 0010.7b3a.cf84)
MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec, rely 255/255, load 1/255
Encapsulation ARPA, loopback not set, keepalive set (10 sec)
Routing
metric
ARP link
type: ARPA, ARP Timeout 04:00:00 ARP cache entries timer
Data
information
Last input never, output 01:05:35, output hang never
encapsulation
(later)
(Ethernet-II)
Last clearing of "show interface" counters never
Queueing strategy: fifo
Output queue 0/40, 0 drops; input queue 0/75, 0 drops
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 input packets with dribble condition detected
63 packets output, 11676 bytes, 0 underruns
0 output errors, 0 collisions, 1 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
Router>
Department of Computer and Systems Engineering

56

Where is the MAC Address?


Router>show interface serial 0
Serial0 is administratively down, line protocol is down
Hardware is HD64570
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec, rely 255/255, load 1/255
Encapsulation HDLC, loopback not set, keepalive set (10 sec)
Last input never, output never, output hang never
Last clearing of "show interface" counters never
Queueing strategy: fifo
Output queue 0/40, 0 drops; input queue 0/75, 0 drops
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
28 packets output, 9576 bytes, 0 underruns
0 output errors, 0 collisions, 17 interface resets
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
DCD=down DSR=down DTR=down RTS=down CTS=down
Router>
Department of Computer and Systems Engineering

57

Configuring a serial interface


Lab

Real world

On serial links that are directly interconnected, as in a lab environment,


one side must be considered a DCE and provide a clocking signal.
The clock is enabled and speed is specified with the clock rate
command.

Router(config)#interface serial 0/0


Router(config-if)#clock rate 56000
Router(config-if)#no shutdown
Department of Computer and Systems Engineering

58

Configuring a serial interface


RouterA
DTE cable

RouterB
DCE cable

RouterB(config)#inter serial 1
RouterB(config-if)#clock rate ?
Speed (bits per second)
1200
2400
4800
9600
19200
38400
56000
64000
<text omitted>
2000000
4000000
<300-4000000>

Choose clockrate from list above

RouterB(config-if)#clock rate 64000


RouterB(config-if)#
Department of Computer and Systems Engineering

59

Configuring a serial interface

DTE Cable

DCE Cable

How can you tell which end is the DTE and which end is the DCE?
Look at the label on the cable.
Look at the connecter between the two cables - The DTE cable will
always be male and the DCE cable will always be female.
Department of Computer and Systems Engineering

60

Configuring a serial interface


RouterA
DTE cable

RouterB
DCE cable

RouterA#show controllers serial 0


HD unit 0, idb = 0xECA4C, driver structure at 0xF1EC8
buffer size 1524 HD unit 0, V.35 DTE cable
cpb = 0x62, eda = 0x403C, cda = 0x4050
RX ring with 16 entries at 0x624000
00 bd_ptr=0x4000 pak=0x0F5704 ds=0x62FFB8 status=80 pak_size=22
This is one of few commands where there must be a space between the interface type and the port.
RouterB#show controllers serial 0
buffer size 1524 HD unit 0, V.35 DCE cable, clockrate 64000
cpb = 0x62, eda = 0x408C, cda = 0x40A0
RX ring with 16 entries at 0x624000
00 bd_ptr=0x4000 pak=0x0F2F04 ds=0x627908 status=80 pak_size=22

How can you tell which end is the DTE and which end is the DCE?
Use the show controllers command!
It will also tell you the type of cable, in our labs we will be using a V.35
cable.
Department of Computer and Systems Engineering

61

Configuring a serial interface

This end up!


(The wider end is up.)

Please be very careful when connecting the male and female


V.35 cables together AND when connecting the serial cable to
the router!
They only connect ONE WAY!
Be sure the two ends match!
Dont force it!

Department of Computer and Systems Engineering

62

Practice with Packet Tracer!

Department of Computer and Systems Engineering

63

NetLab

Next Week

Department of Computer and Systems Engineering

64

Вам также может понравиться