Skip to content

Setting up NTP on HP Switches – HP Networking Series Part 3

This is a short guide on how to set up NTP time synchronisation on HP Network devices. I’ll be covering SNTP settings in this guide, as well as some of the niftier things that aren’t in the manuals but still are really handy. NTP time synchronisation allows you to maintain correct time across your network, which is very important for troubleshooting when comparing logs between two switches for example.

Write the old config to memory

Start by issuing the command “write memory” before you do anything, that way you can boot the switch to recover your previous settings if you mess something up.
If you’re doing this over Telnet/SSH and the switch is miles away, you might want to consider using the reload command as well to tell the switch to reboot after a couple of hours if you loose access to it, see my article on how to do this.

Configuring General Time Settings

First, we need to configure stuff like time zone and DST (Day-Light Savings Time) rules.
Enter config mode by typing “configure”

SW1# configure 

Now we’ll set the DST rule:
Type “time day” and hit tab to autocomplete. Hit tab again to show you the available options.

SW1(config)# time daylight-time-rule 

Write the beginning of the option you want, hit tab again, and hit enter. I’ll use “western-europe” here in Finland.

SW1(config)# time daylight-time-rule western-europe

Then, we’ll set the time zone with the following command:

SW1(config)# time timezone +120

This sets the normal (non-DST) time to GMT+2, so after timezone, type you GMT offset in minutes.

Configuring SNTP Time Synchronisation

First, we’ll set the timesync setting to sntp

SW1(config)# timesync sntp

That’ll enable SNTP, so now that we’ve got that sorted, let’s move on to configuring SNTP with the “sntp” command.

First, we’ll set the SNTP mode to unicast:

SW1(config)# sntp unicast

Then we’ll add the settings for which server to query for time.

I’ll paste the console output here so you can see how it’s done IRL, and remember that if you hit tab in the middle of a command the switch will give you tips or a list of options:

SW1(config)# sntp 
authentication Enable sntp Authentication 
broadcast Operate in broadcast mode 
<30-720> The amount of time between updates of the system clock via SNTP 
server Configure SNTP servers to poll time from. 
unicast Operate in unicast mode
SW1(config)# sntp server 
priority Priority of the Server Address.
SW1(config)# sntp server priority 
<1-3> Enter a number for the 'priority' command/parameter.
SW1(config)# sntp server priority 1 
IP-ADDR SNTP server IPv4 address. 
IPV6-ADDR SNTP server IPv6 address.
SW1(config)# sntp server priority 1

That’ll set the NTP server to priority 1 in the switch config, i.e. the server it will check time against first. You can add additional servers with priority 2 and 3 as backup servers.

Check your settings

Check your settings so that they actually worked:

SW1(config)# show time 
Mon Nov 11 14:53:35 2013
SW1(config)# show sntp
SNTP Configuration
SNTP Authentication : Disabled 
Time Sync Mode: Sntp 
SNTP Mode : Unicast 
Poll Interval (sec) [720] : 720 
Source IP Selection: Outgoing Interface
Priority SNTP Server Address Version Key-id 
-------- --------------------------------------- ------- ---------- 
1 3 0

If the time is still wrong, you might wanna check your settings.

Write the new config to memory

Remember to issue the command “write memory” to push your new settings to memory when you’ve verified that everything works.

A couple of tips;

Some SNTP/NTP servers might require authentication, and you can set all that with the sntp command.
SNTP is the same as NTP, except that it’s missing a lot of the sync features of NTP (but since you don’t need µsec accuracy on a switch, you’ll be fine). NTP servers usually answers SNTP requests, so don’t worry about that either.
A little known fact is that most Microsoft Domain Controllers will actually answer SNTP requests, so try that if you don’t have a separate NTP server in your network.

This post is part of a new series called Network Friday, where I explain a new networking concept every Friday and tell you have to configure it on (mostly) HP hardware. The series will mostly focus on the configuration side, as I feel there are lots of resources out there that do a fine job of explaining complex concepts, but very few that show you how to do it on your specific hardware. This series aims to address this somewhat, at least on the HP side of the fence.

This how-to was originally posted over at the Spiceworks community:

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: