Skip to content

Intermediate · IP services: DHCP, DNS, NAT and more · topic 39 of 57 · 30 min

Management services: NTP, SNMP, syslog and TFTP

Explanation

NTP keeps every device's clock correct, which matters for logs, certificates and logins. SNMP lets a monitoring server read values from devices and receive alerts (traps). Syslog sends log messages, each with a severity from 0 (emergency) to 7 (debugging), to a central server. TFTP and FTP move IOS images and configuration backups.

NTP: the right time everywhere

NTP (Network Time Protocol) synchronises clocks over the network using UDP port 123. Correct time sounds boring until it is wrong: log messages from ten devices cannot be put in order if each clock says something different; certificates appear "not yet valid" or "expired", so HTTPS and VPNs fail; and logins with Kerberos or one-time codes fail when clocks drift by a few minutes.

NTP is arranged in strata (levels). Stratum 0 is a reference clock such as GPS or an atomic clock. A stratum 1 server is directly connected to one. A server that learns time from stratum 1 is stratum 2, and so on. Lower numbers are closer to the source. Stratum 16 means "not synchronised". In India, official time (IST) is maintained by the CSIR National Physical Laboratory in New Delhi.

output
R1(config)# ntp server 192.0.2.123
R1(config)# clock timezone IST 5 30
R1(config)# service timestamps log datetime msec localtime

R1# show ntp status
Clock is synchronized, stratum 3, reference is 192.0.2.123
R1# show ntp associations
R1# show clock
Cisco IOS: the router becomes an NTP client (and can serve time to others). The time zone is UTC +5:30, and log messages get date and milliseconds.

In a lab with no internet, ntp master 3 makes a router act as an authoritative time source at stratum 3 for the others.

SNMP: monitoring devices

SNMP (Simple Network Management Protocol) lets a monitoring system, the manager or NMS (network management station), talk to an agent running on each router, switch, firewall or printer. The agent keeps values such as interface traffic, CPU load and uptime in a structure called the MIB (management information base). Each value has an OID (object identifier), a dotted number such as 1.3.6.1.2.1.1.5.0, which is the device's name (sysName).

MessageDirectionPurpose
Get / GetNext / GetBulkManager to agentRead one value, the next value, or many values
SetManager to agentChange a value (for example, shut an interface)
TrapAgent to managerUnasked alert, such as "link down". Not acknowledged.
InformAgent to managerLike a trap, but the manager acknowledges it, so it is resent if lost

The agent listens on UDP port 161 for Get and Set requests; the manager listens on UDP port 162 for traps and informs. SNMPv2c protects access only with a community string, a shared word sent in clear text, so anyone capturing packets can read it. SNMPv3 adds users with authentication (proving who sent the message) and encryption (hiding its contents). Use v3 with the authPriv level wherever possible.

output
! SNMPv2c, read-only (simple, but the community travels in clear text)
R1(config)# snmp-server community NOC-view RO
R1(config)# snmp-server host 10.0.0.20 version 2c NOC-view
R1(config)# snmp-server enable traps
! SNMPv3 with authentication and encryption
R1(config)# snmp-server group NOCGROUP v3 priv
R1(config)# snmp-server user nocadmin NOCGROUP v3 auth sha <auth-password> priv aes 128 <priv-password>
Cisco IOS: RO means read-only. Never use RW with v2c, and never leave the community as "public".

Syslog: the device's diary

Devices write log messages about events: an interface going down, a neighbour lost, a login, a config change. By default they appear on the console. Syslog sends them to a central server over UDP port 514, so you can search the logs of every device in one place and keep them after a reboot. Each Cisco message has the form %FACILITY-SEVERITY-MNEMONIC: description.

output
*Oct 19 10:15:02.123: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to down
*Oct 19 10:15:03.130: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down
*Oct 19 10:20:41.002: %SYS-5-CONFIG_I: Configured from console by admin on vty0 (10.0.0.50)
Cisco IOS: LINK is the facility, 3 the severity (error), UPDOWN the mnemonic.
LevelKeywordMeaning
0emergenciesSystem unusable
1alertsImmediate action needed
2criticalCritical condition
3errorsError condition
4warningsWarning
5notificationsNormal but significant
6informationalInformation only
7debuggingDebug output
Tip: Remember the order with: Every Awesome Cisco Engineer Will Need Ice cream Daily (Emergency, Alert, Critical, Error, Warning, Notification, Informational, Debugging). A LOWER number is MORE serious.
output
R1(config)# logging host 10.0.0.30
R1(config)# logging trap warnings
R1(config)# logging buffered 16384 informational
R1(config)# line console 0
R1(config-line)# logging synchronous
R1# show logging
R1# terminal monitor
Cisco IOS: logging trap warnings sends levels 0 to 4 to the server. terminal monitor shows logs in an SSH session.

