Sunday, May 6, 2012

Setting a VirtualBox XP Machine as an NTP Server in GNS3

The following is how I set an xp vm to act as an ntp authoritative time server for a LAN within GNS3. This took some time and yes, I know that setting one of the routers as the ntp server is much easier to do… but where’s the fun in that? This is just something I was fooling around with and how I got it to work.
Notes:
  • I refer to the Meinberg NTP software as simply NTP4.x
  • Network is converged, running EIGRP
  • WinXP is running Windows XP Pro
  • GNS3 0.8.1
  • VirtualBox 4.1.6







I first tried to configure the Windows Time service to use the xp vm internal hardware clock by changing the announce flag using regedit…see “How to configure an authoritative time server in Windows XP”


After making the changes to the announce flag (see link above) I configured R1:
(R2, R3 & R4 are configured similarly)














There are issues trying to synch to a w32 based time service, most notably the server is flagged as “insane, invalid”:



The root dispersion is > 1000ms which the IOS NTP rejects…in other words, this did not work. See: “NTP: Common issues and troubleshooting”

Solution: Install NTP 4.x
The workaround for my situation is to install NTP 4.x on the Virtual Machine running Windows XP. Details follow...

Check “Create an initial configuration file with the following settings”. My goal was to only use the system clock on WinXP therefore I did not choose any public NTP servers. I also know that the VirtualBox machine is sync’d to my host machine.  I checked “Add local clock as a last resort reference” and changed the Stratum to 7 though changing the stratum isn’t necessary.




Click Next > … a warning message appears:


Click Yes

Under NTP Service Settings I chose “Use SYSTEM account” as I don't want to sync to an external (internet) server; I want to use the xp vm clock. All other settings are left as defaulted…note the second check box, this will disable the w32time if you tried to configure it like I initially did (i.e., there is no need to stop w32time… run > cmd > net stop w32time )




Next > finishes the install.

Going back to R1, enable debugging for events, packets and synchronization.



 



A quick look shows that the clock is not yet synchronized and the association detail is still flagged as “insane, invalid”. For some reason the initial synchronization takes about 5 minutes (But subsequent reinstalls of ntp4.x take only about a minute to sync...!?!)



















If you keep an eye on the R1 console window, after 5 minutes or so, when synchronization happens you will see some logging debug output (if you have ntp packet & event debugging turned on).



















I have now established an ntp peer with WinXP.
R1 and R4 are shown below (note: these screen shots were taken the next day hence the time difference).






















Final Note:
The personal purpose for perpetuating this puzzle was in preparation to practice the creation of EIGRP MD5 authentication keys with limited lifetime key strings… and I wanted an outside source setting the network time. Though this seems to work, there is a flaw in that the Network-Time WinXP is sending to the routers is 7 hours ahead of real time. After hours of troubleshooting, I can only assume it has something to do with the gns3 emulation. Part of my troubleshooting included setting up NTP4.x on WinXP to sync online with internet time ‘time.windows.com’. This did nothing to alter the 7 hour time difference. Prost!

No comments:

Post a Comment