Courseiva
SystemGlobal Config

ntp master [stratum]

Configures the router to act as an NTP master server, providing time synchronization to other devices when no external NTP source is available.

Definition: ntp master [stratum] is a Cisco IOS global config command. Configures the router to act as an NTP master server, providing time synchronization to other devices when no external NTP source is available.

Overview

The `ntp master [stratum]` command is used in Cisco IOS to configure a router as an NTP (Network Time Protocol) master server. This command is essential in environments where no external NTP source (such as a public NTP server or a dedicated time source) is available, and the router itself must provide time synchronization to other devices on the network. The router acts as the authoritative time source, using its own system clock to serve NTP requests from clients.

The stratum value indicates the distance from the primary reference clock; a lower stratum number represents a more authoritative source. The default stratum is 8, but you can set it from 1 to 15. Stratum 1 is the highest (most accurate) and is typically reserved for devices directly synchronized to a highly accurate time source like a GPS or atomic clock.

Stratum 16 indicates unsynchronized. When you configure a router as an NTP master, it will not synchronize to any external NTP server; it relies solely on its internal clock. This command is particularly useful in lab environments, isolated networks, or during initial network deployment where external connectivity is not yet established.

It is also used as a fallback when external NTP sources are unreachable, ensuring that network devices still have a consistent time reference for logging, authentication, and troubleshooting. The command is entered in global configuration mode and does not require any special privilege level beyond the standard enable mode (privilege level 15). The configuration is stored in the running configuration and can be saved to startup configuration.

One important behavior is that the router will not act as an NTP master if it has not set its own clock; you must ensure the clock is set either manually or via another method. Additionally, the router will not synchronize to any other NTP server while configured as a master; it will only serve time. This command is often used in conjunction with `ntp server` commands on client devices to point them to the master.

Alternatives include using a dedicated NTP server appliance or using the `ntp peer` command for symmetric active mode, but `ntp master` is the simplest way to create a time source on a router. In a broader workflow, after configuring the master, you would verify with `show ntp status` and `show ntp associations` to ensure the router is providing time. Troubleshooting often involves checking that the clock is set and that the stratum is appropriate.

Overall, this command is a fundamental tool for time synchronization in Cisco networks.

Syntax·Global Config
ntp master [stratum]

When to Use This Command

  • Setting up a small lab or isolated network where no external NTP server is reachable, using the router as the time source.
  • Configuring a router as a backup NTP server for a branch office that loses WAN connectivity to the primary NTP server.
  • Providing a local NTP source for network devices in a secure environment where external NTP access is blocked.
  • Using a router as the NTP master for a network segment to reduce load on external servers and improve time accuracy.

Parameters

ParameterSyntaxDescription
stratum<1-15>Specifies the stratum level of the NTP master. Valid values are from 1 to 15. The default is 8. A lower stratum indicates a more accurate time source. Stratum 1 is typically used for devices directly synchronized to a primary reference clock. Common mistakes include setting the stratum too low (e.g., 1) when the router's clock is not highly accurate, which can mislead clients about the time source's reliability.

Command Examples

Basic NTP Master with Default Stratum

ntp master

No output is generated. The command configures the router as an NTP master with default stratum 8. The router will serve time to NTP clients.

NTP Master with Custom Stratum

ntp master 5

No output is generated. The command sets the router's NTP stratum to 5, making it appear closer to the authoritative time source (lower stratum is better). Clients will prefer lower stratum servers.

Understanding the Output

The 'ntp master' command does not produce any output upon execution. To verify the configuration, use 'show ntp status' or 'show ntp associations'. In 'show ntp status', look for 'Clock is synchronized' and the stratum level.

A lower stratum (e.g., 5) indicates higher accuracy. If the router is not synchronized to any external source, it will serve time at its configured stratum. Ensure that the NTP master is reachable by clients and that NTP is enabled globally with 'ntp enable' if required.

Configuration Scenarios

