Which route was configured as a static route to a specific network using the next-hop address

Routers

Static Routes

posted 28 Jul 2014, 06:14 by Nik Ralcheff

IPv4

After directly connected interfaces are configured and added to the routing table, then static or dynamic routing can be implemented.

Static routes are manually configured. They define an explicit path between two networking devices. Unlike a dynamic routing protocol, static routes are not automatically updated and must be manually reconfigured if the network topology changes. The benefits of using static routes include improved security and resource efficiency. Static routes use less bandwidth than dynamic routing protocols, and no CPU cycles are used to calculate and communicate routes. The main disadvantage to using static routes is the lack of automatic reconfiguration if the network topology changes.

There are two common types of static routes in the routing table:

  • Static route to a specific network
  • Default static route

A static route can be configured to reach a specific remote network. IPv4 static routes are configured using the ip route network mask {next-hop-ip | exit-intf}global configuration command. A static route is identified in the routing table with the code ‘S’.

A default static route is similar to a default gateway on a host. The default static route specifies the exit point to use when the routing table does not contain a path for the destination network.

A default static route is useful when a router has only one exit point to another router, such as when the router connects to a central router or service provider.

To configure an IPv4 default static route, use the ip route 0.0.0.0 0.0.0.0 {exit-intf | next-hop-ip} global configuration command.

The figure provides a simple scenario of how default and static routes can be applied.

IPv6

Like IPv4, IPv6 supports static and default static routes. They are used and configured like IPv4 static routes.

To configure a default static IPv6 route, use the ipv6 route ::/0 {ipv6-address | interface-type interface-number} global configuration command.

Figure 1 shows the configuration of a default static route on R1 to the Serial 0/0/0 interface.

Notice in the output shown in Figure 2 that the default static route configuration generated an ‘S’ entry in the routing table. The ‘S’ signifies that the route source is a static route. Unlike the IPv4 static route, there is no asterisk (*) or Gateway of Last Resort explicitly identified.

Like IPv4, static routes are routes explicitly configured to reach a specific remote network. Static IPv6 routes are configured using the ipv6 route ipv6-prefix/prefix-length{ipv6-address|interface-type interface-number} global configuration command.

The example in Figure 3 shows the configuration of two static routes from R2 to reach the two LANs on R1. The route to the 2001:0DB8:ACAD:2::/64 LAN is configured with an exit interface, while the route to the 2001:0DB8:ACAD:1::/64 LAN is configured with the next hop IPv6 address. The next hop IPv6 address can be either an IPv6 global unicast or link-local address.

Figure 4 shows the routing table with the new static routes installed.

Figure 5 confirms remote network connectivity to the 2001:0DB8:ACAD:4::/64 LAN on R2 from R1.

Verify Connectivity of Directly Connected Networks

posted 27 Jul 2014, 21:34 by Nik Ralcheff

There are several show commands that can be used to verify the operation and configuration of an interface. The following three commands are especially useful to quickly identify an interface status:

  • show ip interface brief - Displays a summary for all interfaces including the IPv4 address of the interface and current operational status.
  • show ip route - Displays the contents of the IPv4 routing table stored in RAM. In Cisco IOS 15, active interfaces should appear in the routing table with two related entries identified by the code ‘C’ (Connected) or ‘L’ (Local). In previous IOS versions, only a single entry with the code ‘C’ will appear.
  • show running-config interface interface-id - Displays the commands configured on the specified interface.

Figure 1 displays the output of the show ip interface brief command. The output reveals that the LAN interfaces and the WAN link are all activated and operational as indicated by the Status of “up” and Protocol of “up”. A different output would indicate a problem with either the configuration or the cabling.

Note: In Figure 1, the Embedded-Service-Engine0/0 interface is displayed because Cisco ISRs G2 have dual core CPUs on the motherboard. The Embedded-Service-Engine0/0 interface is outside the scope of this course.

