Posts

Showing posts from September, 2020

Backing up IOS configuration

Image
  It is always a good idea to have a backup copy of the configuration of your IOS device. IOS configurations are usually copied to a TFTP server using the  copy  command. You can backup both the startup configuration and the running configuration of your device. The  copy  commands accepts two parameters: the first parameter is the  from  location, and the second it the  to  location. TFTP is a client-server network protocol used to send and receive files. To backup files to a TFTP server, you will have to set it up first. You can use the Packet Tracer to do so; just add a  Server  to your topology, assign it an IP address and enable the TFTP service: To backup the startup configuration to a TFTP server, you can use the  copy startup-config tftp:  command: Remember, the first parameter after the  copy  keyword is the  from  location, while the second one is the  to  location. In our case,...

IOS boot sequence

  The  IOS boot sequence  is a process performed after an Cisco IOS device is powered on. The IOS device performs a  power-on self-test (POST)  to test its hardware components and choose an IOS image to load. The boot sequence consists of the following steps: 1. The device performs the power-on self-test (POST) process to discover and verify its hardware components. 2. If the POST test is successful, the bootstrap program is copied from ROM into RAM. 3. The bootstrap program decides which IOS image to load from the flash memory into RAM, and then loads the chosen IOS. 4. IOS finds the startup configuration file, usually located in NVRAM, and loads it into RAM as the running configuration.

Pipe character in IOS

Image
  IOS supports the use of the  pipe character  (represented with the  |  character) to filter the output of the  show  and  more  commands. The pipe function takes the output of the command and sends it to another function, such as  begin  or  include . This way, you can filter the output to find the section of the output that interests you. Here are a couple of examples: In the picture above you can see that we’ve entered the  show running-config | begin interface  command. This command starts the output from the first occurence of the word  interface . Another example, this time with  include : As you can see from the example above, the  include  function displays only lines that include the word  password . To display only the section of the output about a certain feature, use the  section  function: You can see in the example above that the command displayed only the  vty se...

Ports on an IOS device

Image
  Cisco uses the term  interface  to refer to physical ports on an IOS device. Interfaces can be configured with different settings, depending on the type of the interface and whether you are configuring an interface on a router or on a switch. For example, the  Cisco 7201 Router  has four GE physical ports (image source: Cisco): To display the router interfaces in IOS, use the  show ip int brief  command from the privileged exec mode: In the output above we can see that this router has 2 physical interfaces – FastEthernet0/0 and FastEthernet0/1. Consider the output for the  Fa0/0  interface: Here is a brief description of each column: Interface  – displays the type of the interface, in this case Fast Ethernet 0/0. The first zero specifies the physical slot on the router, while the second zero specifies the port number. IP-Address  – displays the interface’s IP address. OK?  – YES in this column signifies that the IP address is...

Run privileged commands within global config mode

Image
  Beginning with the IOS 12.3, the privileged-exec mode commands (such as  show running-configuration ,  show interface status , etc.) can be executed within the global configuration mode and its submodes. This allows you to execute privileged-exec mode commands without needing to exit the current configuration mode. Here is an example that explains the usefulness of this feature: In the example above you can see that we’re currently in the interface submode. We want to get more information about the interface with the  show interface Fa0/1  command, but we got an error because the command is not available in this mode. However, if we use the  do  keyword in front of the command, the command will succeed: The command was now executed because of the  do  keyword. Notice that we’re still in the interface submode and we can continue with the interface configuration.

Configure descriptions

Image
  Adding a description to an interface on a Cisco device doesn’t provide any extra functionality, but it is useful for administrative purposes, since it will help you to remember the interface function. A description of an interface is locally significant and can be up to 240 characters long. It can be set using the  description  command from the interface submode: DEVICE(config) interface Fa0/1 DEVICE(config-if) description WAN to London Example configuration: The description is displayed in the output of the  show running-config  command: To erase the description, use the  no description  interface mode command (or the shortcut  no desc ):

show command

  We’ve already mentioned a couple of  show commands  in the previous sections, so you should already we somewhat aware of this command. This command is used to display the device’s configuration, statistics, command history, interface status… The  show  command is invoked from the  enable  mode and can accept a lot of parameters: Floor1#show ? aaa Show AAA values access-lists List access lists arp Arp table cdp CDP information class-map Show QoS Class Map clock Display the system clock controllers Interface controllers status crypto Encryption module debugging State of each debugging option dhcp Dynamic Host Configuration Protocol status dot11 IEEE 802.11 show information file Show filesystem information flash: display information about flash: file system ... terminal Display terminal configuration parameters users Display information about terminal lines version System hardware and software status vlan-switch VTP VLAN status vtp Configure VLAN databa...

IOS basic commands

Image
  In this article we will go through some basic IOS commands. Hostname command The  hostname  command is used to configure the device hostname. Because this command changes a device configuration, it must be entered in the global configuration mode. After typing the command, the prompt will change and display the new hostname. Here is an example that shows you how to change a hostname of a device. First, enter the global configuration mode by typing the  enable  command in the user EXEC mode and the  configuration terminal  command in the privileged EXEC mode. Once inside the global configuration mode, type the command  hostname R1 . Notice how the prompt was changed to reflect the configured value. No shutdown command By default, all interfaces on a Cisco router are turned off. To enable an interface, the  no shutdown  command is used. You first need to enter the submode of the interface that you want to configure. You can do that by us...

Running & startup configuration

Image
  CIsco devices store commands in two configuration files: startup configuration running configuration   Immediately after you type a command in the global configuration mode, it will be stored in the running configuration. A running configuration resides in a device’s RAM, so if a device loses power, all configured commands will be lost. To avoid this scenario, you need to copy your current configuration into the startup configuration. A startup configuration is stored in the nonvolatile memory of a device, which means that all configuration changes are saved even if the device loses power. To copy your running configuration into the startup configuration you need to type the command  copy running-configuration startup-configuration .

Get help in IOS

Image
  You can use the question mark to display a list of commands available in the prompt you are in: If the output spans more than one page, press the  spacebar  to display the following page of commands, or press  Enter  to go one command at a time. To quit the output, press  q . To display only commands that start with a particular character or a string of characters, type the letters and then press the question mark: In the picture above you can see that we’ve displayed all commands that start with  de . If the command is more than one word long, you can use the question mark to display the next command in a string: In the picture above you can see that we’ve displayed all commands that can follow the command  debug . We then displayed all commands that can follow the commands  debug eigrp . You can also autocomplete a command. Just type the first few characters and press  Tab . If there is only a single match, IOS will complete the comm...

IOS command modes

Image
  We’ve already learned that IOS has three main command modes: the user exec, privileged exec, and the global configuration modes. Each of these modes serves a different purpose and has its own set of commands. In this lesson we will describe each of this modes in more detail. User EXEC mode commands Initially, a user logs into the User Exec mode. This is the mode with the least number of commands. You can get a list of all available commands by typing the character  ? . As you can see, most of the commands available are used to show statistics and perform some basic troubleshooting. The prompt on the left side of the screen always displays the device hostname (R1 in this case), followed by the character >. All commands can be abbreviated to their first letters of the command name. For example, you can abbreviate  ping  by typing  pin , because no other command in the User EXEC mode IOS mode begins with these letters. Privileged EXEC mode commands This IOS mo...

Power on a Cisco device

Image
  When you first power-on a newly purchashed Cisco device, it will perform a  power-on self-test (POST)  to discover the hardware components and verify that all components work properly. If the POST is successful, the device will enter the  setup mode . This mode presents a step-by-step dialog to help you configure some basic parameters, such as the device hostname, passwords, interface IP address, etc. To enter the  setup mode , power on your device and type  yes  when prompted to make a selection: The wizard guides you through the initial configuration of your device and will create an initial configuration file. The setup mode is useful when you are unfamiliar with the IOS CLI, but once you learn the basics of CLI, you probably won’t use this mode ever again. NOTE You can enter the setup mode at any time from the command line by typing the  setup  command from the privileged mode. To exit the setup mode without saving any changes, pre...

Cisco IOS overview

Image
  IOS (Internetwork Operating System)  is a multitasking operating system used on most Cisco routers and switches. IOS has a command-line interface with the predetermined number of multiple-word commands. This operating system is used to configure routing, switching, internetworking and other features supported by a Cisco device. NOTE Previous versions of Cisco switches ran CatOS, a discounted version of a CLI-based operating sytem.   Below you can see how IOS looks like when a Cisco device is started for the first time:  Accessing the IOS There are three most common ways to access the IOS: 1. Console access  – this type of access is usually used to configure newly acquired devices. These devices usually don’t have an IP address configured, and therefore can not be accessed through the network. Most of the Cisco devices have a physical console port. This port can be connected to a computer using a rollover cable, a special type of cable with pins on one end reve...

IP header

Image
  An  IP header  is a prefix to an IP packet that contains information about the IP version, length of the packet, source and destination IP addresses, etc. It consists of the following fields: Here is a description of each field: Version  – the version of the IP protocol. For IPv4, this field has a value of 4. Header length  – the length of the header in 32-bit words. The minumum value is 20 bytes, and the maximum value is 60 bytes. Priority and Type of Service  – specifies how the datagram should be handled. The first 3 bits are the priority bits. Total length  – the length of the entire packet (header + data). The minimum length is 20 bytes, and the maximum is 65,535 bytes. Identification  – used to differentiate fragmented packets from different datagrams. Flags  – used to control or identify fragments. Fragmented offset  – used for fragmentation and reassembly if the packet is too large to put in a frame. Time to live  – limits...

ICMP (Internet Control Message Protocol)

Image
  ICMP (Internet Control Message Protocol)  is a network layer protocol that reports errors and provides information related to IP packet processing. ICMP is used by network devices to send error messages indicating, for example, that a requested service is not available or that a host isn’t reachable. ICMP is commonly used by network tools such as  ping  or  traceroute . Consider the following example that illustrates how ping can be used to test the reachability of a host: Host A  wants to test whether it can reach  Server  over the network. Host A will start the ping utility that will send  ICMP Echo Request  packets to Server. If Server is reachable, it will respond with  ICMP Echo Reply  packets. If Host A receives no response from Server, there might be a problem on the network. NOTE ICMP messages are encapsulated in IP datagrams, which means that they don’t use higher level protocols (such as TCP or UDP) for transmission...