Choosing a level means "this level and everything more serious". logging trap warnings sends 0, 1, 2, 3 and 4, but not notifications such as interface line protocol changes (level 5).

TFTP and FTP: moving files

TFTP (Trivial File Transfer Protocol, UDP port 69) is a very simple way to copy files with no login and no encryption. Network teams use it in labs and closed management networks to back up configurations and to load IOS images. FTP (TCP ports 20 and 21) adds a username and password, still unencrypted. SCP over SSH (TCP 22) is the safer choice on production networks.

output
R1# copy running-config tftp:
Address or name of remote host []? 10.0.0.30
Destination filename [r1-confg]? R1-2026-10-19.cfg
R1# copy tftp: flash:
R1# show flash:
Cisco IOS: back up the running config to a TFTP server, and copy a file (such as a new IOS image) into flash.
Careful: Common mistakes: (1) no NTP, so logs from different devices cannot be lined up during an incident; (2) logging trap set to debugging, flooding the syslog server; (3) mixing up the order: level 0 is the MOST serious, not the least; (4) SNMPv2c with a guessable community like "public", or with RW access; (5) blocking UDP 161/162/514/123 on a firewall between devices and the monitoring servers.

Need help?

Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.

Try:

Watch the lesson

Management services: NTP, SNMP, syslog and TFTP · 1/8

Management services

In this lesson you will meet the services that keep a network manageable: NTP, SNMP, syslog and TFTP.

Prefer a video by a teacher? Find free videos on “ccna ntp snmp syslog severity levels explained” on YouTube ↗

In real life: Finding the cause of a 2 am outage

At a payment company in Mumbai, UPI transactions failed for four minutes at 2:07 am. Because every router, switch and firewall uses the same NTP servers and sends syslog to one server, the on-call engineer filtered all messages between 2:00 and 2:15 at level 5 or more serious. In order, she saw a %LINK-3-UPDOWN on a core link, then %OSPF-5-ADJCHG neighbour down messages, then the link back up. The SNMP monitoring graph showed CRC errors rising on that port for two days. A bad optic was replaced the next morning.

Practice (0/3 done)

Task 1 · Code · Python

Cisco log lines contain a tag like %LINK-3-UPDOWN: the facility, the severity (0 to 7) and a mnemonic. Write severity(line) that returns the severity as an int, or None if the line has no such tag. Use the re module.

Task 2 · Code · Python

Now act like logging trap. Write filter_logs(lines, max_level) that returns only the lines whose severity is max_level or MORE serious (a number less than or equal to max_level), in the same order. Lines without a tag are dropped. A severity() helper is given in the starter.

Task 3 · Question

A router has "logging trap notifications". Which message is NOT sent to the syslog server?

Quick quiz

Question 1

1.Which port does NTP use?

Question 2

2.Which syslog severity is the most serious?

Question 3

3.Which SNMP version adds authentication and encryption?

Question 4

4.A device sends an alert to the manager and the manager confirms it received it. Which SNMP message is this?

Question 5

5.What does stratum 1 mean for an NTP server?

Read more (free)

Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.

Which port does NTP use?

Answer: UDP 123

NTP uses UDP 123. 161 is SNMP and 514 is syslog.

Which syslog severity is the most serious?

Answer: 0 emergencies

Level 0, emergencies, is the most serious; the lower the number, the worse.

Which SNMP version adds authentication and encryption?

Answer: v3

SNMPv3 has users with authentication and encryption; v1 and v2c use clear-text community strings.

A device sends an alert to the manager and the manager confirms it received it. Which SNMP message is this?

Answer: Inform

An inform is acknowledged by the manager; a trap is not.

What does stratum 1 mean for an NTP server?

Answer: It is directly connected to a reference clock such as GPS

Stratum 0 is the reference clock; a stratum 1 server is attached to it directly.

Which service keeps the clock synchronised on RHEL 9?Related

Answer: chronyd

RHEL uses chrony; ntpd is no longer shipped.

From Tuning profiles with tuned, and time with chrony

Why must all devices sync time with NTP?Related

Answer: So log timestamps line up and timelines are accurate

Mismatched clocks make it impossible to order events correctly.

From Logs and log sources

Which log line is safe to write?Related

Answer: {"requestId":"9f1c2a","status":201,"durationMs":48,"userId":17}

Ids, status codes and times help debugging. Passwords, cookies and note text must never be logged.

From Monitoring, logs and alerts

Traffic to a server on port 443 is…Related

Answer: Usually HTTPS, but any program can use that port

Port numbers are conventions. Malware often uses 443 to blend in with normal traffic.

From Ports and protocols

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

Next steps

  1. 1 more topic in “IP services: DHCP, DNS, NAT and more” before its exam: QoS basics: keeping voice and video clear.
  2. Module 8 exam: IP services · 15 questions · 25 min, without help. 5 topics of this module still to finish first.
  3. Then the next module, Network security. 57 topics left in the course before the final exam.

← Previous: NAT and PAT