Figure 2 displays the output of the show ip route command. Notice the three directly connected network entries and the three local host route interface entries. A local host route has an administrative distance of 0. It also has a /32 mask for IPv4, and a /128 mask for IPv6. The local host route is for routes on the router owning the IP address. It is used to allow the router to process packets destined to that IP.

Figure 3 displays the output of the show running-config interface command. The output displays the current commands configured on the specified interface.

The following two commands are used to gather more detailed interface information:

  • show interfaces - Displays interface information and packet flow count for all interfaces on the device.
  • show ip interface - Displays the IPv4 related information for all interfaces on a router.

Use the Syntax Checker in Figures 4 and 5 to verify the interfaces on R1.

The commands to verify the IPv6 interface configuration are similar to the commands used for IPv4.

The show ipv6 interface brief command in Figure 1 displays a summary for each of the interfaces. The [up/up] output on the same line as the interface name indicates the Layer 1/Layer 2 interface state. This is the same as the Status and Protocol columns in the equivalent IPv4 command.

The output displays two configured IPv6 addresses per interface. One address is the IPv6 global unicast address that was manually entered. The other address, which begins with FE80, is the link-local unicast address for the interface. A link-local address is automatically added to an interface whenever a global unicast address is assigned. An IPv6 network interface is required to have a link-local address, but not necessarily a global unicast address.

The show ipv6 interface gigabitethernet 0/0 command output shown in Figure 2 displays the interface status and all of the IPv6 addresses belonging to the interface. Along with the link local address and global unicast address, the output includes the multicast addresses assigned to the interface, beginning with prefix FF02.

The show ipv6 route command shown in Figure 3 can be used to verify that IPv6 networks and specific IPv6 interface addresses have been installed in the IPv6 routing table. The show ipv6 route command will only display IPv6 networks, not IPv4 networks.

Within the routing table, a ‘C’ next to a route indicates that this is a directly connected network. When the router interface is configured with a global unicast address and is in the “up/up” state, the IPv6 prefix and prefix length is added to the IPv6 routing table as a connected route.

The IPv6 global unicast address configured on the interface is also installed in the routing table as a local route. The local route has a /128 prefix. Local routes are used by the routing table to efficiently process packets with the interface address of the router as the destination.

The ping command for IPv6 is identical to the command used with IPv4 except that an IPv6 address is used. As shown in Figure 4, the ping command is used to verify Layer 3 connectivity between R1 and PC1.

Other useful IPv6 verification commands include:

  • show interface
  • show ipv6 routers

Commands that generate multiple screens of output are, by default, paused after 24 lines. At the end of the paused output, the --More-- text displays. Pressing Enter displays the next line and pressing the spacebar displays the next set of lines. Use the terminal length number command to specify the number of lines to be displayed. A value of 0 (zero) prevents the router from pausing between screens of output.

Another very useful feature that improves the user experience in the command-line interface (CLI) is the filtering of show output. Filtering commands can be used to display specific sections of output. To enable the filtering command, enter a pipe (|) character after the show command and then enter a filtering parameter and a filtering expression.

The filtering parameters that can be configured after the pipe include:

  • section - Shows entire section that starts with the filtering expression
  • include - Includes all output lines that match the filtering expression
  • exclude - Excludes all output lines that match the filtering expression
  • begin - Shows all the output lines from a certain point, starting with the line that matches the filtering expression

Note: Output filters can be used in combination with any show command.

Figures 1 to 4 provide examples of the various output filters.

Use the Syntax Checker in Figure 5 to filter output.

The command history feature is useful, because it temporarily stores the list of executed commands to be recalled.

To recall commands in the history buffer, press Ctrl+P or the Up Arrow key. The command output begins with the most recent command. Repeat the key sequence to recall successively older commands. To return to more recent commands in the history buffer, press Ctrl+N or the Down Arrow key. Repeat the key sequence to recall successively more recent commands.

By default, command history is enabled and the system captures the last 10 command lines in its history buffer. Use the show history privileged EXEC command to display the contents of the buffer.

It is also practical to increase the number of command lines that the history buffer records during the current terminal session only. Use the terminal history size user EXEC command to increase or decrease the size of the buffer.

Figure 1 displays a sample of the terminal history size and show history commands.

Use the Syntax Checker in Figure 2 to practice the two EXEC commands.

Backing up and Restore

posted 13 Jun 2014, 02:56 by Nik Ralcheff

Backup Configurations with Text Capture (Tera Term)

Configuration files can be saved/archived to a text file using Tera Term.

As shown in the figure, the steps are:

Step 1. On the File menu, click Log.

Step 2. Choose the location to save the file. Tera Term will begin capturing text.

Step 3. After capture has been started, execute the show running-config or show startup-config command at the privileged EXEC prompt. Text displayed in the terminal window will be directed into the chosen file.

Step 4. When the capture is complete, select Close in the Tera Term: Log window.

Step 5. View the file to verify that it was not corrupted.

Restoring Text Configurations

A configuration can be copied from a file to a device. When copied from a text file and pasted into a terminal window, the IOS executes each line of the configuration text as a command. This means that the file will require editing to ensure that encrypted passwords are in plain text and that non-command text such as "--More--" and IOS messages are removed. This process is discussed in the lab.

Further, at the CLI, the device must be set at the global configuration mode to receive the commands from the text file being pasted into the terminal window.

When using Tera Term, the steps are:

Step 1. On the File menu, click Send file.

Step 2. Locate the file to be copied into the device and click Open.

Step 3. Tera Term will paste the file into the device.

The text in the file will be applied as commands in the CLI and become the running configuration on the device. This is a convenient method for manually configuring a router.


Backup Configurations with TFTP

Copies of configuration files should be stored as backup files in the event of a problem. Configuration files can be stored on a Trivial File Transfer Protocol (TFTP) server or a USB drive. A configuration file should also be included in the network documentation.

To save the running configuration or the startup configuration to a TFTP server, use either the copy running-config tftp or copy startup-config tftp command as shown in the figure. Follow these steps to back up the running configuration to a TFTP server:

Step 1. Enter the copy running-config tftp command.

Step 2. Enter the IP address of the host where the configuration file will be stored.

Step 3. Enter the name to assign to the configuration file.

Step 4. Press Enter to confirm each choice.

Restoring Configurations with TFTP

To restore the running configuration or the startup configuration from a TFTP server, use either the copy tftp running-config or copy tftp startup-config command. Use these steps to restore the running configuration from a TFTP server:

Step 1. Enter the copy tftp running-config command.

Step 2. Enter the IP address of the host where the configuration file is stored.

Step 3. Enter the name to assign to the configuration file.

Step 4. Press Enter to confirm each choice.


Using USB Drive

The Universal Serial Bus (USB) storage feature enables certain models of Cisco routers to support USB flash drives. The USB flash feature provides an optional secondary storage capability and an additional boot device. Images, configurations, and other files can be copied to or from the Cisco USB flash memory with the same reliability as storing and retrieving files using the Compact Flash card. In addition, modular integrated services routers can boot any Cisco IOS Software image saved on USB flash memory.

Cisco USB flash modules are available in 64MB, 128 MB, and 256MB versions.

To be compatible with a Cisco router, a USB flash drive must be formatted in a FAT16 format. If that is not the case, the show file systems command will display an error indicating an incompatible file system.

Here is an example of the use of the dir command on a USB file system:

Router# dir usbflash0:

Directory of usbflash0:/

1 -rw- 30125020 Dec 22 2032 05:31:32 +00:00 c3825-entservicesk9-mz.123-14.T

63158272 bytes total (33033216 bytes free)

Ideally, USB flash can hold multiple copies of the Cisco IOS and multiple router configurations. The USB flash allows an administrator to easily move and copy those IOS files and configurations from router to router, and many times, the copying process can take place several times faster than it would over a LAN or WAN. Note that the IOS may not recognize the proper size of the USB flash, but that does not necessarily mean that the flash is unsupported. Additionally, the USB ports on a router are usually USB 2.0, as shown in the figure

Backup Configurations with a USB flash drive

When backing up to a USB port, it is a good idea to issue the show file systems command to verify that the USB drive is there and confirm the name, as shown in Figure 1.

Next, use the copy run usbflash0:/ command to copy the configuration file to the USB flash drive. Be sure to use the name of the flash drive, as indicated in the file system. The slash is optional but indicates the root directory of the USB flash drive.

The IOS will prompt for the filename. If the file already exists on the USB flash drive, the router will prompt for overwrite, as seen in Figure 2.

Use the dir command to see the file on the USB drive and use the more command to see the contents, as seen in Figure 3.

Restore Configurations with a USB flash drive

In order to copy the file back, it will be necessary to edit the USB R1-Config file with a text editor to make it a valid config file; otherwise, there are a lot of entries that are invalid commands and no interfaces will be brought up.

R1# copy usbflash0:/R1-Config running-config

Destination filename [running-config]?


Managing IOS Configuration Files

posted 13 Jun 2014, 02:17 by Nik Ralcheff

In addition to implementing and securing a small network, it is also the job of the network administrator to manage configuration files. Managing the configuration files is important for purposes of backup and retrieval in the event of a device failure.

The Cisco IOS File System (IFS) provides a single interface to all the file systems a router uses, including:

  • Flash memory file systems
  • Network file systems (TFTP and FTP)
  • Any other endpoint for reading or writing data such as NVRAM, the running configuration, ROM, and others

With Cisco IFS, all files can be viewed and classified (image, text file, and so forth), including files on remote servers. For example, it is possible to view a configuration file on a remote server to verify that it is the correct configuration file before loading the file on the router.

Cisco IFS allows the administrator to move around to different directories and list the files in a directory, and to create subdirectories in flash memory or on a disk. The directories available depend on the device.

The Figure 1 displays the output of the show file systems command, which lists all of the available file systems on a Cisco 1941 router, in this example. This command provides useful information such as the amount of available and free memory, the type of file system, and its permissions. Permissions include read only (ro), write only (wo), and read and write (rw), shown in the Flags column of the command output.

Although there are several file systems listed, of interest to us will be the tftp, flash, and nvram file systems.

Notice that the flash file system also has an asterisk preceding it. This indicates that flash is the current default file system. The bootable IOS is located in flash; therefore, the pound symbol (#) is appended to the flash listing indicating that it is a bootable disk.

The Flash File System

Figure 2 lists the content of the current default file system, which in this case is flash as was indicated by the asterisks preceding the listing in the previous figure. There are several files located in flash, but of specific interest is the last listing. This is the name of the current Cisco IOS file image that is running in RAM.

The NVRAM File System

To view the contents of NVRAM, you must change the current default file system using the cd (change directory) command, as shown in Figure 3. The pwd (present working directory) command verifies that we are viewing the NVRAM directory. Finally, the dir (directory) command lists the contents of NVRAM. Although there are several configuration files listed, of specific interest is the startup-configuration file.

What is next hop in static route?

The next hop is among the series of routers that are connected together in a network and is the next possible destination for a data packet. More specifically, next hop is an IP address entry in a router's routing table, which specifies the next closest/most optimal router in its routing path.

What type of static route is created when the next hop IP address?

What type of static route is created when the next-hop IP address and exit interface are specified? A fully specified static route has the next-hop IP address and exit interface specified. A recursive static route has only the next-hop IP address specified.

What is the next hop router's IP address?

A next hop IP is the IP address of a adjacent router or device with layer-2 connectivity to the managed device. If the managed device uses policy-based routing to forwards packets to a next hop device and that device becomes unreachable, the packets matching the policy will not reach their destination.

What are 4 types of static routes?

There are four types of a static route. These types are the static network route, static host route, fix static route, and the floating static route. Each type uses the above information in a different way. Let's discuss the above information and how each type uses the above information.