Author Topic: How to setup Network Time Protocol  (Read 1066 times)

Offline ZManGT

  • Sr. Member
  • ****
  • Posts: 94
  • Karma: 12
How to setup Network Time Protocol
« on: November 06, 2008, 10:55:52 AM »
If you are like me you might have had trouble setting up NTP on your Netscaler. I finally was able to get it working and wanted to give everyone the steps.

1. Set the timezone on your NetScaler.
    a. Log in via CLI (Use putty, hyperterminal cannot render the screen correctly)
    b. Run configns
    c. Select the options to set your appropriate timezone

2. Decide what NTP server you are going to use. Either use a Domain Controller or choose one of the free ones available online.

3. Test that you can successfully connect to the NTP server
     a. Drop into the SHELL
     b. type "ps axfu | grep ntp"
     c. type "kill <Process Number>" on any NTP processes currently running
     d. type ntpdate <IP of NTP server>

At this point your Netscaler will connect to the NTP server if it can and adjust it's time. If it does not verify there are no firewall rules or other devices that could be blocking communication. Try another NTP server as well to make sure it's not an issue with the individual server.

4. Setup your NetScaler to automatically adjust the time
     a. Drop into the SHELL
     b. CD to the /etc directory
     c. Use vi to open ntp.conf
     d. Uncomment the line server 1.1.1.1 burst and replace 1.1.1.1 with the IP of the NTP server you are going to use
     e. Comment the line restrict 172.0.0.1 mask 255.255.255.255
     d. Add the restrict ip line to the end making sure it uses the same IP as NTP server you are using.

Your file should now look like this if 22.22.22.22 was your NTP server
server 22.22.22.22 burst

restrict default ignore
#restrict 127.0.0.1 mask 255.255.255.255

#corresponds to 'server' entry above
restrict 22.22.22.22 mask 255.255.255.255

5. Copy the file over to your /nsconfig directory

6. Open your /nsconfig rc.conf file to include the following entry (Allows NTP daemon to start on reboots)
     a. ntpd_enable="YES"

7. Start your daemon without rebooting
    a. Run the following command in the shell "/usr/sbin/ntpd -c /nsconfig/ntp.conf -l /var/log/ntpd.log &"


Hopefully this helps everyone out.

 

Offline Marco Schirrmeister

  • Sr. Member
  • ****
  • Posts: 96
  • Karma: 14
Re: How to setup Network Time Protocol
« Reply #1 on: December 02, 2008, 04:58:26 PM »
I have more or less the same configured like you.
The only difference is that I also added the options, that you have specified during the startup of the ntp daemon, to the rc.conf file.

So in details I have the following in my /nsconfig/rc.conf file.

ntpd_enable="YES"
ntpd_flags="-c /nsconfig/ntp.conf -l /var/log/ntpd.log"

Without the ntpd_flags the ntpd daemon is started without this options after a reboot.
Maybe this two options are the default values and they are also used without specifying it.
But just to be safe I have added them too to the rc.conf file.


Marco


Offline FishH20

  • Jr. Member
  • **
  • Posts: 22
  • Karma: 2
Re: How to setup Network Time Protocol
« Reply #2 on: December 02, 2008, 06:06:55 PM »
A friend recomends this too:

1. You must add the "ntpd -c /nsconfig/ntp.conf -l /var/log/ntpd.log &" command below to rc.netscaler otherwise your NTP won't survive reboot.

2. Probably good idea to pass in -g flag to survive large clock drift.


Offline Radmin

  • Contributor
  • *
  • Posts: 1
  • Karma: 1
Re: How to setup Network Time Protocol
« Reply #3 on: March 11, 2009, 08:17:46 AM »
Excellent info. I spent an hour on the phone yesterday with Citrix tech support getting this to work. Now I know to come here first  8)