Configure Terminal Server
1. Configure an IP address on the ethernet interface
cisco(config)# int fa0/0
cisco(config-if)# ip add 192.168.1.50 255.255.255.0
cisco(config-if)# no shut
2. Create a loopback interface
cisco(config)# int lo0
cisco(config-if)# ip add 1.1.1.1 255.0.0.0
3. Configure the line based on the “show line” output.
* If enabled, the port will be accessible through the network on TCP port 20xx where xx is the TTY of the port on the router
cisco(config)# line 1 16
cisco(config-line)# no exec //unwanted signals from the attached device do not launch.
cisco(config-line)# exec-timeout 0 0 //disable the line timeout period
cisco(config-line)# logging synchronous
cisco(config-line)# transport input all
4. Configure default route
cisco(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.1
cisco(config)# ip default-gateway 192.168.1.1
// ip default-gateway is configured as well in case routing is not enabled. E.g. the terminal server is in ROMMON mode as a result of a bad reboot after power outage.
5. Enable telnet line
cisco(config)# line vty 0 4
cisco(config-line)# password cisco
cisco(config-line)# login
6. Configure host and line mapping
*e.g. Router A is connected to line 1
cisco(config)# ip host RouterA 2001 1.1.1.1
Enable SSH in Switch and Router
Assuming the IP address, enable password and default route are in place, the additional steps needed are as follows:
1. Configure a domain name
cisco(config)# ip domain-name cisco.com
2. Configure the RSA key generation for encryption
cisco(config)# crypto key generate rsa
* it may prompt user for the key length generated in the range of 360 to 2048. Default is 512-bit.
3. Configure authentication method
a) Using local database
cisco(config)# username cisco password cisco
OR
b) Using Radius server
cisco(config)# aaa new-model
cisco(config)# aaa authentication login Radius_Server group radius
cisco(config)# radius-server host 192.168.1.155
4. Configure the terminal line
cisco(config)# line vty 0 4
cisco(config-line)# login local // using local database
OR
cisco(config-line)# login authentication Radius_Server //using radius server
cisco(config-line)# transport input ssh
How to Configure NAT & PAT on a Cisco Router
Network Address Translation (NAT) was introduced to overcome these addressing problems that occurred with the rapid expansion of the Internet. Basically NAT allows a single network device (e.g a router, firewall etc) to act as an agent between a private local area network and a public network such as the Internet. The purpose of this NAT device is to translate the source IP addresses of the internal network hosts into public routable IP addresses in order to communicate with the Internet.
::Advantages::
- NAT helps to mitigate the depletion of the global public IP address space
- Networks can now use the RFC 1918 private address space internally and still have a way to access the Internet using NAT.
- NAT increases security by hiding the internal network topology and addressing scheme.
Cisco IOS routers support different types of NAT as will be explained below. NAT has many forms and can work in several ways, but in this post I will explain the four most important types of NAT:
1. Overloading or Port Address Translation (PAT)
This is the most frequently used form of NAT in IP networks. It uses the concept of “many-to-one” translation where multiple connections from different internal hosts are “multiplexed” into a single registered (public) IP address using different source port numbers. This type of NAT allows a maximum of 65,536 internal connections to be translated into a single public IP. This type of NAT is very useful in situations where our ISP has assigned us only a single public IP address, as shown below.

In our scenario above, our internal network range is 192.168.32.0/24 and our assigned public IP address is 213.18.123.100. All internal hosts will be translated to the public address using different port numbers.
Configuration:
Router(config)# interface ethernet 0
Router(config-if )# ip address 192.168.32.1 255.255.255.0
Router(config-if )# ip nat inside
Router(config)# interface serial 0
Router(config-if )# ip address 213.18.123.100 255.255.255.0
Router(config-if )# ip nat outside
Router(config)# ip nat pool overloadpool 213.18.123.100 213.18.123.100 prefix-length 24
Router(config)# ip nat inside source list 1 pool overloadpool overload
Router(config)# access-list 1 permit 192.168.32.0 0.0.0.255
2. Dynamic NAT
Dynamic NAT translates internal private IP addresses to public addresses from a range (pool) of public addresses assigned to our network from an ISP.

In our example scenario above, assume that we own the range of public IP addresses 213.18.123.0/24. Any internal host accessing the internet, will be translated by the NAT router to the first available public IP in the public pool range. In our example above, internal host 192.168.32.10 is translated to 213.18.123.116 (one-to-one mapping). Similarly, 192.168.32.12 is translated to 213.18.123.112 etc.
Configuration:
Router(config)# interface ethernet 0
Router(config-if )# ip address 192.168.32.1 255.255.255.0
Router(config-if )# ip nat inside
Router(config)# interface serial 0
Router(config-if )# ip address 100.100.100.1 255.255.255.252
Router(config-if )# ip nat outside
Router(config)# ip nat pool dynamicpool 213.18.123.0 213.18.123.255 prefix-length 24
Router(config)# ip nat inside source list 1 pool dynamicpool
Router(config)# access-list 1 permit 192.168.32.0 0.0.0.255
3. Static NAT
This form of NAT creates a permanent one-to-one static mapping of a public IP address with a private IP address. It is particularly useful in cases where an internal host needs to be accessible from the outside public internet.

In our example diagram above, the internal host with private IP address 192.168.32.10 will always be translated to 213.18.123.110. Hosts from the outside public internet will be able to directly access the statically nated internal hosts by accessing their mapped public IP address. This scenario is useful to provide access to public company servers such as Web Server, Email Server etc.
Configuration:
Router(config)# interface ethernet 0
Router(config-if )# ip address 192.168.32.1 255.255.255.0
Router(config-if )# ip nat inside
Router(config)# interface serial 0
Router(config-if )# ip address 100.100.100.1 255.255.255.252
Router(config-if )# ip nat outside
Router(config)# ip nat inside source static 192.168.32.10 213.18.123.110
Router(config)# ip nat inside source static 192.168.32.12 213.18.123.111
Router(config)# ip nat inside source static 192.168.32.15 213.18.123.112
4. Port Redirection
This is useful in situations where we have a single public IP address and we need to use it for accessing two or more internal servers from outside. Assume that we have a Web and Email servers that we need to provide access from outside using only a single public IP address. Assume that our public address is 100.100.100.1. Inbound traffic coming towards address 100.100.100.1 port 80 will be redirected to our internal Web Server 192.168.32.10, and inbound traffic coming towards address 100.100.100.1 port 25 will be redirected to our internal Email Server 192.168.32.20.
Configuration:
Router(config)# interface ethernet 0
Router(config-if )# ip address 192.168.32.1 255.255.255.0
Router(config-if )# ip nat inside
Router(config)# interface serial 0
Router(config-if )# ip address 100.100.100.1 255.255.255.252
Router(config-if )# ip nat outside
Router(config)# ip nat inside source static tcp 192.168.32.10 80 100.100.100.1 80
Router(config)# ip nat inside source static tcp 192.168.32.20 25 100.100.100.1 25
Troubleshooting commands:
Router#show ip nat translation
To show the current translations preformed by NAT
Router#show ip nat static
To show the static translations of NAT
Router#debug ip nat
To watch the instantaneous interactions of NAT
Note: To disable NAT, you need to do the following steps:
1. Disable NAT on the local and global interfaces
Router(config-if)#no ip nat inside
on the local, and
Router(config-if)#no ip nat outside
on the global interface.
2. Clear the contents of the translation table,
Router#clear ip nat translations
3. Remove the NAT assignment command by preceding it with a ‘no’
4. Remove the access-list, if any.
How to Configure DHCP on a Cisco Router
1. Define the DHCP address pool,
Router(config)#ip dhcp pool POOLNAME
Router(dhcp-config)#network XXX.XXX.XXX.XXX YYY.YYY.YYY.YYY
where,
XXX.XXX.XXX.XXX is the network address to be used by the DHCP pool
YYY.YYY.YYY.YYY is the subnet mask for the network.
You can replace the subnet mask by a (/PREFIX) to provide the subnet mask.
2. Configure the parameters to be sent to the client,
Router(dhcp-config)#dns-server XXX.XXX.XXX.XXX
To provide the DNS server IP address
Router(dhcp-config)#default-router XXX.XXX.XXX.XXX
To provide the IP address of the default gateway
Router(dhcp-config)#domain-name NAME
To provide the name of the domain of the network (if in a domain environment)
Router(dhcp-config)#netbios-name-server XXX.XXX.XXX.XXX
To provide the IP address of the NetBIOS name server
Router(dhcp-config)#lease DAYS HOURS MINUTES
To define the lease time of the addresses given to the client. You can make it infinite by using this command instead; lease infinite
There is a large group of settings that you can configure to be sent to the clients, and I have only mentioned the most frequently used.
3. Configure the IP addresses to be excluded from the pool. This is usually done to avoid the conflicts caused by the DHCP with servers and printers. Remember to give ALL servers and network printers static IP addresses in the same range of the DHCP pool. And then exclude these addresses from the pool to avoid conflicts.
Router(config)#ip dhcp excluded-address XXX.XXX.XXX.XXX
Use the command in the previous form to excluded a single address. You can repeat it as much as you see fit for the IP addresses you want to exclude. Or,
Router(config)#ip dhcp excluded-address YYY.YYY.YYY.YYY ZZZ.ZZZ.ZZZ.ZZZ
where,
YYY.YYY.YYY.YYY is the start of the range to be excluded from the pool
ZZZ.ZZZ.ZZZ.ZZZ is the end of the range
This way you can exclude a range or ranges of IP addresses and reserve them for static addresses use.
4. Enable the DHCP service in the router
Router(config)#service dhcp
To disable it use
Router(config)#no service dhcp
Usually the DHCP service is enabled by default on your router.
5. Use the following commands to check the DHCP operation on the router:
Router#show ip dhcp binding
This command shows the current bindings of addresses given to clients
Router#show ip dhcp server statistics
This command show the DHCP server statistics.
Router#debug ip dhcp server
This debug command is used to troubleshoot DHCP issues.
Implementation notes:
1. If you have a DHCP server other than the router, and you would like to let the router to forward the DHCP requests from a certain LAN to the DHCP server laying outside that LAN, go to the Ethernet interface that does not have the DHCP server and type the following command:
Router(config-if)#ip helper-address XXX.XXX.XXX.XXX
where XXX.XXX.XXX.XXX is the IP address of the server laying outside this LAN.
2. You can create a DHCP database agent that stores the DHCP binding database. A DHCP database agent is any host, for example, an FTP, TFTP, or RCP server that stores the DHCP bindings database. You can configure multiple DHCP database agents and you can configure the interval between database updates and transfers for each agent. To configure a database agent and database agent parameters, use the following command in global configuration mode:
Router(config)#ip dhcp database url [timeout seconds | write-delay seconds]
An example url is this
ftp://user:password @ 192.168.0.3/router-dhcp (remove the spaces before implementing)
If you choose not to configure a DHCP database agent, disable the recording of DHCP address conflicts on the DHCP server. To disable DHCP address conflict logging, use the following command in global configuration mode:
Router(config)#no ip dhcp conflict logging
3. DHCP service uses port 67 and 68. So, if you are using a firewall, remember to open these ports.
4. To clear DHCP server variables, use the following commands as needed:
Router#clear ip dhcp binding *
If you want to clear a certain binding not all of them, replace the * in the previous command with the IP address to be cleared.
Router#clear ip dhcp server statistics
How to recover a PIX Firewall password
If you ever lose a password on a PIX Firewall and need to recover it, follow these steps:
if you ever need to recover a password on the PIX
here are the steps:
Requirements:
* You will need a console connection from the PIX to your machine
* You will need a TFTP server application running on your machine
(I personally use tftpd32, which can be downloaded for free
at http://tftpd32.jounin.net/)
1) Connect the console cable to your serial port and plug the RJ45 end
into the PIX port marked "Console". You can use Hyperterm (which comes
with Windows) or any other console program of your choice. I use
TeraTerm Pro, found at http://www.ayera.com/teraterm/.
2) Find out what version of software is running on your PIX. If you're
not sure, you can find out very easy in the following way. If you
are connected to the PIX via a console connection, simply reboot the
PIX and watch for the output. It will tell you which version is
running.
3) Download the corresponding helper binary file from Cisco, depending
on which software version is running on the PIX. For example, if you
were running version 6.3(x) you could use the file called np63.bin found
here: http://www.cisco.com/warp/public/11... If you were running
6.2 you could simply change the last characters on the above url to be
np62.bin. Download that file and save it to the root directory of your
TFTP application.
4) Next, reboot the PIX again and immediately after the reboot as it is
coming back up and displaying text in your console send a break sequence
with your keyboard. If you are using Hyperterminal with Windows the break
sequence is Ctrl-Break.
5) This will send the PIX into "Monitor" status and you will see the following
prompt on the PIX:
monitor>
6) Patch your computer into the inside or outside interface on the PIX via a
standard CAT 5 cable (i.e. patch from your computers NIC to one of the PIX's
interfaces).
7) Give your computer an IP address. For this example, let's use 10.0.0.1
with a gateway of 255.0.0.0
8) Start up your TFTP server program and keep it running.
9) Tell the PIX which interface you will be connecting to, as follows:
monitor> interface 1
*note interface 1 is inside, interface 0 is outside, but you remember that
from reading the ebook right? :)
10) Give the PIX a temporary IP address on the same network as your computer,
as follows:
monitor> address 10.0.0.2
11) Tell the PIX the IP address of the TFTP server (your computer)
monitor> server 10.0.0.1
12) Tell the PIX which file to copy:
monitor> file np63.bin
13) Start the TFTP copy
monitor> tftp
14) It should copy very quickly. If it does not you will get
an error message on the PIX and potentially on the TFTP server
software. If you do get an error, you likely have a cabling
issue or perhaps a typo of one of the above commmands.
15) Once the file is copied to the PIX, the PIX will ask if you are
sure you want to reset the password. Type "Y" for yes, and the PIX
will reboot.
16) After the reboot the PIX will now have a default telnet password
of "cisco" (no quotes) and no enable password.
That's about it. About 10 minutes of downtime and you and your PIX Firewall are back in action!
Add a second Router to your LAN
A brief guide on how to properly add a second (or third) router to an existing LAN that already has a
The general setup of SOHO Router's is similar. While some use a different subnet, every one I've worked with uses a Class C Private IP Addressing Scheme. I'm going to use the basic Class C private for this tutorial (192.168.0.0)
I'm going to give two setup guides:
The term “Router1” will refer to the router connected to the internet. Any others (ie: Router2, Router3) will be downstream of Router1
Version 1:
========
Router1 (LAN Side):
========
DHCP Enabled = Yes
3 WAN Protocols you should know: HDLC, PPP, and Frame-Relay
Your company is connected to the Internet, right? (everyone nod your head yes) So what WAN protocol do you use to connect to the Internet? Chances are, that if you have a T1 leased line to the Internet or a private network between locations, you use one of these three WAN Protocols: HDLC, PPP, or Frame-relay. Let’s explore the differences and similarities of these protocols.
What is HDLC?
HDLC stands for High-Level Data Link Control protocol. Like the two other WAN protocols mentioned in this article, HDLC is a Layer 2 protocol. HDLC is a simple protocol used to connect point to point serial devices. For example, you have point to point leased line connecting two locations, in two different cities. HDLC would be the protocol with the least amount of configuration required to connect these two locations. HDLC would be running over the WAN, between the two locations. Each router would be de-encapsulating HDLC and turning dropping it off on the LAN.
HDLC performs error correction, just like Ethernet. Cisco’s version of HDLC is actually proprietary because they added a protocol type field. Thus, Cisco HDLC can only work with other Cisco devices.
HDLC is actually the default protocol on all Cisco serial interfaces. If you do a show running-config on a Cisco router, your serial interfaces (by default) won’t have any encapsulation. This is because they are configured to the default of HDLC. If you do a show interface serial 0/0, you’ll see that you are running HDLC. Here is an example:
What is PPP?
You may have heard of the Point to Point Protocol (PPP) because it is used for most every dial up connection to the Internet. PPP is documented in RFC 1661. PPP is based on HDLC and is very similar. Both work well to connect point to point leased lines.The differences between PPP and HDLC are:
- PPP is not proprietary when used on a Cisco router
- PPP has several sub-protocols that make it function.
- PPP is feature-rich with dial up networking features
- Link quality management monitors the quality of the dial-up link and how many errors have been taken. It can bring the link down if the link is receiving too many errors.
- Multilink can bring up multiple PPP dialup links and bond them together to function as one.
- Authentication is supported with PAP and CHAP. These protocols take your username and password to ensure that you are allowed access to the network you are dialing in to.
After changing the encapsulation to ppp, I typed ppp ? to list the PPP options available. There are many PPP options when compared to HDLC. The list of PPP options in the screenshot is only a partial list of what is available.
What is Frame-Relay?
Frame Relay is a Layer 2 protocol and commonly known as a service from carriers. For example, people will say “I ordered a frame-relay circuit”. Frame relay creates a private network through a carrier’s network. This is done with permanent virtual circuits (PVC). A PVC is a connection from one site, to another site, through the carrier’s network. This is really just a configuration entry that a carrier makes on their frame relay switches.Obtaining a frame-relay circuit is done by ordering a T1 or fractional T1 from the carrier. On top of that, you order a frame-relay port, matching the size of the circuit you ordered. Finally, you order a PVC that connects your frame relay port to another of your ports inside the network.
The benefits to frame-relay are:
- Ability to have a single circuit that connects to the “frame relay cloud” and gain access to all other sites (as long as you have PVCs). As the number of locations grow, you would save more and more money because you don’t need as many circuits as you would if you were trying to fully-mesh your network with point to point leased lines.
- Improved disaster recovery because all you have to do is to order a single circuit to the cloud and PVC’s to gain access to all remote sites.
- By using the PVCs, you can design your WAN however you want. Meaning, you define what sites have direct connections to other sites and you only pay the small monthly PVC fee for each connection.
- LMI = local management interface. LMI is the management protocol of frame relay. LMI is sent between the frame relay switches and routers to communicate what DLCI’s are available and if there is congestion in the network.
- DLCI = data link connection identifier. This is a number used to identify each PVC in the frame relay network.
- CIR = committed information rate. This is the amount bandwidth you pay to guarantee you will receive, on each PVC. Generally you have much less CIR than you have port speed. You can, of course, burst above your CIR to your port speed but that traffic is marked DE.
- DE = discard eligible. Traffic marked DE (that was above your CIR) CAN be discarded by the frame-relay network if there is congestion.
- FECN & BECN = forward explicit congestion notification & backward explicit congestion notification. These are bits set inside LMI packets to alert the frame-relay devices that there is congestion in the network.
::::Summary::::
We talked about three different WAN protocols that every network administrator should be familiar with. HDLC would be the most common protocol used to connect to the Internet but all three WAN protocols are offered, by carriers, as possible encapsulations to use to connect to the InternetPrivilege Levels in Cisco IOS.
A useful management tool available in IOS is the one that gives you the ability to assign levels of
privilege. Privilege levels are assigned to both users and commands. The privilege levels range
from 0 to 15. By default, commands are assigned either level 1 or level 15. Those commands that
need to be executed in privileged EXEC mode are level 15 commands. With a few exceptions,
those commands that can be executed in user EXEC mode are level 1 command. A small number
of commands are level 0 commands. These commands include enable, disable, exit, logout, and
help. Level 0 commands can be executed at any level.
A user operating in privileged EXEC mode is a level 15 user. A user operating in user EXEC
mode is a level 1 user. Commands and users can be assigned a privilege level different from their
default. The way the privileges work is a higher level has the same rights as the lower levels
beneath it. For instance, a level 10 user (if you set one up) can do everything users at levels 9
through 0 can do. Level 15 users can execute all commands.
Commands can be reassigned a different level of privilege as well. You can raise or lower the
level of privilege on any command. Privilege levels on commands are assigned using the
Privilege command; the command syntax is as follows. Use global configuration mode for this
command.
privilege
This feature is quite useful as it allows us to create various levels of users with custom rights to
IOS commands. Imagine if you had a number of administrators with limited knowledge of the
workings of IOS. But you need their help with certain specific tasks such as shutting down and
re-enabling an interface or adding users to an access server. You can configure the router or
access server so that depending upon the password provided, the user will be assigned a specific
level of privilege and will only be allowed to use commands assigned to that level and below.
Privilege levels for users can be set in a number of ways via the IOS. They can be set
permanently on a line using the privilege level command; at the command prompt using the
enable command; or when logging in using the username command.
To set the default privilege level for a line, use the privilege level command in line configuration
mode. The syntax is as follows: privilege level <0 – 15>.
To interactively reset the level of privilege from the command line, use the enable command.
The command syntax is enable <0 – 15>. The command can be executed in any EXEC mode. If
you leave off the level number, the router assumes you mean 15. It is advisable to set up an
“enable secret” password for each level of privilege. Be sure each level’s password is different
and that the passwords are only known to users within the appropriate level. The syntax for this
command is enable secret level <1-15>
The most common way to assign levels of privilege is to do so based on the user’s username.
The IOS allows you to create and use username/password pairs in your router configuration for
authentication purposes. Along with the authentication process, the user can be assigned as level
of privilege.
Examples:
In the example below, we have created three custom user levels using level numbers 2, 3, and 4.
Level 2 users can do show commands as well as all commands in levels below. By default, level
1 users can do most show commands. But after issuing the command privilege exec level 2
show in our configuration, it will no longer be possible. Level 3 users are permitted to issue the
command show ip route, but level 2 users cannot. Level 4 and above users can issue the show
access-list command as well as any command in levels below.
Router(config)# privilege exec level 2 show
Router(config)# privilege exec level 3 show ip route
Router(config)# privilege exec level 4 show access-list
The example below shows us assigning level 2 to any user that enters the router via telnet. It
assigns level 3 to any user that enters via the auxiliary port. And it assigns level 4 to anyone that
enters via the console port.
Router(config)# line vty 0 4
Router(config-line)# privilege level 2
Router(config-line)# line aux 0
Router(config-line)# privilege level 3
Router(config-line)# line console 0
Router(config-line)# privilege level 4
The example below creates a separate password for each custom level of privilege. If a user
issues the command enable 2, that user will be prompted for the password “twopass”. A level
three request will require the level three password and so on.
Router(config)# enable secret level 2 twopass
Router(config)# enable secret level 3 threepass
Router(config)# enable secret level 4 fourpass
The example below creates three users: bob, fred, and sam. Bos is a level 2 user. Fred is a level 3
user. Sam is a level 4 user. To have the router prompt for username and password when logging
in, use the command login local in your line configuration mode.
Router(config)# username bob privilege 2 password bobpass
Router(config)# username fred privilege 3 password fredpass
Router(config)# username sam privilege 4 password sampass
Router(config)# line vty 0 4
Router(config-line)# login local
Step by Step Cisco Router Local Password Recovery
Theres no real intro needed to this tutorial. This is literally going to be a step by step, just
as the title suggests. However, before I go on, I think it important to know WHY and HOW
this works as well as it can be applied somewhat to other devices/situations.
Cisco routers work like this:
ROM > NVRAM > FLASH > DRAM
lets break it down:
ROM:
This is your Basic IOS. (thats Internetworking Operating System for those who dont know)
Think of it kind of like CMOS with the exception that you cannot flash or alter it. The ROM
contains the /BOOTP as well.
The Bootp has a value which defines how the device will boot.
They are as follows:
0x2102 <-- normal boot sequence
0x2142 <-- skips NVRAM
0x2101 <-- skips FLASH
0x2000 <-- diagnostic mode
NVRAM:
Non Volatile RAM. This is like a hard drive being that the memory is non-volatile meaning
that the info in it stays after a reboot. This contains the startup-config which contains the
PWs to the device.
FLASH:
This is your IOS.
DRAM:
Think of this as RAM, because thats what it is. Its volatile memory that contains the
running-config. Any changes you make to the system are saved to the running config but
being its volatile, once the system is rebooted for whatever reason, those changes are gone.
This is why you "copy run start" to save the changes in the running config to the startup
config so that they are applied if/when the device is rebooted.
(pardon the abbreviation of the commands, but as anyone thats used Ciscos IOS knows,
you can abbreviate any command or subcommand pretty well, so no need to write it all out.
"cop ru st" will so the same thing as "copy run start". Blah blah blah, you get the idea, no
need to get into this now.)
Moving on.
Now that Ive explained all that and you hopefully have an understanding of how the
devices boot sequence works, on to the password recovery.
1. Reboot the device.
2. press control + break within 60 seconds of the reboot.
this brings you to the basic IOS.
Now you can change the value in the BOOTP from 0x2102 to 0x2142, which skips
NVRAM, which contans the startup-config, which contains the password.
3. Reset.
Ok, so now that this point the device will boot up and due to the change in the bootp will
bypass the NVRAM and bring you into the IOS.
4. At the prompt:
Router> enable
Router# copy start run
ROUTERNAME#config t
here is where you either view or change the password. You may be able to view it if the
administrator hasnt encrypted it. If thay have, you can crack it or easier still just assign a
new one.
ROUTERNAME(config)#config 0x2102
this changes the boot sequence back to normal.
ROUTERNAME#copy run start
This copies the DRAM to the NVRAM... thus saving the changes you made.
5. Reboot.
Done. The device will then reboot and prompt you for the password that you just set. Enter
it and its all good.
Hope you enjoyed this tutorial.
Frame Relay Configuration
1. Configuration Manual Resolution:
R1>enable
R1#configure terminal
R1(config)#interface serial 1/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#encapsulation frame-relay
R1(config-if)#frame-relay lmi-type ansi
R1(config-if)#frame-relay map ip 192.168.1.2 100
R1(config-if)#no shutdown
R2>enable
R2#configure terminal
R2(config)#interface serial 1/0
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay lmi-type cisco
R2(config-if)#frame-relay map ip 192.168.1.1 200
R2(config-if)#no shutdown
1. Configuration Dynamic Resolution:
R1>enable
R1#configure terminal
R1(config)#interface serial 1/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#encapsulation frame-relay ietf
R1(config-if)#no shutdown
R2>enable
R2#configure terminal
R2(config)#interface serial 1/0
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#encapsulation frame-relay ietf
R2(config-if)#no shutdown
Frame-relay Non-broadcast multiple access configuration (NBMA):
R1>enable
R1#configure terminal
R1(config)#interface serial 1/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#encapsulation frame-relay
R1(config-if)#frame-relay map ip 192.168.1.2 100
R1(config-if)#frame-relay map ip 192.168.1.3 101
R1(config-if)#no shutdown
R1(config-if)#end
R2>enable
R2#configure terminal
R2(config)#interface serial 1/0
R2(config-if)#ip add 192.168.1.2 255.255.255.0
R2(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay map ip 192.168.1.1 200
R2(config-if)#frame-relay map ip 192.168.1.3 200
R2(config-if)#no shutdown
R2(config-if)#end
R3>enable
R3#configure terminal
R3(config)#interface serial 1/0
R3(config-if)#ip add 192.168.1.3 255.255.255.0
R3(config-if)#encapsulation frame-relay
R3(config-if)#frame-relay map ip 192.168.1.1 300
R3(config-if)#frame-relay map ip 192.168.1.2 300
R3(config-if)#no shutdown
R3(config-if)#end
Frame-relay point-to-point configuration
R1>enable
R1#configure terminal
R1(config)#interface serial 1/0
R1(config-if)#no ip address
R1(config-if)#encapsulation frame-relay
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial 1/0.100 point-to-point
R1(config-subif)#ip add 192.168.1.1 255.255.255.0
R1(config-subif)#frame-relay interface-dlci 100
R1(config-subif)#exit
R1(config)#interface serial 1/0.101 point-to-point
R1(config-subif)#ip add 192.168.2.1 255.255.255.0
R1(config-subif)#frame-relay interface-dlci 101
R2>enable
R2#configure terminal
R2(config)#interface serial 1/0
R2(config-if)#ip add 192.168.1.2 255.255.255.0
R2(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay interface-dlci 200
R2(config-if)#no shutdown
R2(config-if)#end
R3>enable
R3#configure terminal
R3(config)#interface serial 1/0
R3(config-if)#ip add 192.168.2.2 255.255.255.0
R3(config-if)#encapsulation frame-relay
R3(config-if)#frame-relay interface-dlci 300
R3(config-if)#no shutdown
R3(config-if)#end
Frame-relay multi point configuration:
R1>enable
R1#configure terminal
R1(config)#interface serial 1/0
R1(config-if)#no ip address
R1(config-if)#encapsulation frame-relay
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial 1/0.100 multipoint
R1(config-subif)#ip add 192.168.1.1 255.255.255.0
R1(config-subif)#frame-relay interface-dlci 100
R1(config-subif)#frame-relay interface-dlci 101
R1(config-subif)#exit
R2>enable
R2#configure terminal
R2(config)#interface serial 1/0
R2(config-if)#ip add 192.168.1.2 255.255.255.0
R2(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay interface-dlci 200
R2(config-if)#no shutdown
R2(config-if)#end
R3>enable
R3#configure terminal
R3(config)#interface serial 1/0
R3(config-if)#ip add 192.168.1.3 255.255.255.0
R3(config-if)#encapsulation frame-relay
R3(config-if)#frame-relay interface-dlci 300
R3(config-if)#no shutdown
R3(config-if)#end
Cisco Router Configuration Commands
| Requirement | Cisco Command |
|---|---|
| Set a console password to cisco | Router(config)#line con 0 Router(config-line)#login Router(config-line)#password cisco |
| Set a telnet password | Router(config)#line vty 0 4 Router(config-line)#login Router(config-line)#password cisco |
| Stop console timing out | Router(config)#line con 0 Router(config-line)#exec-timeout 0 0 |
| Set the enable password to cisco | Router(config)#enable password cisco |
| Set the enable secret password to peter. This password overrides the enable password and is encypted within the config file | Router(config)#enable secret peter |
| Enable an interface | Router(config-if)#no shutdown |
| To disable an interface | Router(config-if)#shutdown |
| Set the clock rate for a router with a DCE cable to 64K | Router(config-if)clock rate 64000 |
| Set a logical bandwidth assignment of 64K to the serial interface | Router(config-if)bandwidth 64 Note that the zeroes are not missing |
| To add an IP address to a interface | Router(config-if)#ip addr 10.1.1.1 255.255.255.0 |
| To enable RIP on all 172.16.x.y interfaces | Router(config)#router rip Router(config-router)#network 172.16.0.0 |
| Disable RIP | Router(config)#no router rip |
| To enable IRGP with a AS of 200, to all interfaces | Router(config)#router igrp 200 Router(config-router)#network 172.16.0.0 |
| Disable IGRP | Router(config)#no router igrp 200 |
| Static route the remote network is 172.16.1.0, with a mask of 255.255.255.0, the next hop is 172.16.2.1, at a cost of 5 hops | Router(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.1 5 |
| Disable CDP for the whole router | Router(config)#no cdp run |
| Enable CDP for he whole router | Router(config)#cdp run |
| Disable CDP on an interface | Router(config-if)#no cdp enable |
Cisco Router Show Commands
| Requirement | Cisco Command |
|---|---|
| View version information | show version |
| View current configuration (DRAM) | show running-config |
| View startup configuration (NVRAM) | show startup-config |
| Show IOS file and flash space | show flash |
| Shows all logs that the router has in its memory | show log |
| View the interface status of interface e0 | show interface e0 |
| Overview all interfaces on the router | show ip interfaces brief |
| View type of serial cable on s0 | show controllers 0 (note the space between the 's' and the '0') |
| Display a summary of connected cdp devices | show cdp neighbor |
| Display detailed information on all devices | show cdp entry * |
| Display current routing protocols | show ip protocols |
| Display IP routing table | show ip route |
| Display access lists, this includes the number of displayed matches | show access-lists |
| Check the router can see the ISDN switch | show isdn status |
| Check a Frame Relay PVC connections | show frame-relay pvc |
| show lmi traffic stats | show frame-relay lmi |
| Display the frame inverse ARP table | show frame-relay map |
Cisco Router Basic Operations
| Requirement | Cisco Command |
|---|---|
| Enable | Enter privileged mode |
| Return to user mode from privileged | disable |
| Exit Router | Logout or exit or quit |
| Recall last command | up arrow or |
| Recall next command | down arrow or |
| Suspend or abort | |
| Refresh screen output | |
| Compleat Command | TAB |
Cisco Router Copy Commands
| Requirement | Cisco Command |
|---|---|
| Save the current configuration from DRAM to NVRAM | copy running-config startup-config |
| Merge NVRAM configuration to DRAM | copy startup-config running-config |
| Copy DRAM configuration to a TFTP server | copy runing-config tftp |
| Merge TFTP configuration with current router configuration held in DRAM | copy tftp runing-config |
| Backup the IOS onto a TFTP server | copy flash tftp |
| Upgrade the router IOS from a TFTP server | copy tftp flash |
Cisco Router Debug Commands
| Requirement | Cisco Command |
|---|---|
| Enable debug for RIP | debug ip rip |
| Enable summary IGRP debug information | debug ip igrp events |
| Enable detailed IGRP debug information | debug ip igrp transactions |
| Debug IPX RIP | debug ipx routing activity |
| Debug IPX SAP | debug IPX SAP |
| Enable debug for CHAP or PAP | debug ppp authentication |
| Switch all debugging off | no debug all undebug all |
Top 10 Tips for Cisco Routers Configuration
There are few simple things that might help administrators in utilizing their time working with Cisco routers. I gathered the most important ten things, in my point of view, and wrote them down.
1. The best sequence of configuring a Cisco router, as I see it, is the following:
a. Setup the hostname with the ‘hostname XXXXXX’ command.
b. Setup the secret password (or enable password) with the ‘enable secret XXXXX’ command.
c. Setup console and telnet passwords (use the ‘logging synchronous’ command at the console) with the ‘password XXXXX’ and ‘login’ commands.
d. Encrypt the un-encrypted passwords with ‘service password-encryption’ command and don’t forget to turn it off after you ‘show run’.
e. Setup the interfaces (IP addresses, description, bandwidth, etc) with ‘ip address’, ‘bandwidth’, and ‘description’ commands
f. Setup the Routing protocols (or static routes)
g. Test the connectivity with ‘ping’ and ‘traceroute’
h. Setup the access-lists
i. Test the connectivity (again)
2. Be as descriptive as possible.
Use the ‘description’ command on ALL interfaces. And give useful description in it. Describe the network to which this interface is connected, the bandwidth of the link, the duplex settings, and any other information that you might think useful. Use ‘remark’ in writing the access-lists so you would identify the access-list according to its function. And if you find it necessary, use banners.
Examples:
RouterA(config-if)#description This link is connected to the Accounting Lan
RouterA(config)#access-list 101 remark This list stops the telnet to the Marketing net
RouterA(config)#banner motd #This router is connected to the marketing and accounting LANS#
3. Use hotkeys.
There are many useful hotkeys in the configuration command line environment. Few of the most important are:
Control P Recalls the previous command in the history buffer
Control N Recalls the next command in the history buffer
Control E Goes to the end of the line
Control A Goes to the beginning of the line
4. Stop the router from looking-up DNS server for wrong commands.
When you misspell a command and hit the ‘Enter’ key, the router does not recognize the command and thinks that it might be a host name. The router, then, tries to contact the DNS server to resolve the name to an IP address so it would telnet it. This would take a large amount of time, especially when you have not setup a valid DNS server (because the router will broadcast the request and waits for a DNS server to reply). To turn this off, use the ‘transport preferred none’ command in the console and vty lines.
Example:
RouterA(config)#line con 0
RouterA(config-line)#transport preferred none
5. Setup the Bandwidth of serial interfaces.
Use the ‘bandwidth’ command for setting the bandwidth of ALL serial interfaces to guarantee the correct calculation of routing table. The bandwidth of a serial link is dependant on the type of WAN connection you are using. And unlike Ethernet or FastEthernet, serial interfaces cannot automatically detect the bandwidth of the link. And the bandwidth of the actual link might be different from the small link between the serial interface and the modem or CSU/DSU device you are using. And remember to write the bandwidth after the ‘bandwidth’ command in Kilobits.
Example:
RouterA(config)#int serial 0
RouterA(config-if)#bandwidth 1024 >> This means the link bandwidth is 1Mbit/second
6. Turn off Auto-summarization of routing updates when using subnetted addresses.
If you are using subnetting, remember use the ‘no auto-summary’ command to turn off auto-summarization. This is when using routing protocols that support it, like OSPF.
Example:
RouterA(config)#no auto-summary
7. Turn off split-horizon in two cases.
The first is when you are doing inter-VLAN routing. This is because updates from one VLAN can not pass to other VLANs. And the second case is when you are using frame-relay to connect one site to multiple sites.
Example:
RouterA(config-if)#no ip split-horizon
8. The ‘show’ command is your best friend.
Whenever you’re in trouble, or even if you’re not in trouble yet, you best friend comes up; the ‘show’ command. The most widely used ‘show’ commands are the following:
show version - Shows some good information like the IOS version, the configuration-register value and the interfaces available.
show ip route - Shows the routing table
show ip interface - Shows the access-lists applied to interfaces
show access-list - Shows the contents of access-lists
show ip protocols - Shows information about the routing protocols currently running.
show cdp neighbor detail - Shows detailed information about neighboring devices.
show interface - Show status information about interfaces.
show run - Shows the running configuration, i.e., all the commands now in action.
9. Keep the IP addresses of servers and printers out of the DHCP pool.
When using the router as a DHCP server, do NOT forget to exclude the addresses of server and printers off the DHCP pool.
Example:
RouterA(config)#ip dhcp excluded-address 192.168.0.1
RouterA(config)#ip dhcp excluded-address 192.168.0.1 192.168.0.10
You can use a single IP address in this command or a start-IP and end-IP to define a range.
10. Keep a scheduled ‘reload’ when configuring a router remotely.
When you are configuring a router remotely, you might do something wring and loose the connectivity with the router. In this case, you will need to restart the router physically. There are chances that no one is around the router to restart it for you. You can solve this by yourself by using the ‘reload in xx’ command. This command schedules a reload after xx minutes. So, before you start nosing around the router remotely, issue this command and schedule a reload. If something goes wrong and you loose the connectivity with the router, the router will reload and you get back in business. And if things go smooth and you don’t need to reload after all, you can issue a ‘reload cancel’ command to stop the scheduled restart from happening.
I hope you find these tips useful in getting you out of trouble or getting you away from it.
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, or chap 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.
c. Now you can set the username and password that you local router would use to access the remote router. For PAP authentication, you can specify the username and password that the local router will send to the remote router for authentication using the following command,
Router(config-if)#ppp pap sent-username USER passwrod PASS
For CHAP, two commands are used,
Router(config-if)#ppp chap hostname USER
Router(config-if)#ppp chap password PASS
The usernames and passwords are case sensitive, so be careful when writing them. This way, you will have to write the hostname and secret password of the remote router in your local router and write the hostname and secret password of your local router into your remote using the 'username' command.
If you do not set the username and password that will be sent from the local router to the remote router for authentication, the router will use its hostname and secret password instead.
3. You can monitor the quality of the serial link that is using PPP with the following command,
Router(config-if)#ppp quality PERCENT
where PERCENT is the minimum accepted link quality. If the link quality drops below PERCENT, the link will be shutdown and considered bad.
4. If the available bandwidth is small, you might consider compressing the data being transmitted using the following command,
Router(config-if)#ppp compress YYY
where YYY is the compression type which can be predictor or stacker.
Note: The compression might affect the system performance because it increases the CPU load. Check the CPU load with ‘show process cpu’ and disable the compression if the CPU load is over 65%.
5. To troubleshoot PPP, you can use the following commands,
Router#debug ppp negotioations
Router#debug ppp packets
Router#debug ppp errors
Router#debug ppp authentication
IOS Commands
| Modes | Description |
| Router> | User mode |
| Router# | Privileged mode |
| Router(config)# | Global configuration mode |
| Router(config-if)# | Interface mode |
| Command | Description | Syntax |
| Enable | Puts you into privileged mode | Router>enable |
| Disable | Takes you from privileged mode back to user mode | Router>disable |
| Config Terminal | Puts you in global configuration mode and change the running-config | Router#config t |
| Hostname | Sets the name of a router | Router(config)#hostname R1 |
| Banner | Creates a banner for users who log into the router | Router(config)#banner motd # |
| Enable Password | Sets the encrypted enable password | Router(config)#enable password |
| Enable Secret | Sets the encrypted enable secret. Supersedes the enable password if set | Router(config)#enable secret |
| Line Aux | Puts in the auxiliary interface configuration mode | Router(config)#line aux 0 Router(config-line)#login Router(config)# password cisco |
| Line Console 0 | Puts you in the console configuration mode | Router(config)#line console 0 Router(config-line)#login Router(config)# password cisco |
| Line Vty | Puts you in VTY (Telnet) interface configuration mode | Router(config-line)#line vty 0 4 Router(config-line)#login Router(config)# password cisco |
| Service Password-encryption | Encrypts the user mode and enable password | Router(config)#service password-encryption |
| Terminal History Size | Changes your history size from the default of 10 up to 256 | Router#terminal history size 25 |
| Telnet | Tests IP connectivity and configures a router | Telnet [destination ip] Router#telnet 172.16.10.2 |
| Ping | Tests IP connectivity | Ping [destination ip] Router#ping 172.16.10.2 |
| Interface Fastethernet 0/0 | Puts you in interface configuration mode for a fastethernet port | Router(config)#int fa 0/0 |
| Interface Serial 1 | Puts you in configuration mode for interface serial 1 and can be used for show commands | Router(config)#int serial 1 |
| Ip Address | Sets an IP address on an interface | Router(config)#ip address 172.16.10.2 255.255.255.0 |
| Bandwidth | Sets the bandwidth on a serial interface | Router(config-if)#bandwidth 64 |
| Copy Run Start | Short for copy running-config, startup-config. Places a configuration into NVRAM | Router#copy run start |
| Erase Startup | Deletes the startup-config | Router#erase startup-config |
| Show Controllers S 0 | Show the DTE or DCE status of an interface | Router#sh controllers s 0 |
| Show History | Shows you the last 10 commands entered by default | Router#sh history |
| Show Interface S 0 | Shows the statistics of interface serial 0 | Router#sh int s 0 |
| Show Run | Short for show running-config. Shows the configuration currently running on the router | Router#sh run |
| Show Start | Short for show startup-config. Shows the backup configuration stored in NVRAM | Router#sh start |
| Show Terminal | Shows you your configured history size | Router#sh terminal |
| Show Version | Shows you statistic of the router | Router#sh ver |
| Shutdown | Puts an interface in administratively-down mode | Router(config-if)#shutdown |
| Command | Description | Syntax |
| Ip route | Creates static and default routes on a router | Ip route [destination_network] [mask] [next_hop_address or exitinterface] [administrative_distance] [permanent] Example: Router(config)#ip route 172.16.20.0 255.255.255.0 172.16.10.2 |
| No ip route | Removes a static default rout | Router(config)#no ip route 172.16.20.0 255.255.255.0 172.16.10.2 |
| Router RIP | Turns on ip rip routing on a router | Router(config)#router rip |
| Network | Tells the routing protocol what network to advertise | Router(config-if)#network 172.16.20.0 |
| Router igrp AS | Turns on ip igrp routing on a router | Router igrp[Autonomous system no.] Router(config)#router igrp 10 |
| Debug ip rip | Sends console messages displaying information about rip packets being sent and received on a router interface | Router#debug ip rip |
| Debug ip igrp events | Provides a summary of the igrp routing information running on the network | Router#debug ip igrp events |
| Debug ip igrp transactions | Shows message requests from neighbor routes asking for an update and the broadcast sent from your router to that neighbor router | Router#debug ip igrp transactions |
| Show ip route | Displays the ip routing table | Router#sh ip route |
| Show protocols | Shows the routed protocols and network addresses configured on each interface | Router#sh protocols |
| Show ip protocols | Shows the routing protocols and timers associated with each routing protocol configured on a router | Router#sh ip protocols |
| Command | Description | Syntax |
| Cdp enable | Turns on cdp on an individual interface | Router#cdp enable |
| No cdp enable | Turns off cdp on an individual interface | Router#no cdp enable |
| Cdp run | Turns on cdp on a router | Router#cdp run |
| No cdp run | Turns off cdp completely on router | Router#no cdp run |
| Cdp holdtime | Changes the holdtime of cdp packets | Router(config)#cdp holdtime 240 |
| Cdp timer | Changes the cdp update timer | Router(config)#cdp timer 90 |
| Clear line | Clears a connection connected via telnet to your router | Router#clear line 2 |
| Config-register | Tells the router how to boot and to change the configuration register setting | Router(config)#config-register 0x0101 |
| Copy flash tftp | Copies a file from flash memory to a tftp host | Router# copy flash tftp |
| Copy run start | Copies the running-config file to the startup-config file | Router#copy run start |
| Copy run tftp | Copies the running-config file to a tftp host | Router#copy run tftp |
| Copy tftp flash | Copies a file from a tftp host to flash memory | Router#copy tftp flash |
| Copy tftp run | Copies a configuration from a tftp host to the running-config file | Router#copy tftp run |
| Erase startup-config | Deletes the contents of NVRAM on a router | Router#erase startup-config |
| Ip host | Creates a host table on a router | Ip host[hostname] [ip address] Example: Router(config)#ip host router2 172.16.10.2 |
| No ip host | Removes a hostname from a host table | Router(config)#no ip host router2 172.16.10.2 |
| Show cdp | Displays the cdp timer and holdtime frequencies | Router#sh cdp |
| Show cdp entry | Same as show cdp neighbor detail, but does not work on a 1900 switch | Router#sh cdp entry |
| Show cdp interface | Shows the individual interfaces enabled with cdp | Router#sh cdp interface |
| Show cdp neighbor | Shows the directly connected neighbors and the details about them | Router#sh cdp nei |
| Show cdp neighbor detail | Shows the ip address and IOS version and type, and includes all of the information from the show cdp neighbor command | Router#sh cdp neighbor detail |
| Show cdp traffic | Shows the cdp packets sent and received on a device and any errors | Router#sh cdp traffic |
| Show flash | Shows the files in flash memory | Router#sh flash |
| Show hosts | Shows the contents of the host table | Router#sh hosts |
| Show sessions | Shows your connections via telnet to remote device | Router#sh sessions |