Configure a router as NTP master for a small office network

A small office network has no internet access and no external NTP server. The network administrator wants to ensure all devices (switches, routers, and servers) have synchronized time for logging and authentication. The router R1 will act as the NTP master.

Topology

R1(Gi0/0)---192.168.1.0/24---(Gi0/0)SW1, (Gi0/1)R1---10.0.0.0/24---Server

Steps

  1. 1.Step 1: Enter global configuration mode: configure terminal
  2. 2.Step 2: Set the router's clock to the current time: clock set 14:30:00 15 March 2025
  3. 3.Step 3: Configure the router as NTP master with stratum 5: ntp master 5
  4. 4.Step 4: (Optional) Configure NTP authentication if required: ntp authentication-key 1 md5 mykey, ntp trusted-key 1, ntp authenticate
  5. 5.Step 5: Exit configuration mode: end
  6. 6.Step 6: Save the configuration: write memory
Configuration
!
configure terminal
clock set 14:30:00 15 March 2025
ntp master 5
end
write memory

Verify: Use 'show ntp status' to verify the router is acting as master. Expected output includes 'Clock is synchronized, stratum 5, reference is .LOCL.' Use 'show ntp associations' to see if any clients have associated.

Watch out: Forgetting to set the clock before enabling NTP master. If the clock is not set, the router will not serve time and will show stratum 16.

Configure a router as NTP master with default stratum for lab environment

In a CCNA lab, multiple routers need synchronized time for OSPF neighbor formation and logging. No external NTP source is available. The instructor wants to use one router as the master with default stratum.

Topology

R1(Gi0/0)---10.0.12.0/30---(Gi0/0)R2, R1(Gi0/1)---10.0.13.0/30---(Gi0/0)R3

Steps

  1. 1.Step 1: Enter global configuration mode: configure terminal
  2. 2.Step 2: Set the clock on R1: clock set 10:00:00 1 January 2025
  3. 3.Step 3: Configure R1 as NTP master (default stratum 8): ntp master
  4. 4.Step 4: On R2 and R3, configure NTP server pointing to R1: ntp server 10.0.12.1 (on R2) and ntp server 10.0.13.1 (on R3)
  5. 5.Step 5: Exit and save on all routers
Configuration
! On R1:
configure terminal
clock set 10:00:00 1 January 2025
ntp master
end
write memory

! On R2:
configure terminal
ntp server 10.0.12.1
end
write memory

! On R3:
configure terminal
ntp server 10.0.13.1
end
write memory

Verify: On R1: 'show ntp status' shows stratum 8. On R2 and R3: 'show ntp status' shows stratum 9 (one level below master). 'show ntp associations' shows the master's IP.

Watch out: Clients may not synchronize immediately; NTP polling interval is typically 64 seconds. Use 'show ntp associations detail' to see if client is synchronized.

Troubleshooting with This Command

When troubleshooting NTP master configuration, the primary tool is `show ntp status`. A healthy output for a master will show 'Clock is synchronized, stratum [value], reference is .LOCL.' The reference .LOCL indicates the router is using its local clock. If the output shows 'Clock is unsynchronized, stratum 16', it means the router is not acting as a master or the clock is not set.

Common symptoms include clients not synchronizing, which can be due to the master not having its clock set, incorrect stratum, or network connectivity issues. Another useful command is `show ntp associations`, which lists all NTP associations. For a master, this should be empty (no outbound associations) unless you also configured `ntp server` or `ntp peer`.

If clients are not appearing, check that they can reach the master via NTP (UDP port 123). Use `debug ntp all` with caution as it can be verbose; it shows NTP packets sent and received. A step-by-step diagnostic flow: 1) Verify the master's clock is set with `show clock`. 2) Check `show ntp status` for stratum and synchronization. 3) On a client, check `show ntp status` to see if it is synchronized to the master. 4) Use `ping` from client to master to test connectivity. 5) Use `telnet` to the master's NTP port (123) is not possible; instead, use `show ntp associations detail` on the client to see if the master is reachable.

