Module 6 Device Monitoring and Management
Module 6 Device Monitoring and Management
The Cisco IOS resilient configuration feature allows for faster recovery if someone maliciously or
unintentionally reformats flash memory or erases the startup configuration file in nonvolatile
random-access memory (NVRAM). The feature maintains a secure working copy of the router IOS
image file and a copy of the running configuration file. These secure files cannot be removed by the
user and are referred to as the primary bootset.
Here are a few facts about the Cisco IOS resilient configuration:
The configuration file in the primary bootset is a copy of the running configuration that was
in the router when the feature was first enabled.
The feature secures the smallest working set of files to preserve persistent storage space.
No extra space is required to secure the primary Cisco IOS image file. The feature
automatically detects image or configuration version mismatch.
Only local storage is used for securing files, eliminating scalability maintenance challenges
from storing multiple images and configurations on TFTP servers.
Note: The feature is only available on older routers that support a PCMCIA Advanced Technology
Attachment (ATA) flash interface. Newer routers such as the ISR 4000 do not support this feature.
The commands to secure the IOS image and running configuration file are shown in the example. To
secure the IOS image and enable Cisco IOS image resilience, use the secure boot-image global
configuration mode command. When enabled for the first time, the running Cisco IOS image is
secured and a log entry is generated. The Cisco IOS image resilience feature can only be disabled
through a console session using the no form of the command. This command functions properly only
when the system is configured to run an image from a flash drive with an ATA interface. Additionally,
the running image must be loaded from persistent storage to be secured as primary. Images that are
loaded from a remote location, such as a TFTP server, cannot be secured.
To take a snapshot of the router running configuration and securely archive it in persistent storage,
use the secure boot-config global configuration mode command, as shown in the figure. A log
message is displayed on the console notifying the user that configuration resilience is activated. The
configuration archive is hidden and cannot be viewed or removed directly from the CLI prompt. You
can use the secure boot-config command repeatedly to upgrade the configuration archive to a
newer version after new configuration commands have been issued.
Secured files do not appear in the output of a dir command that is issued from the CLI. This is
because the Cisco IOS file system prevents secure files from being listed. The running image and
running configuration archives are not visible in the dir command output. Use the show secure
bootset command to verify the existence of the archive, as shown in the figure.
6.1.3 The Primary Bootset Image
Restore a primary bootset from a secure archive after the router has been tampered with, as shown
in the following steps and example:
Step 1. Reload the router using the reload command. If necessary, issue the break sequence to enter
ROM monitor (ROMmon) mode.
Step 2. From ROMmon mode, enter the dir command to list the contents of the device that contains
the secure bootset file.
Step 3. Boot the router with the secure bootset image using the boot command followed by the
flash memory location (e.g. flash0), a colon, and the filename found in Step 2.
Step 4. Enter global configuration mode and restore the secure configuration to a filename of your
choice using the secure boot-config restore command followed by the flash memory location (e.g.
flash0), a colon, and a filename of your choice. In the figure, the filename rescue-cfg is used.
Step 5. Exit global configuration mode and issue the copy command to copy the rescued
configuration file to the running configuration.
6.1.4 Configure Secure Copy
The Cisco IOS Resilient feature provides a method for securing the IOS image and configuration files
locally on the device. The Secure Copy Protocol (SCP) feature is used to remotely copy these files.
SCP provides a secure and authenticated method for copying router configuration or router image
files to a remote location.
Use the following steps to configure a router for server-side SCP with local AAA:
Step 2. For local authentication, configure at least one local database user with privilege level 15.
Step 3. Enable AAA with the aaa new-model global configuration mode command.
Step 4. Use the aaa authentication login default local command to specify that the local database be
used for authentication.
Step 5. Use the aaa authorization exec default local command to configure command authorization.
In this example, all local users will have access to EXEC commands.
Step 6. Enable SCP server-side functionality with the ip scp server enable command.
In the example, R1 is now an SCP server and will use SSH connections to accept secure copy transfers
from authenticated and authorized users. Transfers can originate from any SCP client whether that
client is another router, switch, or workstation.
Now assume that we want to securely copy the backup configuration of a router named R2 to the
SCP server, which is R1. As shown in the command output below, we would use the copy command
on R2, and specify specify the source file location first (flash0:R2backup.cfg), and then the
destination (scp:). After answering the series of prompts to establish a connection to the SCP server
on R1, the file will be copied.
On R1, you can enter the debug ip scp command to watch the transfer proceed, as shown in the
following example. The most common authentication issue is an incorrect username/password
combination. There is also an authentication failure if the username/password combination was not
configured with the privilege 15 keyword on the SCP server.
Step 2. Use the show version command to display the configuration register setting and document
the value (e.g., 0x2102).
Step 4. Issue the break sequence (e.g., CTRL-BREAK) to enter ROMMON mode.
Step 5. Change the default configuration register with the confreg 0x2142 command.
Step 6. Reboot the router by using the reset command in ROMMON mode.
Step 9. Copy the startup configuration to the running configuration using the copy startup-config
running-config command.
Step 13. Return the configuration register setting to the original setting that was documented in Step
2 with the config-register global configuration command. On the next reboot, the router will use
these settings and load the new startup configuration file that contains the changed password.
If someone gained physical access to a router, they could potentially gain control of that device
through the password recovery procedure. This procedure, if performed correctly, leaves the router
configuration intact. If the attacker makes no major changes, this type of attack is difficult to detect.
An attacker can use this attack method to discover the router configuration and other pertinent
information about the network, such as traffic flows and access control restrictions.
An administrator can mitigate this potential security breach by using the no service password-
recovery global configuration mode command. This command is a hidden Cisco IOS command and
has no arguments or keywords. If a router is configured with the no service password-recovery
command, all access to ROMmon mode is disabled.
When the no service password-recovery command is entered, a warning message displays and must
be acknowledged before the feature is enabled, as shown in the example.
When it is configured, the show running-config command displays a no service password-
recovery statement, as shown here.
As shown below, when the router is booted, the initial boot sequence displays a message stating
PASSWORD RECOVERY FUNCTIONALITY IS DISABLED.
To recover a device after the no service password-recovery command is entered, initiate the break
sequence within five seconds after the image decompresses during the boot. You are prompted to
confirm the break key action. After the action is confirmed, the startup configuration is completely
erased, the password recovery procedure is enabled, and the router boots with the factory default
configuration. If you do not confirm the break action, the router boots normally with the no service
password-recovery command enabled.
CAUTION: If the router flash memory does not contain a valid Cisco IOS image because of corruption
or deletion, the ROMmon xmodem command cannot be used to load a new flash image. To repair
the router, an administrator must obtain a new Cisco IOS image on a flash SIMM or on a PCMCIA
card. However, if an administrator has access to ROMmon they can restore an IOS file to flash
memory using a TFTP server. Refer to Cisco.com for more information regarding backup flash images.
Lock Down a Router Using AutoSecure
6.2.1 Discovery Protocols CDP and LLDP
Cisco routers are initially deployed with many services that are enabled by default. This is done for
convenience and to simplify the configuration process required to get the device operational.
However, some of these services can make the device vulnerable to attack if security is not enabled.
Administrators can also enable services on Cisco routers that can expose the device to significant
risk. Both of these scenarios must be considered when securing the network.
The Cisco Discovery Protocol (CDP) is an example of a service that is enabled by default on Cisco
routers. The Link Layer Discovery Protocol (LLDP) is an open standard that can be enabled on Cisco
devices, as well as other vendor devices that support LLDP.
LLDP configuration and verification is similar to CDP. In the figure, R1 and S1 are both configured with
LLDP, using the lldp run global configuration command. Both devices are running CDP by default. The
output for show cdp neighbors detail and show lldp neighbors detail will reveal a device’s address,
platform, and operating system details.
Unfortunately, attackers do not need to have CDP-enabled or LLDP-enabled devices to gather this
sensitive information. Readily available software, such as Universal Network CDP & LLDP Evaluator
(UNCLE), enable any computer on the network to capture and view CDP and LLDP information that is
sent on a LAN. In addition, CDP is vulnerable to CDP spoofing attacks because CDP uses a well known
multicast MAC address. This is a form of denial of service attack that can overwhelm device CDP
tables with false CDP messages.
6.2.2 Settings for Protocols and Services
Attackers choose services and protocols that make the network more vulnerable to malicious
exploitation.
Many of these features should be disabled or restricted in their capabilities based on the security
needs of an organization. These features range from network discovery protocols, such as CDP and
LLDP, to globally available protocols such as ICMP and other scanning tools.
Some of the default settings in Cisco IOS software are there for historical reasons. They were logical
default settings at the time the software was originally written. Other default settings make sense for
most systems, but can create security exposures if they are used in devices that form part of a
network perimeter defense. Still other defaults are required by standards but are not always
desirable from a security point of view.
The table summarizes the feature and default settings for protocols and services.
Feature Default
Configuration
Disabled
autoloading
Packet
assembler/disassembler Enabled
(PAD) service
Maintenance Operation
Enabled on most Ethernet interfaces
Protocol (MOP) service
(SNMP)
HTTP or HTTPS
configuration and Setting is Cisco device dependent.
monitoring
Internet Control
Message Protocol (ICMP) Enabled
redirects
ICMP unreachable
Enabled
notifications
The table below shows recommended security settings for protocols and services.
There are several important practices available to help ensure a device is secure:
Disable probes and scans, such as ICMP. Ensure terminal access security.
Feature Recommendation
Cisco Discovery Protocol (CDP) Should be disabled globally or on a per-interface basis if it is not required.
Feature Recommendation
Configuration autoloading Should remain disabled when not in use by the router.
Packet assembler/disassembler
It should be explicitly disabled when not in use.
(PAD) service
HTTP or HTTPS configuration Disable service if it is not required. If this service is required, restrict access to
and monitoring the router HTTP or HTTPS service using access control lists (ACLs).
Disable when it is not required. If the DNS lookup service is required, ensure
Domain Name System (DNS)
that you set the DNS server address explicitly.
Gratuitous ARP (GARP) Disable gratuitous ARPs on each router interface unless this service is needed.
Disable this service on each interface unless the router is being used as a LAN
Proxy ARP
bridge.
Released in IOS version 12.3, Cisco AutoSecure is a feature that is initiated from the CLI and executes
a script. AutoSecure first makes recommendations for fixing security vulnerabilities and then
modifies the security configuration of the router, as shown in the figure.
AutoSecure can lock down the management plane functions and the forwarding plane services and
functions of a router. There are several management plane services and functions:
Secure BOOTP, CDP, FTP, TFTP, PAD, UDP, and TCP small servers, MOP, ICMP (redirects, mask-
replies), IP source routing, Finger, password encryption, TCP keepalives, gratuitous ARP, proxy
ARP, and directed broadcast
Secure NTP
There are three forwarding plane services and functions that AutoSecure enables:
AutoSecure is often used in the field to provide a baseline security policy on a new router. Features
can then be altered to support the security policy of the organization.
6.2.4 Cisco AutoSecure Command Syntax
Use the auto secure command to enable the Cisco AutoSecure feature setup. This setup can be
interactive or non-interactive. The figure shows the command syntax for the auto secure command.
Router# auto secure {no-interact | full} [forwarding | management] [ntp | login | ssh | firewall |
top-intercept]
In interactive mode, the router prompts with options to enable and disable services and other
security features. This is the default mode, but it can also be configured using the auto secure
full command.
The non-interactive mode is configured with the auto secure no-interact command. This will
automatically execute the Cisco AutoSecure feature with the recommended Cisco default settings.
The auto secure command can also be entered with keywords to configure specific components,
such as the management plane (management keyword) and forwarding plane (forwarding keyword).
The user will not be prompted for any interactive configurations. No interactive dialogue
no-interact
parameters will be configured, including usernames or passwords.
Optional Parameters Description
full The user will be prompted for all interactive questions. This is the default setting.
ntp Specifies the configuration of the NTP feature in the AutoSecure CLI.
login Specifies the configuration of the login feature in the AutoSecure CLI.
ssh Specifies the configuration of the SSH feature in the AutoSecure CLI.
firewall Specifies the configuration of the firewall feature in the AutoSecure CLI.
tcp-intercept Specifies the configuration of the TCP intercept feature in the AutoSecure CLI.
When the auto secure command is initiated, a CLI wizard steps the administrator through the
configuration of the device. User input is required.
The auto secure command is entered. The router displays the AutoSecure configuration wizard
welcome message, as shown.
The wizard gathers information about the outside interfaces, as shown
Configure Serial0/0/0 as the interface facing the internet. Note: The interface name is case-
specific.
Create a local username Admin01 and password Admin01pa55 to access the router.
Configure a 60 second login shutdown if 2 failed login attempts are made within 30 seconds.
Dynamic routing protocols are used by routers to automatically share information about the
reachability and status of remote networks. Dynamic routing protocols perform several activities,
including network discovery and maintaining routing tables.
Important advantages of dynamic routing protocols are the ability to select a best path, and the
ability to automatically discover a new best path when there is a change in the topology.
Network discovery is the ability of a routing protocol to share information about the networks that it
knows about with other routers that are also using the same routing protocol. Instead of depending
on manually configured static routes to remote networks on every router, a dynamic routing protocol
allows the routers to automatically learn about these networks from other routers. These networks,
and the best path to each, are added to the routing table of the router, and identified as a network
learned by a specific dynamic routing protocol.
The figure shows routers R1 and R2 using a common routing protocol to share network information.
Routing systems can be attacked by disrupting peer network routers, or by falsifying or spoofing the
information carried within the routing protocols. Spoofing routing information may generally be used
to cause systems to misinform (lie to) each other, cause a DoS attack, or cause traffic to follow a path
it would not normally follow. There are several consequences of routing information being spoofed:
Click the Play button on the animation to see an example of an attack that creates a routing loop.
Assume an attacker has been able to connect directly to the link between R1and R2. The attacker
sends R1 false routing information indicating that R2 is the preferred destination to the
192.168.10.0/24 network. Although R1 already has a routing table entry to the 192.168.10.0/24
network, the new route has a lower metric and therefore is the preferred entry in the routing table.
Consequently, when PC3 sends a packet to PC1 (192.168.10.10/24), R3 forward the packet to R2
which in turn forwards it to R1. R1 does not forward the packet to the PC1 host. Instead, it routes the
packet to R2 because the apparent best path to 192.168.10.0 /24 is through R2. When R2 gets the
packet, it looks in its routing table and finds a legitimate route to the 192.168.10.0/24 network
through R1 and forwards the packet back to R1, creating the loop. The loop was caused by the
misinformation injected into R1.
For more information about generic threats to routing protocols, search the internet for RFC 4593.
Mitigate against routing protocol attacks by configuring OSPF authentication.
The figure is an animation that demonstrates how an attacker can create a routing loop.
To: 192.168.10.10
This method forces authentication on all OSPF enabled interfaces. If an interface is not
configured with the ip ospf message-digest-key command, it will not be able to form
adjacencies with other OSPF neighbors.
The interface setting overrides the global setting. MD5 authentication passwords do not have to be
the same throughout an area. However, they do need to be the same between neighbors.
In this figure, R1 and R2 are configured with OSPF and routing is functioning properly. However, OSPF
messages are not authenticated or encrypted.
The figure shows two routers connected via a serial connection. Each router is also connected to a
gigabit ethernet network.
In the figure below, R1 and R2 are configured with OSPF MD5 authentication. Authentication is
configured on a per interface basis because both routers are using only one interface to form OSPF
adjacencies. Notice that when R1 is configured, OSPF adjacency is lost with R2 until R2 is configured
with the matching MD5 authentication.
6.3.4 OSPF SHA Routing Protocol Authentication
MD5 is now considered vulnerable to attacks and should only be used when stronger authentication
is not available. Cisco IOS release 15.4(1)T added support for OSPF SHA authentication, as detailed in
RFC 5709. Therefore, the administrator should use SHA authentication as long as all of the router
operating systems support OSPF SHA authentication.
OSPF SHA authentication includes two major steps. The syntax for the commands is shown in the
figure:
Assign the key chain a number and a password with the key and key-string commands.
(Optional) Specify when this key will expire with the send-lifetime command.
Step 2. Use the following syntax to assign the authentication key to the desired interfaces with the ip
ospf authentication key-chain command.
In the example that follows the figure, R1 and R2 are configured with OSPF SHA authentication using
a key named SHA256 and the key string ospfSHA256. Notice that when R1 is configured, OSPF
adjacency is lost with R2 until R2 is configured with the matching SHA authentication.
The figure shows two routers connected via a serial connection. Each router is also connected to a
gigabit ethernet network.
Use this Syntax Checker to configure OSPF authentication using SHA 256.
To configure OSPF with SHA authentication, you must first configure a key chain:
Issue the key chain command to create a key chain named SHA256.
R1(config-keychain)#key 1
R1(config-keychain-key)#key-string ospfSHA256
R1(config-keychain-key)#cryptographic-algorithm hmac-sha-256
R1(config-keychain-key)#exit
R1(config-keychain)#exit
Enter interface configuration mode and assign the key-chain SHA256 for OSPF authentication on
S0/0/0.
R1(config)#interface S0/0/0
R1(config-if)#
R1(config-if)#end
R1#
In a small network, managing and monitoring a small number of network devices is a straightforward
operation. However, in a large enterprise with hundreds of devices, monitoring, managing, and
processing log messages can be challenging. From a reporting standpoint, most networking devices
can send log data that can be invaluable when troubleshooting network problems or security threats.
This data can be viewed in real time, on demand, and in scheduled reports.
When logging and managing information, the information flow between management hosts and the
managed devices can take two paths:
In-band - Information flows across an enterprise production network, the internet, or both,
using regular data channels.
For example, the network in the figure has two network segments separated by a Cisco IOS router
that is providing firewall services to protect the management network. The connection to the
production network allows management hosts to access the internet and provides limited in-band
management traffic. In-band management occurs only when OOB management is not possible or
available. If in-band management is required, then that traffic should be sent securely using a private
encrypted tunnel or VPN tunnel.
The figure below shows more detail for the protected management network. This is where the
management hosts and terminal servers reside. When placed within the management network,
terminal servers offer OOB direct console connections over the management network to any
network device requiring management on the production network. Most devices should be
connected to this management segment and be configured using OOB management.
Because the management network has administrative access to nearly every area of the network, it
can be a very attractive target for hackers. The management module on the firewall incorporates
several technologies designed to mitigate such risks. The primary threat is a hacker attempting to
gain access to the management network. This can be accomplished through a compromised
managed host that a management device must access. To mitigate the threat of a compromised
device, strong access control should be implemented at the firewall and at every other device.
Management devices should be set up in a fashion that prevents direct communication with other
hosts on the same management subnet by using separate LAN segments or VLANs.
As a general rule, for security purposes, OOB management is appropriate for large enterprise
networks. However, it is not always desirable. The decision to use OOB management depends on the
type of management applications running and the protocols being monitored. For example, consider
a situation in which two core switches are managed and monitored using an OOB network. If a
critical link between these two core switches fails on the production network, the application
monitoring those devices may never determine that the link has failed and never alert the
administrator. This is because the OOB network makes all devices appear to be attached to a single
OOB management network. The OOB management network remains unaffected by the downed link.
With management applications such as these, it is preferable to run the management application in-
band in a secure fashion.
Finally, if using remote management tools with in-band management, be wary of the underlying
security vulnerabilities of the management tool itself. For example, SNMP managers are often used
to ease troubleshooting and configuration tasks on a network. However, SNMP should be treated
with the utmost care because the underlying protocol has its own set of security vulnerabilities.
Like a Check Engine light on your car dashboard, the components in your network can tell you if
there is something wrong. The syslog protocol was designed to ensure that you can receive and
understand these messages. When certain events occur on a network, networking devices have
trusted mechanisms to notify the administrator with detailed system messages. These messages can
be either non-critical or significant. Network administrators have a variety of options for storing,
interpreting, and displaying these messages. They can also be alerted to those messages that could
have the greatest impact on the network infrastructure.
The most common method of accessing system messages is to use a protocol called syslog.
Syslog is a term used to describe a standard. It is also used to describe the protocol developed for
that standard. The syslog protocol was developed for UNIX systems in the 1980s but was first
documented as RFC 3164 by IETF in 2001.
Many networking devices support syslog, including routers, switches, application servers, firewalls,
and other network appliances. The syslog protocol allows networking devices to send their system
messages across the network to syslog servers.
Specifically, syslog uses UDP port 514 to send event notification messages across IP networks to
event message collectors. For example, the figure displays a router (R1) and a switch (S1) sending
system messages to a syslog server.
The figure shows a router labeled R 1 and a switch labeled S 1 sending system messages to a syslog
server.
There are several syslog server software packages for Windows and UNIX available. Many of them
are freeware.
On Cisco network devices, the syslog protocol starts by sending system messages and debug output
to a local logging process that is internal to the device. How the logging process manages these
messages and outputs is based on device configurations. For example, syslog messages may be sent
across the network to an external syslog server. Messages on the syslog server can then be filtered
without needing to access the actual device. Log messages and outputs stored on the external server
can be pulled into various reports for easier reading.
Alternatively, syslog messages may be sent to an internal buffer. Messages sent to the internal buffer
are only viewable through the CLI of the device.
Finally, the network administrator may specify that only certain types of system messages be sent to
various destinations. For example, the device may be configured to forward all system messages to
an external syslog server. However, debug-level messages are forwarded to the internal buffer and
are only accessible by the administrator from the CLI.
As shown in the figure, popular destinations for syslog messages include the:
Console line
Terminal line
Syslog server
It is possible to remotely monitor system messages by viewing the logs on a syslog server, or by
accessing the device through Telnet, SSH, or through the console port.
Cisco devices produce syslog messages as a result of network events. Every syslog message contains
a severity level and a facility.
The smaller numerical levels are the more critical syslog alarms. The severity level of the messages
can be set to control where each type of message is displayed (i.e. on the console or the other
destinations). The complete list of syslog levels is shown in the table.
Emergency Level 0 - Warning Level 4: These messages are error messages about software or
hardware malfunctions; these types of messages mean that the functionality of the device is
affected. The severity of the issue determines the actual syslog level applied.
Notification Level 5: This notifications level is for normal, but significant events. For example,
interface up or down transitions, and system restart messages are displayed at the
notifications level.
Informational Level 6: This is a normal information message that does not affect device
functionality. For example, when a Cisco device is booting, you might see the following
informational message: %LICENSE-6-EULA_ACCEPT_ALL: The Right to Use End User License
Agreement is accepted.
Debugging Level 7: This level indicates that the messages are output generated from issuing
various debug commands.
In addition to specifying the severity, syslog messages also contain information on the facility. Syslog
facilities are service identifiers that identify and categorize system state data for error and event
message reporting. The logging facility options that are available are specific to the networking
device. For example, Cisco 2960 Series switches running Cisco IOS Release 15.0(2) and Cisco 1941
routers running Cisco IOS Release 15.2(4) support 24 facility options that are categorized into 12
facility types.
Some common syslog message facility codes reported on Cisco IOS routers include:
OSPF - Identifies that the syslog message was generated by the OSPF routing protocol.
SYS - Identifies that the syslog message was generated by the device operating system.
IPSEC - Identifies that the syslog message was generated by the IP Security encryption
protocol.
By default, the format of syslog messages on the Cisco IOS Software is as follows:
%facility-severity-MNEMONIC: description
For example, sample output on a Cisco switch for an EtherChannel link changing state to up is:
Here the facility is LINK and the severity level is 3, with a MNEMONIC of UPDOWN.
The most common messages are link up and down messages, and messages that a device produces
when it exits from configuration mode. If ACL logging is configured, the device generates syslog
messages when packets match a parameter condition.
By default, log messages are not timestamped. In the example, the R1 GigabitEthernet 0/0/0
interface is shutdown. The message logged to the console does not identify when the interface state
was changed. Log messages should be timestamped so that when they are sent to another
destination, such as a Syslog server, there is record of when the message was generated.
Use the command service timestamps log datetime to force logged events to display the date and
time. As shown in the command output, when the R1 GigabitEthernet 0/0/0 interface is reactivated,
the log messages now contain the date and time
Note: When using the datetime keyword, the clock on the networking device must be set, either
manually or through NTP, as previously discussed.
Syslog servers - Also known as log hosts, these systems accept and process log messages
from syslog clients.
Syslog clients - Routers or other types of equipment that generate and forward log messages
to syslog servers.
The topology in the figure identifies the syslog server at IP address 10.2.2.6. The rest of the servers
and devices in the topology can be configured as syslog clients, which send syslog messages to the
syslog server.
Step 1. Set the destination logging host using the logging [host] command.
Identify the destination syslog server using the logging host command
Parameter Description
hostname Specifies the name of the host you want to use as a syslog server.
ip-address Specifies the IP address of the host you want to use as a syslog server.
Step 2. (Optional) Set the log severity (trap) level using the logging trap command.
Step 3. (Optional) Set the source interface using the logging source-interface command.
This command specifies that syslog packets contain the IPv4 or IPv6 address of a specific interface
(e.g., a loopback interface), regardless of which interface the packet uses to exit the router.
Parameter Description
Step 4. (Optional) Enable logging to all enabled destinations with the logging on command.
Router(config)# logging on
The figure below shows a sample syslog configuration for R1. Use the show logging command to
view logging configuration and buffered syslog messages.
Before you get really deep into network management, the one thing that will help keep you on track
is ensuring that all of your components are set to the same time and date.
The software clock on a router or switch starts when the system boots. It is the primary source of
time for the system. It is important to synchronize the time across all devices on the network
because all aspects of managing, securing, troubleshooting, and planning networks require accurate
timestamping. When the time is not synchronized between devices, it will be impossible to
determine the order of the events and the cause of an event.
The date and time settings on a router or switch can be manually configured, as shown in the
example.
Although manually setting the time is easy, it is not practical in most networks. As a network grows, it
becomes difficult if not impossible to ensure that all infrastructure devices are operating with
synchronized time. Even in a smaller network environment, the manual method is not ideal. If a
router reboots, how will it get an accurate date and timestamp?
A better and more scalable solution is to implement Network Time Protocol (NTP) which is
documented in RFC 1305. NTP enables network devices (i.e., NTP clients) to synchronize their time
settings with an NTP authoritative time source such as an NTP server. The NTP time source can be a
device (e.g., a router) on the network that is selected as the private primary clock or it can be a
publicly available NTP server on the internet.
NTP source and clients open UDP port 123 to send and receive timestamps.
NTP networks use a hierarchical system of time sources. Each level in this hierarchical system is called
a stratum. The stratum level is defined as the number of hop counts from the authoritative source.
The figure displays a sample Network Time Protocol (N T P) network. N T P servers are arranged in
three levels showing the three strata. Stratum 1 is connected to Stratum 0 clocks. Stratum 0 consists
of two N T P clocks. The N T P clocks are connected to 2 Stratum 1 N T P servers. The Stratum 1 N T P
servers are connected to 3 Stratum 2 N T P servers. The Stratum 2 N T P servers are connected to 4
Stratum 3 N T P servers.
The sample network consists of four stratum levels who acquire their times as follows:
Stratum 1 server gets its time from the stratum 0 time source.
Stratum 0
This identifies a device providing the most authoritative time source. Stratum 0 devices including
atomic and GPS clocks are the most accurate authoritative time sources.
Specifically, NTP stratum 0 devices are non-network high-precision timekeeping devices assumed to
be accurate and with little or no delay associated with them. In the figure, they are represented by
the clock icon.
Stratum 1
NTP stratum 1 devices are network devices that are directly connected to the authoritative time
sources. They function as the primary network time standard to stratum 2 devices.
NTP stratum 2 servers are connected on a network to a stratum 1 device. Stratum 2 devices are NTP
clients and synchronize their time by using the NTP packets from a stratum 1 server such as a router.
They in turn can be NTP servers for stratum 3 devices.
NTP stratum levels are based on a scale of 0 (highest stratum level) to 15 (lowest stratum level). For
example, an NTP server in a low number stratum level is closer to the authorized time source than a
server in a high number stratum level.
The maximum stratum hop count is 15 (i.e., 0 – 15). Note that an NTP client that is not synchronized
with a server is assigned a stratum 16 level.
NTP servers in the same stratum level can be configured as peers to provide redundant time sources
for clients or to synchronize each other.
The figure shows the topology used to demonstrate NTP configuration and verification.
Before NTP is configured on the network, the show clock command displays the current time on the
software clock, as shown in the example. With the detail option, notice that the time source is user
configuration. That means the time was manually configured with the clock command.
In our topology, and internet NTP server is the authoritative time source. However, a local network
device could be selected as the NTP authoritative time source using the ntp master [stratum] global
configuration command.
In the topology, R1 is an NTP client of the NTP server. Use the ntp server ip-address global config
command to configure 209.165.200.225 as the NTP server for R1.
To verify the time source is set to NTP, use the show clock detail command. Notice that now the time
source is NTP.
In the next example, the show ntp associations and show ntp status commands are used to verify
that R1 is synchronized with the NTP server at 209.165.200.225. Notice that R1 is synchronized with
a stratum 1 NTP server at 209.165.200.225, which is synchronized with a GPS clock. The show ntp
status command displays that R1 is now a stratum 2 device that is synchronized with the NTP server
at 209.165.220.225.
Next, the clock on S1 is configured to synchronize to R1 with the ntp server command and then the
configuration is verified with the show ntp associations command, as displayed.
Output from the show ntp associations command verifies that the clock on S1 is now synchronized
with R1 at 192.168.1.1 via NTP. R1 is a stratum 2 device and NTP server to S1. Now S1 is a stratum 3
device that can provide NTP service to other devices in the network, such as end devices.
SNMP Configuration
6.7.1 Introduction to SNMP
Now that your network is mapped and all of your components are using the same clock, it is time to
look at how you can manage your network by using Simple Network Management Protocol (SNMP).
SNMP was developed to allow administrators to manage nodes such as servers, workstations,
routers, switches, and security appliances, on an IP network. It enables network administrators to
monitor and manage network performance, find and solve network problems, and plan for network
growth.
SNMP manager
To configure SNMP on a networking device, it is first necessary to define the relationship between
the manager and the agent.
The SNMP manager is part of a network management system (NMS). The SNMP manager runs SNMP
management software.
As shown in the figure, the SNMP manager can collect information from an SNMP agent by using the
“get” action. It can change configurations on an agent by using the “set” action. In addition, SNMP
agents can forward information directly to a network manager by using “traps”.
The SNMP agent and MIB reside on SNMP client devices. Network devices that must be managed,
such as switches, routers, servers, firewalls, and workstations, are equipped with an SNMP agent
software module. The MIB stores data and operational statistics about the device.
The SNMP Manager sends a get request to SNMP agent to access stored data in the local MIB.
Specifically, the SNMP manager polls the agents and queries the MIB for SNMP agents on UDP port
161. SNMP agents send any SNMP traps to the SNMP manager on UDP port 162.
SNMP agents that reside on managed devices collect and store information about the device and its
operation. This information is stored by the agent locally in the MIB. The SNMP manager then uses
the SNMP agent to access information within the MIB.
get request - Used by the NMS to query the device for data.
set request - Used by the NMS to change configuration variables in the agent device. A set
request can also initiate actions within a device. For example, a set request can cause a
router to reboot, send a configuration file, or receive a configuration file.
The SNMP manager uses the get and set actions to perform the operations described in the table.
Operation Description
Retrieves a value from a variable within a table; the SNMP manager does not need to
get-next-request know the exact variable name. A sequential search is performed to find the needed
variable from within a table.
Retrieves large blocks of data, such as multiple rows in a table, that would otherwise
get-bulk-request require the transmission of many small blocks of data. (Only works with SNMPv2 or
later.)
Get an MIB variable - The SNMP agent performs this function in response to a GetRequest-
PDU from the network manager. The agent retrieves the value of the requested MIB variable
and responds to the network manager with that value.
Set an MIB variable - The SNMP agent performs this function in response to a SetRequest-
PDU from the network manager. The SNMP agent changes the value of the MIB variable to
the value specified by the network manager. An SNMP agent reply to a set request includes
the new settings in the device.
The figure illustrates the use of an SNMP GetRequest to determine if interface G0/0/0 is up/up.
The MIB organizes variables hierarchically. MIB variables enable the management software to
monitor and control the network device. Formally, the MIB defines each variable as an object ID
(OID). OIDs uniquely identify managed objects in the MIB hierarchy. The MIB organizes the OIDs
based on RFC standards into a hierarchy of OIDs, usually shown as a tree.
The MIB tree for any given device includes some branches with variables common to many
networking devices and some branches with variables specific to that device or vendor.
RFCs define some common public variables. Most devices implement these MIB variables. In
addition, networking equipment vendors, like Cisco, can define their own private branches of the
tree to accommodate new variables specific to their devices.
The figure shows portions of the MIB structure defined by Cisco. Note how the OID can be described
in words or numbers to help locate a particular variable in the tree. OIDs belonging to Cisco, are
numbered as follows: .iso (1).org (3).dod (6).internet (1).private (4).enterprises (1).cisco (9).
Therefore, the OID is 1.3.6.1.4.1.9.
6.7.4 SNMP Versions
SNMPv1 - This is the Simple Network Management Protocol, a Full Internet Standard, that is
defined in RFC 1157.
All versions use SNMP managers, agents, and MIBs. Cisco IOS software supports the above three
versions. Version 1 is a legacy solution and is not often encountered in networks today. Therefore,
this course focuses on versions 2c and 3.
Both SNMPv1 and SNMPv2c use a community-based form of security. The community of managers
that is able to access the MIB of the agent is defined by a community string.
Unlike SNMPv1, SNMPv2c includes a bulk retrieval mechanism and more detailed error message
reporting to management stations. The bulk retrieval mechanism retrieves tables and large
quantities of information, minimizing the number of round-trips required. The SNMPv2c improved
error-handling includes expanded error codes that distinguish different kinds of error conditions.
These conditions are reported through a single error code in SNMPv1. Error return codes in SNMPv2c
include the error type.
Note: SNMPv1 and SNMPv2c offer minimal security features. Specifically, SNMPv1 and SNMPv2c can
neither authenticate the source of a management message nor provide encryption. SNMPv3 is most
currently described in RFCs 3410 to 3415. It adds methods to ensure the secure transmission of
critical data between managed devices.
SNMPv3 provides for both security models and security levels. A security model is an authentication
strategy set up for a user and the group within which the user resides. A security level is the
permitted level of security within a security model. A combination of the security level and the
security model determine which security mechanism is used when handling an SNMP packet.
There are available security models for SNMPv1, SNMPv2c, and SNMPv3. The table identifies the
characteristics of the different combinations of security models and levels.
A network administrator must configure the SNMP agent to use the SNMP version supported by the
management station. Because an agent can communicate with multiple SNMP managers, it is
possible to configure the software to support communications by using SNMPv1, SNMPv2c, or
SNMPv3.
In any network topology, at least one manager node should run SNMP management software.
Network devices that can be managed, such as switches, routers, servers, and workstations, are
equipped with the SNMP agent software module. These agents are responsible for providing the
SNMP manager access to a local MIB, which stores data about device operation.
SNMP is vulnerable to attack precisely because SNMP agents can be polled with get requests and
accept configuration changes with set requests, as shown in the figure. For example, a set request
can cause a router to reboot, send a configuration file, or receive a configuration file. An SNMP agent
can also be configured to send out traps or notifications. In SNMPv1 and SNMPv2c, these requests
and notifications are not authenticated or encrypted.
SNMP Operation
The figure shows an S N M P manager collecting information from an S N M P agent. In the figure an
S N M P Manager, depicted as a P C, is connected to a router, a switch and a firewall router. The
devices connected to the S N M P Manager are labeled as S N M P Agents and Managed Nodes. An
arrow labeled trap is pointed to the S N M P Manager indicating that S N M P agent devices send
traps to the S N M P manager. Text above reads In S N M P v 1, asynchronous event reports are called
traps while in later versions they are called notifications. There are two arrows pointed towards the S
N M P agents labeled Get and Set. These indicate that the S N M P manager sends the S N M P agents
Get and Set actions. Text below reads The actions get and set are the vulnerabilities that open S N M
P to an attack.
6.7.6 SNMPv3
SNMPv3 authenticates and encrypts packets over the network to provide secure access to devices.
This addressed the vulnerabilities of earlier versions of SNMP.
Message integrity and authentication - Ensures that a packet has not been tampered with in
transit, and is from a valid source.
Access control - Restricts each principal to certain actions on specific portions of data.
SNMPv3 can be secured with only a few commands, as shown in the following steps.
Note: A full discussion of the configuration options for SNMPv3 is beyond the scope of this course.
Step 1. Configure an ACL that will permit access to authorized SNMP managers.
Step 2. Configure an SNMP view with the snmp-server view command to identify the MIB OIDs that
the SNMP manager will be able to read. Configuring a view is required to limit SNMP messages to
read-only access.
SNMPv3 can be secured with only a few commands, as shown in the figure.
Step 3. Configure SNMP group features with the snmp-server group command:
Associate a view to the group and give it read only access with the read command.
Router(config)# snmp-server group group-name v3 priv read view-name access [acl-number | acl-
name]
Step 4. Configure SNMP group user features with the snmp-server user command:
Configure a username and associate the user with the group name configured in Step 3.
Set the authentication type to either md5 or sha and configure an authentication password.
SHA is preferred and should be supported by the SNMP management software.
Require encryption with the priv keyword and configure an encryption password.
Router(config)# snmp-server user username group-name v3 auth {md5 | sha} auth-password priv
{des | 3des | aes {128 | 192 | 256}} priv-password
Step 1. A standard ACL is named PERMIT-ADMIN and is configured to permit only the 192.168.1.0/24
network. All hosts attached to this network will be allowed to access the SNMP agent running on R1.
Step 2. An SNMP view is named SNMP-RO and is configured to include the entire iso tree from the
MIB. On a production network, the network administrator would probably configure this view to
include only the MIB OIDs that were necessary for monitoring and managing the network.
Step 3. An SNMP group is configured with the name ADMIN. SNMP is set to version 3 with
authentication and encryption required. The group is allowed read-only access to the view (SNMP-
RO). Access for the group is limited by the PERMIT-ADMIN ACL.
Step 4. An SNMP user, BOB, is configured as a member of the group ADMIN. SNMP is set to version
3. Authentication is set to use SHA, and an authentication password is configured. Although R1
supports up to AES 256 encryption, the SNMP management software only supports AES 128. So, the
encryption is set to AES 128, and an encryption password is configured.
Use this Syntax Checker to configure R1 with SNMPv3 authentication using an ACL.
Configure a standard access list named PERMIT-ADMIN on R1 to permit only the 192.168.1.0/24
network. Exit from ACL configuration to continue.
R1(config-std-nacl)#exit
Using the snmp-server view command, configure an SNMP view named SNMP-RO to include the
entire ISO tree from the MIB.
Using the snmp-server group command, configure an SNMP group with the name ADMIN. Set SNMP
to version 3 with authentication and encryption required. Allow read-only access to the view SNMP-
RO, and limit access using the PERMIT-ADMIN ACL.
Using the snmp-server user command, add an snmp user named BOB as a member of
the ADMIN group. Set SNMP to version 3 and set authentication to use SHA with a password
of cisco12345. Set the encryption to AES 128 with a password of cisco54321. After configuration is
complete, use the end command to exit configuration mode.
R1(config)#snmp-server user BOB ADMIN v3 auth sha cisco12345 priv aes 128 cisco54321
R1(config)#end
R1#
Verify most of the SNMPv3 security configuration by viewing the running configuration, as shown in
in the figure. Notice that the snmp-server user configuration is hidden. Use the show snmp
user command to view the user information.
Verify that the SNMP manager can send get requests to R1 by using an SNMP management tool,
such as the ManageEngine’s free SNMP MIB Browser. Configure the tool with the user details, as
shown in the figure. When a user is configured, use the SNMP management tool’s features to test
that the configured user can access the SNMP agent.
Verify that the data was encrypted by running a protocol analyzer, such as Wireshark, and capture
the SNMP packets.
Do an internet search to see Keith Barker’s demonstration of configuring and verifying SNMPv3.
NTP Configuration
The software clock on a router or switch starts when the system boots. It is the primary source of
time for the system. It is important to synchronize the time across all devices on the network
because all aspects of managing, securing, troubleshooting, and planning networks require accurate
timestamping. When the time is not synchronized between devices, it will be impossible to
determine the order of the events and the cause of an event. Although the system time can be
manually set, it is much more desirable to configure devices to use the Network Time protocol (NTP)
to synchronize time between all network devices. NTP enables network devices (i.e., NTP clients) to
synchronize their time settings with an NTP authoritative time source such as an NTP server. The NTP
time source can be a device (e.g., a router) on the network that is selected as the private primary
clock or it can be a publicly available NTP server on the internet. NTP uses a hierarchical system of
time sources that are arranged in strata. Stratum 0 is the most authoritative time source and it may
use atomic or GPS clocks. Stratum 1 devices obtain their time information from Stratum 0 sources.
Stratum 1 devices are connected to the Stratum 0 time sources and are also accessible to enterprise
networks. Stratum 2 and lower devices function as network servers that provide time information to
network devices. They are connected to Stratum 1 devices or other network devices that are acting
as NTP servers. There are up to 16 NTP strata. The lower the strata number, the closer the source is
to the Strata 0 authoritative source. NTP is configured on a device with the ntp server command.
SNMP Configuration
Simple Network Management Protocol (SNMP) was developed to allow administrators to manage
nodes such as servers, workstations, routers, switches, and security appliances, on an IP network.
SNMP defines how management information is exchanged between network management
applications and management agents. It is an application layer protocol that provides a message
format for communication between managers and agents. The SNMP system requires three
elements and consists of an SNMP manager, SNMP agent, and the management information base
(MIB). The SNMP manager is part of a network management system (NMS) that runs SNMP
management software. SNMP agents reside on network devices and enable network data collection
and sharing. The MIB stores standardized variables that contain network data. The network manager
can send a get request to retrieve information from an agent's local MIB, or it can send a set request
to change the value of a variable in the MIB. The MIB organizes variables hierarchically. MIB variables
enable the management software to monitor and control the network device. RFCs define some
common public variables that most devices support. In addition, networking equipment vendors, like
Cisco, can define their own private branches of the tree to accommodate new variables specific to
their devices. There are three versions of SNMP. SNMPv1 is obsolete and mentioned only but
SNMPv2c and SNMPv3 are relevant to this course. SNMPv2c should be used at a minimum with
SNMPv3 strongly recommended. SNMPv1 and SNMPv2c offer minimal security features. Specifically,
SNMPv1 and SNMPv2c can neither authenticate the source of a management message nor provide
encryption. SNMPv3 adds methods to ensure the secure transmission of critical data between
managed devices. SNMPv3 provides for both security models and security levels. A security model is
an authentication strategy set up for a user and the group within which the user resides. A security
level is the permitted level of security within a security model. A combination of the security level
and the security model determine which security mechanism is used when handling an SNMP
packet. SNMPv3 authenticates and encrypts packets over the network to provide secure access to
devices. This addressed the vulnerabilities of earlier versions of SNMP.