The first time you connect to a router or a switch, it can seem a little daunting. We have covered console connections above, so once you connect the cable, you will need to use a terminal emulation programme on your PC or laptop. This will allow you to see router output and type in the configuration commands.
HyperTerminal has been the default for many years, and you may need to use this still if you need to perform disaster recovery; however, for now you can stick to Putty, which is very widely used. You can download Putty from www.putty.org. An old-fashioned connection using the COM port on a PC almost always uses a logical port on it labelled COM1 or COM2. You can see the facility of using this on Putty, which actually calls this a serial connection, as shown in Figure 1.37 below:
Figure 1.37 – Putty Uses COM Ports for Serial Access
If you are using a USB-to-rollover cable, then you will have received a driver CD, which, when run, will give you a COM port number to use. You can find this port number in the Device Manager if you are using Windows, as shown in Figure 1.38 below:
Figure 1.38 – The Driver Has Assigned COM4 for Console Connection
If you are using HyperTerminal, you will also need to select more connection parameters, such as baud rate. You should choose the following, which is illustrated in Figure 1.39:
- Bits per second: 9600
- Data bits: 8 is the default
- Parity: None is the default
- Stop bits: 1 is the default
- Flow control: must be None
Figure 1.39 – Setting Your HyperTerminal Settings
When you turn on the router, if you have selected the correct COM port AND plugged the rollover cable into the console port (instead of a different port by accident), you should see the router boot-up text (see Figure 1.40). If you can’t see any text, hit the Enter key a few times and then double-check your settings.
Figure 1.40 – The Router Boot-up Text
The router may ask whether you want to enter Initial Configuration mode. This happens when it can’t find a startup configuration file in NVRAM (covered later) or if the configuration register is set to ignore the startup configuration file (usually 0x2142). Always type “n” or “no” because, otherwise, you will enter setup mode, which you don’t want to do:
Would you like to enter the initial configuration dialog? [yes/no]:
% Please answer ‘yes’ or ‘no’.
Would you like to enter the initial configuration dialog? [yes/no]: no
Press RETURN to get started!
Router>
With a different router model, you would see the following output:
Technical Support: www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Wed 18-Jul-07 04:52 by pt_team
— System Configuration Dialog —
Continue with configuration dialog? [yes/no]: no
Press RETURN to get started!
Router>
Router Modes
In order to pass the CCNA exam, you will need to understand which router prompt you should start from to perform various actions. Whatever function you wish to perform, you will have to be in the correct mode (signified by the router prompt). This is the biggest mistake novice students make when they are having problems configuring the router and cannot find the right command to use. Make sure you are in the correct mode!
User Mode
The first mode you will be presented with when the router boots is known as User mode or User Exec mode. User mode has a very limited set of commands that can be used, but it can be useful for looking at basic router elements. The default name of the router is “Router” but this can be changed, as you will see later.
Router>
Privileged Mode
Typing enable at the User prompt takes you into the next mode, known as Privileged mode or Privileged Exec mode. To get back to User mode, you simply type disable. To quit the session altogether, type logout or exit.
Router>enable
Router#
Router#disable
Router>
Privileged mode is very useful for looking at the entire configuration of the router, the statistics about how it is performing, and even which modules you have connected to the router. At this prompt, you would type show commands and troubleshoot with debug commands.
Global Configuration Mode
In order to configure the router, you have to be in Global Configuration mode. To get to Global Configuration mode, you simply type configure terminal, or config t for short, at the Privileged Exec prompt. Alternatively, just type config and the router will ask you which mode you would like to enter. The default is terminal (the default options will be shown inside the square brackets [ ]). If you press Enter, the command inside the brackets will be accepted.
Router#config
Configuring from terminal, memory, or network[terminal]? ← press Enter
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Interface Configuration Mode
Interface Configuration mode allows you to enter commands for individual router interfaces, such as FastEthernet, Serial, etc. On a new router, all of the interfaces will be shut down by default, with no configuration present.
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface Serial0
Router(config-if)#
|
Line Configuration Mode
Line Configuration mode is used to make any changes to the console, Telnet, or auxiliary ports (if your router has these). You can control who can access the router via these ports, as well as put passwords or a security feature called “access control lists” on them.
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#line console 0
Router(config-line)#
You can also configure baud rates, exec levels, and more in Line Configuration mode.
Router Configuration Mode
In order to configure a routing protocol onto the router so it can dynamically build a picture of the network, you will need to be in Router Configuration mode.
Router#config t
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#router rip
Router(config-router)#
VLAN Configuration Mode
This mode actually only applies to switches but it’s worth mentioning it here while we are discussing modes. You will spend a lot of time in this mode when configuring the switching labs in this book.
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#
Routers equipped with Ethernet switch cards use VLAN Database Configuration mode (this mode is deprecated on switches), which is similar to VLAN Configuration mode:
Router#vlan database
Router(vlan)#vlan 10
VLAN 10 added:
Name: VLAN0010
Router(vlan)#exit
APPLY completed.
Exiting….
Router#
Configuring a Router
There are no menus available on a router, and you cannot use a mouse to navigate between the different modes, as it is all done via the command line interface (CLI). There is, however, some context-sensitive help in the form of the [?] keyword. If you type a question mark at the router prompt, you will be presented with a list of all the available commands.
Please note that you will only see the commands available for your mode. If you want to see interface configuration commands, you must be at the interface prompt.
| Router#? | |
| Exec commands: | |
| access-enable | Create a temporary Access-List entry |
| access-profile | Apply user-profile to interface |
| access-template | Create a temporary Access-List entry |
| alps | ALPS exec commands |
| archive | manage archive files |
| bfe | For manual emergency modes setting |
| cd | Change current directory |
| clear | Reset functions |
| clock | Manage the system clock |
| cns | CNS subsystem |
| configure | Enter configuration mode |
| connect | Open a terminal connection |
| copy | Copy from one file to another |
| debug | Debugging functions (see also ‘undebug’) |
| delete | Delete a file |
| dir | List files on a directory |
| disable | Turn off privileged commands |
| disconnect | Disconnect an existing network connection |
| enable | Turn on privileged commands |
| erase | Erase a file |
| exit | Exit from the EXEC mode |
| help | Description of the interactive help system |
| — More — | |
If there is too much information to display on the screen, you will see the — More — tab. If you want to see the next page, press the space bar. If not, hold down the Ctrl+Z keys together or press “Q” to get back to the router prompt.
In addition, if you have started to type a command but forget what else you need to type in, using the question mark will give you a list of options available. The [?] keyword WILL work in the CCNA exam, but if you are using it, you didn’t follow all my labs!
Router#cl?
clear clock
| If you begin to type out a command, as long as there is only one possible word or command available with that syntax, you can press the Tab key to have it completed for you.
Router#copy ru ← press the Tab key here |
The router has several modes from which to choose. This is to ensure that you do not make changes to parts of the router configuration you do not intend to change. You can recognise which mode you are in by looking at the command prompt. For example, if you wanted to make some changes to one of the FastEthernet interfaces, you would need to be in Interface Configuration mode.
First, go into Global Configuration mode:
Router#config t
Router(config)#
Next, tell the router which interface you want to configure:
Router(config)#interface FastEthernet0
Router(config-if)#exit
Router(config)#
If you are not sure which way to enter the interface number, then use the [?] keyword. Do not worry about all of the choices you will be given. Most people only use the FastEthernet, Serial, and Loopback interfaces.
| Router(config)#interface ? | |
| Async | Async interface |
| BRI | ISDN Basic Rate Interface |
| BVI | Bridge-Group Virtual Interface |
| CTunnel | CTunnel interface |
| Dialer | Dialer interface |
| FastEthernet | IEEE 802.3u |
| Group-Async | Async Group interface |
| Lex | Lex interface |
| Loopback | Loopback interface |
| Multilink | Multilink-group interface |
| Null | Null interface |
| Serial | Serial interface |
| Tunnel | Tunnel interface |
| Vif | PGM Multicast Host interface |
| Virtual-Template | Virtual Template interface |
| Virtual-TokenRing | Virtual TokenRing interface |
| range | interface range command |
|
Router(config)#interface FastEthernet? |
|
|
Router(config)#interface FastEthernet0 |
|
Finally, the router drops into Interface Configuration mode:
Router(config-if)#
From here, you can put an IP address on the interface, set the bandwidth, apply an access control list, and do a lot of other things. Please note that your router and switch may well have different interface numbers from mine, so use the ? or show ip interface brief commands to see your options.
If you ever need to exit out of a configuration mode, simply type exit. This takes you back to the next-highest level. To quit any sort of configuration mode, simply press Ctrl+Z together (or type end).
Router(config-if)#exit
Router(config)#
Or, if using the Ctrl+Z option:
Router(config-if)#^z
Router#
Loopback Interfaces
Loopback interfaces are not normally covered in the CCNA syllabus, but they are very useful in the real world and for practice labs. A Loopback interface is a virtual or logical interface that you configure, but it does not physically exist (so you will never see it on the router panel). The router will let you ping this interface, though, which will save you from having to connect devices to the FastEthernet interfaces in the labs.
An advantage of using Loopback interfaces is that they always remain up, if the router is working, because they are logical, meaning they can never go down. However, you cannot put a network cable into the Loopback interface because it is a virtual interface.
|
Router#config t |
|||||
|
Router#(config)#interface Loopback0 |
|||||
|
Router#(config-if)#ip address 192.168.20.1 255.255.255.0 |
|||||
|
Router#(config-if)#^z ← press Ctrl+Z Router# |
|||||
|
Router#show ip interface brief |
|||||
|
Interface |
IP-Address | OK? | Method | Status | Protocol |
|
Loopback0 |
192.168.20.1 | YES | manual | up | up |
Your output for this command will show all of the available interfaces on your router.
| IN THE REAL WORLD: If you need to, you can shut down a Loopback interface with the shutdown command in Interface Configuration mode. |
Loopback interfaces have to be given a valid IP address. You can then use them for routing protocols or for testing your router to see whether it is permitting certain traffic. You will be using these interfaces a lot throughout the course.
Editing Commands
It is possible to navigate your way around a line of configuration you have typed rather than deleting the whole line. The following keystrokes will move the cursor to various places in the line:
| Keystroke | Meaning |
| Ctrl+A | Moves to the beginning of the command line |
| Ctrl+E | Moves to the end of the command line |
| Ctrl+B | Moves back one character |
| Ctrl+F | Moves forward one character |
| Esc+B | Moves back one word |
| Esc+F | Moves forward one word |
| Ctrl+P or up arrow | Recalls the previous command |
| Ctrl+N or down arrow | Recalls the next command |
| Ctrl+U | Deletes a line |
| Ctrl+W | Deletes a word |
| Tab | Finishes typing a command for you |
| Show history | Shows the last 10 commands entered by default |
| Backspace | Deletes a single character |
It is fairly common to have a question on the above in the exam.
Configuring a Router Interface
Router interfaces can be of different types, based on the following two factors:
- Underlying technology used (e.g., Ethernet)
- Interface bandwidth
The most common router and switch interfaces used in modern enterprise networks are:
- 100Mbps (commonly named FastEthernet)
- 1Gbps (commonly named GigabitEthernet)
- 10Gbps (commonly named TenGigabitEthernet)
In order to address a specific router interface and to enter Interface Configuration mode to configure specific parameters, you must know the interface notation. This can vary based on the router manufacturer, but the interface notation is usually made up of two parts:
- Interface type (Ethernet, FastEthernet, etc.)
- Interface slot/module and port number
For example, common interface notations include the following:
- Ethernet1/0 (slot 1, port 0)
- FastEthernet0/3 (slot 0, port 3)
- GigabitEthernet0/1/1 (module 0, slot 1, port 1)
|
Note: Slot 0 usually represents the built-in ports, and the other slots represent extension slots that can be added at any time. Slot and port numbering usually starts at 0.
|
In order for a router interface to have basic functionality, you must configure the following parameters:
- Speed
- Duplex
- IP address
You can exemplify these basic configuration settings on a Cisco router, as they are commonly used in modern enterprise networks. To see the available interfaces and their current state, you can issue the following command:
Router#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
FastEthernet0/1 unassigned YES unset administratively down down
From the output above, you can see that the router has two FastEthernet (100 Mbps) interfaces on slot 0, both unconfigured (i.e., no IP address) and administratively disabled (i.e., status: administratively down).
Before starting to configure interface parameters, you must enter Router Configuration mode using the configure terminal command on Cisco devices, and then Interface Configuration mode using the interface <interface name> command. The first step in the interface configuration process is enabling the interface. For example, the interface FastEthernet0/0 can be enabled using the no shutdown command:
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface FastEthernet0/0
Router(config-if)#no shutdown
Router(config-if)#no shutdown
Router(config-if)#
*Mar 1 00:32:05.199: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 1 00:32:06.199: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
The next configuration step involves setting up speed and duplex settings and we have already covered these.
Configuring an IP Address on an Interface
| In order for a router to communicate with other devices, it will need to have an address on the connected interface. Configuring an IP address on an interface is very straightforward, although you have to remember to go into Interface Configuration mode first. |
Don’t worry about where to find the IP address at the moment, as we will look at that later on.
| Router>enable ← takes you from User mode to Privileged mode |
| Router#config t ← from Privileged mode to Configuration mode |
| Router(config)#interface Serial0 ← and then into Interface Configuration mode |
| Router(config-if)#ip address 192.168.1.1 255.255.255.0 |
| Router(config-if)#no shutdown ← the interface is opened for traffic |
| Router(config-if)#exit ← you could also hold down the Ctrl+Z keys together to exit |
| Router(config)#exit |
| Router# |
A description can also be added to the interface, as shown in the following output:
|
RouterA(config)#interface Serial0 After the router interface configuration is complete, you can verify the setting by inspecting the full interface-configured parameters using the commands below on Cisco routers: RouterA#show interface Serial0 |
[Output restricted…]
Show Commands
You can look at most of the settings on the router simply by using the show x command from Privileged mode, with x being the next command, as illustrated in the following output:
| Router#show ? | |
| access-expression | List access expression |
| access-lists | List access lists |
| accounting | Accounting data for active sessions |
| adjacency | Adjacent nodes |
| aliases | Display alias commands |
| alps | Alps information |
| apollo | Apollo network information |
| appletalk | AppleTalk information |
| arap | Show AppleTalk Remote Access statistics |
| arp | ARP table |
| async | Information on terminal lines used as router interfaces |
| backup | Backup status |
| bridge | Bridge Forwarding/Filtering Database [verbose] |
| bsc | BSC interface information |
| bstun | BSTUN interface information |
| buffers | Buffer pool statistics |
| cca | CCA information |
| cdapi | CDAPI information |
| cdp | CDP information |
| cef | Cisco Express Forwarding |
| class-map | Show QoS Class Map |
| clns | CLNS network information |
| –More– | |
Some of the more common show commands and their meanings, along with an example, are listed below:
| Show Command | Result | ||||||
| show running-configuration | Shows configuration in DRAM | ||||||
| show startup-configuration | Shows configuration in NVRAM | ||||||
| show flash: | Shows which IOS is in flash | ||||||
| show ip interface brief | Shows brief summary of all interfaces | ||||||
| show interface Serial0 | Shows Serial interface statistics | ||||||
| show history | Shows last 10 commands entered | ||||||
| Router#show ip interface brief | |||||||
| Interface | Address | OK? | Method | Status | Protocol | ||
| Ethernet0 | 10.0.0.1 | YES | manual | up | up | ||
| Ethernet1 | unassigned | YES | unset | administratively down | down | ||
| Loopback0 | 172.16.1.1 | YES | manual | up | up | ||
| Serial0 | 192.168.1.1 | YES | manual | down | down | ||
| Serial1 | unassigned | YES | unset | administratively down | down | ||
The method tag indicates how the address has been assigned. It can state unset, manual, NVRAM, IPCP, or DHCP.
Routers can recall commands previously entered at the router prompt – the default is 10 commands – which can be recalled by using the up arrow. Using this feature can save a lot of time and effort, as it prevents you from having to re-enter a long line. The show history command shows the buffer of the last 10 commands.
| Router#show history |
| show ip interface brief |
| show history |
| show version |
| show flash: |
| conf t |
| show access-lists |
| show process cpu |
| show buffers |
| show logging |
| show memory |
You can increase the history buffer with the terminal history size command:
Router#terminal history ?
size Set history buffer size
<cr>
Router#terminal history size ?
<0-256> Size of history buffer
Router#terminal history size 20
Verifuing Basic Router Configuration and Network Connectivity
The most useful commands that help verify basic router configuration are explained in the following sections.
Show Version
The show version command provides useful information that might represent a starting point in verifying most of the router operations. This information includes the following:
- Type of router (another useful command for listing the router hardware is show inventory)
- IOS version
- Memory capacity
- Memory usage
- CPU type
- Flash capacity
- Other hardware parameters
- Reason for last reload
Here is a shortened output of the show version command. Please try it out for yourself.
Router#show version
Cisco 1841 (revision 5.0) with 114688K/16384K bytes of memory.
Processor board ID FTX0947Z18E
M860 processor: part number 0, mask 49
2 FastEthernet/IEEE 802.3 interface(s)
2 Low-speed Serial(sync/async) network interface(s)
191K bytes of NVRAM.
63488K bytes of ATA CompactFlash (Read/Write)
Configuration register is 0x2102
Show Running-config
The show running-config command provides full configuration on the router, and it can be used to verify that the device is configured with the proper features. The output for this command is too extensive so it will not be presented here.
Show IP Interface Brief
The show ip interface brief command, as mentioned in a previous section, lists the router interfaces and their state, including:
- Interface name and number
- IP address
- Link status
- Protocol status
Router#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
FastEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 unassigned YES unset administratively down down
Serial0/1/0 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
Router#
Show IP Route
The show ip route command provides deep information regarding the routing capabilities of the device. It lists all the networks the router can reach and information about the way they can be reached, including:
- Network
- Routing protocol
- Next hop
- Outgoing interface
R1#show ip route
Codes: C – connected, S – static, 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,
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
R 80.1.1.0/24 [120/1] via 10.1.1.2, 00:00:04, Ethernet0/0.1
D 80.0.0.0/8 [90/281600] via 10.1.1.2, 00:02:02, Ethernet0/0.1
O E2 80.1.0.0/16 [110/20] via 10.1.1.2, 00:00:14, Ethernet0/0.1
In addition to the show commands presented above, other useful methods of verifying router connectivity include using the ping and traceroute commands.
Ping
The ping command provides a basic connectivity test to a specific destination. This way you can test whether the router can reach a network or not. Ping works (using ICMP) by sending echo requests to a machine to verify whether it is up and running. If a specific machine is operating, it will send an ICMP echo reply message back to the source, confirming its availability. A sample ping is presented below:
Router#ping 10.10.10.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 20/40/76 ms
A standard ping command sends five ICMP packets to the destination. When looking at the ping output, a dot (.) represents a failure and an exclamation mark (!) represents a successfully received packet. The ping command output also shows the round-trip time to the destination network (minimum, average, and maximum).
If you need to manipulate ping-related parameters, you can issue an extended ping from a Cisco router. This is done by typing ping and pressing Enter in the console. The router will prompt you with an interactive menu where you can specify the desired parameters, including:
- Number of ICMP packets
- Packet size
- Timeout
- Source interface
- Type of service
Router#ping
Protocol [ip]:
Target IP address: 10.10.10.2
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: FastEthernet0/0
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.2, timeout is 2 seconds:
Packet sent with a source address of 10.10.10.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/36/72 ms
Traceroute
The traceroute command is another useful tool that allows you to see the hops a packet passes until it reaches its destination. The output below shows that the packet has to cross a single hop until it reaches its destination:
R2#traceroute 192.168.1.1
Type escape sequence to abort.
Tracing the route to 192.168.1.1
1 10.10.10.1 60 msec * 64 msec
Just like with ping, Cisco routers allow you to perform an extended traceroute command that can define a number of associated parameters, most of them similar to the ping-related parameters:
Router#traceroute
Protocol [ip]:
Target IP address: 192.168.1.1
Source address: 10.10.10.2
Numeric display [n]:
Timeout in seconds [3]:
Probe count [3]:
Minimum Time to Live [1]:
Maximum Time to Live [30]:
Port Number [33434]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Type escape sequence to abort.
Tracing the route to 192.168.1.1
1 10.10.10.1 76 msec * 56 msec