If the master is not responding, check ACLs that might block NTP (UDP 123). Also, ensure that the master's clock is not too far off; NTP will not synchronize if the time difference is more than 1000 seconds (about 17 minutes) unless `ntp server` with `prefer` or `ntp access-group` is configured. Another common issue is stratum mismatch: if the master has a high stratum (e.g., 15), clients may prefer other sources.

For troubleshooting, correlate `show ntp status` with `show logging` to see if NTP events are logged. The command `show ntp associations detail` provides the IP address, stratum, and synchronization status of each association. If the master is configured but clients show 'unsynchronized', check the master's `show ntp status` for any errors.

Also, verify that the master's NTP service is enabled (it is by default when configured). In summary, the key indicators are stratum value, reference clock, and synchronization status.

CCNA Exam Tips

1.

Remember that 'ntp master' sets the router as an NTP server; the default stratum is 8, but you can set it from 1 to 15.

2.

In the CCNA exam, know that a lower stratum number means higher priority; a stratum 1 device is directly connected to an authoritative time source.

3.

Be aware that 'ntp master' is used when there is no external NTP source; if an external source is available, use 'ntp server' instead.

4.

The 'show ntp status' command displays the current stratum and synchronization status; a stratum of 16 means unsynchronized.

Common Mistakes

Forgetting to enable NTP globally with 'ntp enable' on some platforms, causing the master to not respond to clients.

Setting the stratum too low (e.g., 1) without an actual reference clock, misleading clients about time accuracy.

Using 'ntp master' on a router that is also configured as an NTP client with 'ntp server', which can cause conflicts.

ntp master [stratum] vs ntp server [ip]

The 'ntp master' and 'ntp server' commands are commonly confused because both configure NTP on a Cisco router, but they serve opposite roles: one makes the router a time source (master), the other makes it a time client (server). Understanding their differences is crucial for proper time synchronization in a network.

Aspectntp master [stratum]ntp server [ip]
RoleActs as NTP server (time source) for clientsActs as NTP client (synchronizes to an external server)
Direction of Time SyncProvides time to other devicesReceives time from a specified server
Stratum ConfigurationSets stratum level (1-15); lower number indicates higher accuracyStratum is determined by the server, not configurable locally
External DependencyNo external NTP source required; self-containedRequires reachability to the specified NTP server
Typical Use CaseIsolated networks or as a backup when external sync failsNetworks with reliable external NTP sources (e.g., GPS or internet)

Use ntp master [stratum] when you need the router to provide time to other devices in a network without access to an external, reliable NTP source.

Use ntp server [ip] when you have a stable external NTP source (e.g., public NTP servers or a dedicated NTP appliance) and want the router to synchronize its clock accurately.

Platform Notes

In IOS-XE (e.g., Catalyst 9000 switches), the `ntp master` command syntax is identical to classic IOS. However, the output of `show ntp status` may include additional fields like 'Clock offset' and 'Root delay'. In NX-OS (Cisco Nexus switches), the equivalent command is `ntp master [stratum]` as well, but NX-OS uses a different configuration hierarchy; you must enter `configure terminal` and then `ntp master [stratum]`.

The verification commands are `show ntp status` and `show ntp peers`. Note that NX-OS does not support NTP authentication in the same way; it uses `ntp authentication-key` and `ntp trusted-key` but with different syntax. On ASA firewalls, the equivalent command is `ntp server` (ASA cannot act as an NTP master; it can only be a client).

For IOS versions, the `ntp master` command has been available since IOS 12.0 and remains unchanged in 15.x and 16.x. In IOS-XR, the command is `ntp master [stratum]` under `configure` mode, but the stratum range is 1-15 as well. However, IOS-XR uses a different NTP implementation and the output of `show ntp status` is more detailed.

There are no major syntax differences between versions, but always check the specific platform documentation for any minor variations.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions